Skip to main content
A newer version of this page is available. .

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

The Universal Subscription or an additional Document Server Subscription is required to use this example in production code. Please refer to the DevExpress Subscription page for pricing information.

To create a PDF Document Processor application, perform the following steps.

  1. Run Microsoft Visual Studio 2010, 2012, 2013, 2015 or 2017.
  2. Start a new project (CTRL+SHIFT+N) and create a new Console Application. Specify the name of the project, and click OK.

    visual-studio-2012-new-project-console-application

  3. Right-click References in the Solution Explorer and select Add Reference… in the invoked context menu.

    pdf-doc-processor-add-reference

  4. Select the DevExpress.Data.v17.2, DevExpress.Docs.v17.2, DevExpress.Pdf.v17.2.Core, and DevExpress.Pdf.v17.2.Drawing assemblies and click OK.

    pdf-doc-processor-reference-manager

  5. 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 PDF Document Processor 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.

pdf-doc-processor-rotate

See Also