XDoc.PDF
Features
Tech Specs
How-to VB.NET
Pricing
How to Start Convert PDF Work with PDF Modules PDF Document PDF Pages Text Image Graph & Path Annotation, Markup & Drawing Redaction Security Digital Signature Forms Watermark Bookmark Link File Attachment File Metadata Printing Work with Other SDKs Barcode read Barcode create OCR Twain

VB.NET PDF - How to Rotate PDF Document Page in VB.NET


VB.NET Demo Code for PDF Document Page Rotation in Visual Basic .NET Class Application





Look for HTML5 PDF Editor?

EdgePDF: ASP.NET PDF Editor is the best HTML5 PDF Editor and ASP.NET PDF Viewer based on XDoc.PDF, JQuery, HTML5. It supports ASP.NET MVC and WebForms projects.


Free VB.NET PDF SDK library for Visual Studio .NET


Support .NET WinForms, ASP.NET MVC in IIS, ASP.NET Ajax, Azure cloud service, DNN (DotNetNuke), SharePoint


Able to rotate PDF page and document in .NET WinForms application and ASP.NET project


Rotate PDF page to 90,180,270 degree in both clockwise and anticlockwise in VB.NET


Rotate single specified page or entire pages permanently in PDF file in Visual Basic .NET


Batch change PDF page orientation in VB.NET program without adobe PDF reader control


Support to overwrite PDF and save rotation changes to original PDF document


Online source codes for integration in Visual Basic .NETclass


An outstanding component built in .NET framework 2.0 and compatible with Windows operating system


RasterEdge VB.NET PDF document page rotating control offers mature and professional APIs for developers to rotate source PDF page by 1 degree increments (either in a clockwise or counterclockwise way). Therefore, unlike other VB.NET PDF document page rotating controls on the market which can only support rotating PDF document page to 90 degrees, 180 degrees & 270 degrees, RasterEdge VB.NET PDF document page rotating control allows programmers to rotate PDF page at any desired angle.


Besides, this PDF document page rotator control SDK makes it possible for VB.NET programmers to save rotated PDF page to new file. So when users want to view the target PDF file next time, they do not need to rotate the PDF page again. Thus, RasterEdge PDF document page rotation library toolkit offers developers an efficient .NET solution to view source PDF document file.


VB.NET PDF Page Rotation SDK Features:


Built in .NET Framework 2.0 and compatible with Visual Studio 2005 (or above versions)


100% clean and managed VB.NET solution that rotates PDF document file in Microsoft Framework application


Offer wide range of supported rotating angles (from 1 to 360 degrees) to process PDF file in VB.NET


Able to rotate PDF page and save rotated PDF document to new PDF file by VB.NET code




VB.NET PDF Page Rotator SDK DLLs



In order to run the sample code, the following steps would be necessary.


Add necessary references:


  RasterEdge.Imaging.Basic.dll


  RasterEdge.Imaging.Basic.Codec.dll


  RasterEdge.Imaging.Drawing.dll


  RasterEdge.Imaging.Font.dll


  RasterEdge.Imaging.Processing.dll


  RasterEdge.XDoc.Raster.dll


  RasterEdge.XDoc.Raster.Core.dll


  RasterEdge.XDoc.PDF.dll


Use corresponding namespaces;


  using RasterEdge.Imaging.Basic;


  using RasterEdge.XDoc.PDF;




Rotate a PDF Page Using VB.NET



Output a New PDF File



Copy this demo code to your VB.NET application to rotate the first page of your PDF file to 180 degree in clockwise. And this demo will create a new PDF file.




Dim inputFilePath As String = Program.RootPath + "\\" + "1.pdf"
Dim outputFilePath As String = Program.RootPath + "\\" + "Output.pdf"

' Specify the first page to be rotated.
Dim pageIndex As Integer = 0

' Rotate 180 in clockwise.
Dim rotateInDegree As Integer = 180

' Rotate the selected page.
PDFDocument.RotatePage(inputFilePath, pageIndex, rotateInDegree, outputFilePath)




Overwrite the Original PDF File



You may also rotate a page of your PDF file to 270 degree in clockwise. It's equal to rotate PDF page to 90 degree in anticlockwise. In addition, this demo will overwrite the original PDF file.




Dim inputFilePath As String = Program.RootPath + "\\" + "1.pdf"

' Specify a page to be rotated.
Dim pageIndex As Integer = 0

' Rotate 270 in clockwise.
Dim rotateInDegree As Integer = 270

' Rotate the selected page.
PDFDocument.RotatePage(inputFilePath, pageIndex, rotateInDegree)





Rotate All PDF Pages Using VB.NET




Output a New PDF File


This VB.NET code is used for rotating all PDF pages to 180 in clockwise and output a new PDF file.



Dim inputFilePath As String = Program.RootPath + "\\" + "1.pdf"
Dim outputFilePath As String = Program.RootPath + "\\" + "Output.pdf"

' Rotate 180 in clockwise.
Dim rotateInDegree As Integer = 180

' Rotate all PDF pages.
PDFDocument.RotateAllPages(inputFilePath, rotateInDegree, outputFilePath)




Overwrite the Original PDF File



This one is for rotating all PDF pages to 90 in clockwise and overwrite the original PDF file.




Dim inputFilePath As String = Program.RootPath + "\\" + "1.pdf"

' Rotate 90 in clockwise.
Dim rotateInDegree As Integer = 180

' Rotate all PDF pages.
PDFDocument.RotateAllPages(inputFilePath, rotateInDegree)