Getting Started
- 2 minutes to read
This tutorial describes the first steps to create a PDF processing console application in Visual Studio by using the non-visual PdfDocumentProcessor component.
Important
You require a license to the DevExpress Office File API or DevExpress Universal Subscription to use these examples in production code. Refer to the DevExpress Subscription page for pricing information.
To create a PDF Document API application, perform the following steps.
- Run Microsoft Visual Studio 2012, 2013, 2015 or 2017.
Start a new project (CTRL+SHIFT+N) and create a new Console Application. Specify the name of the project, and click OK.
Right-click References in the Solution Explorer and select Add Reference… in the invoked context menu.
Select the DevExpress.Data.v18.2, DevExpress.Docs.v18.2, DevExpress.Pdf.v18.2.Core, and DevExpress.Pdf.v18.2.Drawing assemblies and click OK.
Perform the necessary document processing in the Main method of the application’s Program.cs file (Main procedure of the Module1.vb file for Visual Basic).
For example, the following code opens a sample document, rotates its pages and saves the modified document to a new location.
This example illustrates how to use the PDF Document API component for rotating pages.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-rotate-pdf-pages-t114305
Imports DevExpress.Pdf Namespace PdfPageRotationExample Friend Class Program Shared Sub Main(ByVal args() As String) Using pdfDocumentProcessor As New PdfDocumentProcessor() pdfDocumentProcessor.LoadDocument("..\..\docs\TextRotate.pdf") Dim angle As Integer = 0 For Each page As PdfPage In pdfDocumentProcessor.Document.Pages angle = (angle + 90) Mod 360 page.Rotate = angle Next page pdfDocumentProcessor.SaveDocument("..\..\docs\Rotated.pdf") End Using End Sub End Class End Namespace
Run the project. After executing the code above, the pages are rotated and the new document is saved to the specified location.