- Home
- Forum
- ASP.NET Web Forms (Classic)
- Rotate PDF pages.
Rotate PDF pages.
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
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
SIGN IN To post a reply.
3 Replies
SS
Sri Subhashini M
Syncfusion Team
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
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
RR
Ravi Ravichandran
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
>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
SS
Sri Subhashini M
Syncfusion Team
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
Glad to know that the issue has been resolved.
Please let me know if you need any information.
Regards,
Suba
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
RR Ravi Ravichandran
- Nov 7, 2008 10:16 PM UTC
- Nov 13, 2008 10:53 AM UTC