We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

PdfPageSize.A4 for convertion from xps to pdf

Hello everyone,


I am testing one of the  syncfusion dll.I want my document to be saved in A4 size after converting from xps to pdf.But it does not work...Is there any solution?

My second question is that my xps file is in memory..Actually it comes from FlowDocumentReader in wpf...Is there any possibility to convert the content directly to pdf without saving it as a xps file?

Thanks in advance

 XPSToPdfConverter converter = new XPSToPdfConverter();

            //Convert the XPS to PDF

            PdfDocument document =  converter.Convert("C:\\Users\\student\\source\\repos\\FlowDoproj\\bin\\Debug\\helloworld.xps");
            //Save and close the document
            document.PageSettings.Size = PdfPageSize.A4;
            document.PageSettings.Orientation = PdfPageOrientation.Portrait;
            document.PageSettings.Rotate = PdfPageRotateAngle.RotateAngle0;
            document.Save("C:\\Users\\student\\source\\repos\\FlowDoproj\\bin\\Debug\\syncfusion.pdf");

            document.Close(true);
            MessageBox.Show("pdf file is saved now");
        }

1 Reply

SL Sowmiya Loganathan Syncfusion Team October 21, 2019 01:49 PM UTC

Hi sepideh, 

Thank you for contacting Syncfusion support.  

I am testing one of the  syncfusion dll.I want my document to be saved in A4 size after converting from xps to pdf.But it does not work...Is there any solution? 
At present we do not have support to save PDF document size as A4 after converting XPS to PDF.  
My second question is that my xps file is in memory..Actually it comes from FlowDocumentReader in wpf...Is there any possibility to convert the content directly to pdf without saving it as a xps file?  
You can get the text from FlowDocumentReader and then convert that text to PDF using the code snippet in the below link, 


Regards, 
Sowmiya Loganathan 


Loader.
Live Chat Icon For mobile
Up arrow icon