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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Rotate PDF pages.

Thread ID:

Created:

Updated:

Platform:

Replies:

77594 Nov 7,2008 10:16 PM UTC Nov 13,2008 10:53 AM UTC ASP.NET Web Forms (Classic) 3
loading
Tags: PDF
Ravi Ravichandran
Asked On November 7, 2008 10:16 PM UTC

Hi there,

Is there a way to rotate pages in an existing PDF. I am using
PdfLoadedDocument pdfLoadedDocument = new PdfLoadedDocument(inFile);

Where inFile is a FileStream.

Let’s say I have five pages, 2 landscape and 3 portrait, would like to go rotate the 2 landscape pages to portrait and save the pdf. Is this possible, if not what is the work around, we don't have control over the PDF creation.

thanks,

Ravi



Sri Subhashini M [Syncfusion]
Replied On November 10, 2008 01:30 PM UTC

Hi,

Thank you for choosing Syncfusion product.

If your intention is to change the orientation of an existing PDF document, it can be achieved by importing existing document pages into new document and we can change the Orientation for a single page by using the class Orientation.

Kindly look into the sample code snippet,

PdfLoadedDocument ldoc = new PdfLoadedDocument(@"..\..\Data\pdf.pdf");

// Create a new document class object.
PdfDocument doc = new PdfDocument();

doc.ImportPageRange(ldoc, 0, ldoc.Pages.Count - 1);
//lets only rotate the 1st page
PdfPage page = doc.Pages[0];

page.Section.PageSettings.Orientation = PdfPageOrientation.Portrait;

doc.Save("Sample.pdf");


Please do find the sample from the below specified location and let me know if this helps,

http://www.syncfusion.com/support/user/uploads/Pdf_Window_77594_ee50fb5e.zip

Regards,
Suba




Ravi Ravichandran
Replied On November 10, 2008 05:45 PM UTC

Thanks Suba, it helped.

>Hi,

Thank you for choosing Syncfusion product.

If your intention is to change the orientation of an existing PDF document, it can be achieved by importing existing document pages into new document and we can change the Orientation for a single page by using the class Orientation.

Kindly look into the sample code snippet,

PdfLoadedDocument ldoc = new PdfLoadedDocument(@"..\..\Data\pdf.pdf");

// Create a new document class object.
PdfDocument doc = new PdfDocument();

doc.ImportPageRange(ldoc, 0, ldoc.Pages.Count - 1);
//lets only rotate the 1st page
PdfPage page = doc.Pages[0];

page.Section.PageSettings.Orientation = PdfPageOrientation.Portrait;

doc.Save("Sample.pdf");


Please do find the sample from the below specified location and let me know if this helps,

http://www.syncfusion.com/support/user/uploads/Pdf_Window_77594_ee50fb5e.zip

Regards,
Suba






Sri Subhashini M [Syncfusion]
Replied On November 13, 2008 10:53 AM UTC

Hi Ravi,

Glad to know that the issue has been resolved.

Please let me know if you need any information.

Regards,
Suba


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.

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

;