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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

PdfPageSize.A4 for convertion from xps to pdf

Thread ID:

Created:

Updated:

Platform:

Replies:

148423 Oct 18,2019 11:32 AM UTC Oct 21,2019 01:49 PM UTC WPF 1
loading
Tags: PDF
sepideh
Asked On October 18, 2019 11:41 AM UTC

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");
        }

Sowmiya Loganathan [Syncfusion]
Replied On 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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon