Rotate PDF Document Pages in Visual C# Application

Detailed Visual C# tutorial with Demo Codes to Rotate PDF Document Pages
OK, you just found out that you have scanned your PDF document in the wrong direction and now the PDF file is a total mess? Don't worry! Yiigo .NET Image SDK, which is a comprehensive PDF document image processing library toolkit, has included a mature C# PDF editing DLL component which can easily rotate your PDF file in any direction with user defined degrees ranging from 0 to 360.
This Visual C# .NET PDF manipulation library component can efficiently change the direction of the whole PDF document (meaning all of the pages within the PDF file), or a single page or batches of it. It is all up to you. You can define the page(s) to be rotated with Visual C# .NET programming language. In addition, you can define the accurate rotation rate by compiling C# codes. Furthermore, you can save the PDF with updated orientation as a new file and save it to you local disk for future processing.
On top of that, this .NET PDF control library is quite powerful yet very easy to use. Written in Visual C# managed pure code, this PDF document library can be deployed to Microsoft Visual Studio Windows Forms or ASP.NET Web application, so C# developer can rotate PDF file page with a few Visual C# codings or through a simple button click within the C# PDF file Windows Viewer or Web PDF document viewer!
Want to learn more about Visual C# tutorial for processing Portable Document File (PDF)? Here are some guides for you!
C# PDF Rotation Features
  • Easy to rotate PDF document pages clock-wise with user defined degree in C# prject
  • Rotating any PDF page to change orientation from 0 degree to 360 degrees
  • Provide easy Visual C# codings to rotate PDF page clockwise, counter clockwise and upside down
  • Support rotating all the pages from a PDF document in Visual C# codes
  • Also can rotate a single page, batch of pages, even & odd pages from a PDF document
  • Specifying custom pages from x to y (page number) for rotation with C# demo codes
  • Can be integrated into Microsoft Visual Studio without using Adobe PDF product at all
How to Rotate PDF Page with Visual C#

C# PDF Lbirary Integration and Deployment

  • Download Yiigo Image SDK for .NET from online and unzip it;
  • Run the exe file to get Yiigo.Image SDK for .NET evaluation license in text file format;
  • Now create a Windows PDF application in your Visual Studio using Visual C# programming language;
  • Now copy the text evaluation license and all the .NET PDF and imaging library DLLs into your C# project;
  • Add reference to all Yiigo .NET PDF and imaging component assemblies;
  • Now you have created a Visual C# PDF Windows project and you can compile C# codings for more PDF manipulation.

C# Sample Code for PDF Page Rotation

Yiigo .NET PDF processing library SDK allows developers to rotate PDF page(s) in a Visual C# .NET imaging application with simple programming. Using this PDF library, you are enabled to rotate any number of page in a PDF: a single page, several pages, or all of it. And you can define any orientation for the rotated page: 0 to 360 degrees as you wish. Besides, you can define any PDF page to be rotated: user defined PDF pages, odd / even PDF pages, or the entire PDF file. Below is a simple C# demo to rotate the first page of a PDF file with 100 degrees.
using Yiigo.Image.PDF.dll;
using Yiigo.Image.Process.dll;

public static void RotatePDFPageDemo()
{
YGDoc doc = YGDoc.OpenDocumentFile(fileName, new PDFDecoder
BasePage aPage = doc.GetPage(0);
YGPic demoPDF = (YGPic)aPage.ToImage();
YGDoc.SaveImageFile(demoPDF, "c:/ ygPDF.png", new PNGEncoder());
YGPic demoPDF = YGDoc.OpenImageFile("c:/ygPDF.png");
ImageProcessing.ApplyRotation(ygImage1, 100);
YGFile.SaveImageFile(demoPDF, "c:/ygPDFrotate.pdf", new PNGEncoder());

}
Yiigo.Image for C#
Yiigo.Image Plugins
Image Viewer CoreBarcode PluginPDF Read & WriteTesseract OCR PluginForm Processing PluginJBIG2 CodecJPEG2000 CodecISIS ScannerTwain ScannerDICOM ReaderCAD Scanner