Back to Devexpress

PdfDocumentFacade.Pages Property

officefileapi-devexpress-dot-pdf-dot-pdfdocumentfacade-7517fbf6.md

latest5.2 KB
Original Source

PdfDocumentFacade.Pages Property

Returns all PDF page properties.

Namespace : DevExpress.Pdf

Assembly : DevExpress.Pdf.v25.2.Core.dll

NuGet Package : DevExpress.Pdf.Core

Declaration

csharp
public IReadOnlyList<PdfPageFacade> Pages { get; }
vb
Public ReadOnly Property Pages As IReadOnlyList(Of PdfPageFacade)

Property Value

TypeDescription
IReadOnlyList<PdfPageFacade>

A list of objects that contain page properties.

|

Remarks

The PdfDocumentFacade.Pages property returns a list of PdfPageFacade objects used to organize PDF pages without access to their inner structure. Call the PdfPageFacade.FlattenAnnotations method to flatten page annotations.

The code sample below flattens all annotations that are located on the lower half of the page:

csharp
using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
{
  // Load a document:
  processor.LoadDocument("..\\..\\Document.pdf");

  // Flatten annotations located
  // on the lower half of the page:
  PdfPageFacade pageFacade = documentFacade.Pages[0];

  double halfPage = processor.Document.Pages[0].CropBox.Top / 2;
  pageFacade.FlattenAnnotations(x => x.Rectangle.Top < halfPage);

  // Save the result:
  processor.SaveDocument("..\\..\\Result.pdf");
}
vb
Using processor As New PdfDocumentProcessor()
  ' Load a document:
  processor.LoadDocument("..\..\Document.pdf")

  ' Flatten annotations located
  ' on the lower half of the page:
  Dim pageFacade As PdfPageFacade = documentFacade.Pages(0)

  Dim halfPage As Double = processor.Document.Pages(0).CropBox.Top / 2
  pageFacade.FlattenAnnotations(Function(x) x.Rectangle.Top < halfPage)

  ' Save the result:
  processor.SaveDocument("..\..\Result.pdf")
End Using

The following code snippets (auto-collected from DevExpress Examples) contain references to the Pages 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.

pdf-document-api-add-link-to-page/CS/AddLinkToPage/Program.cs#L14

csharp
// Access third page properties
PdfPageFacade pageFacade = pdfDocumentProcessor.DocumentFacade.Pages[2];

pdf-document-api-add-link-to-uri/CS/AddLinkToUri/Program.cs#L16

csharp
// Access the first page properties
PdfPageFacade page = processor.DocumentFacade.Pages[0];

pdf-document-api-highlight-search-results/CS/HighlightSearchResults/Program.cs#L63

csharp
PdfDocumentFacade facade = processor.DocumentFacade;
PdfPageFacade page = facade.Pages[result.Page.GetPageIndex()];

pdf-document-api-add-link-to-page/VB/AddLinkToPage/Program.vb#L14

vb
' Access third page properties
Dim pageFacade As PdfPageFacade = processor.DocumentFacade.Pages(2)

pdf-document-api-add-link-to-uri/VB/AddLinkToUri/Program.vb#L15

vb
' Access the first page properties
Dim page As PdfPageFacade = processor.DocumentFacade.Pages(0)

pdf-document-api-highlight-search-results/VB/HighlightSearchResults/Program.vb#L54

vb
Dim facade As PdfDocumentFacade = processor.DocumentFacade
Dim page As PdfPageFacade = facade.Pages(result.Page.GetPageIndex())

See Also

PdfDocumentFacade Class

PdfDocumentFacade Members

DevExpress.Pdf Namespace