Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

PdfDocumentProcessor.Document Property

Provides access to a PdfDocument class, which represents the current document.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Docs.v19.1.dll

Declaration

public PdfDocument Document { get; }

Property Value

Type Description
PdfDocument

A current document.

Remarks

Use the Document property to access the current PDF document.

The PdfDocument object allows you to access the document’s pages (the PdfDocument.Pages property), bookmarks (the PdfDocument.Bookmarks property), file attachments (the PdfDocument.FileAttachments property), interactive forms (the PdfDocument.AcroForm property), etc.

The code sample below shows how to access the current document and rotate all pages.

This example illustrates how to use the PDF Document API component to rotate pages.

Note

A complete sample project is available at https://github.com/DevExpress-Examples/how-to-rotate-pdf-pages-t114305

using DevExpress.Pdf;

namespace PdfPageRotationExample
{

    class Program {
        static void Main(string[] args)
        {
            using (PdfDocumentProcessor pdfDocumentProcessor = new PdfDocumentProcessor())
            {
                pdfDocumentProcessor.LoadDocument("..\\..\\docs\\TextRotate.pdf");
                int angle = 0;
                foreach (PdfPage page in pdfDocumentProcessor.Document.Pages) {
                    angle = (angle + 90) % 360;
                    page.Rotate = angle;
                }
                pdfDocumentProcessor.SaveDocument("..\\..\\docs\\Rotated.pdf");
            }
        }
    }
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the Document property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also