Back to Devexpress

PdfGraphics.AddToPageForeground(PdfPage) Method

officefileapi-devexpress-dot-pdf-dot-pdfgraphics-dot-addtopageforeground-x28-devexpress-dot-pdf-dot-pdfpage-x29.md

latest3.8 KB
Original Source

PdfGraphics.AddToPageForeground(PdfPage) Method

Adds graphics to a PDF page foreground.

Namespace : DevExpress.Pdf

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

NuGet Package : DevExpress.Pdf.Drawing

Declaration

csharp
public void AddToPageForeground(
    PdfPage page
)
vb
Public Sub AddToPageForeground(
    page As PdfPage
)

Parameters

NameTypeDescription
pagePdfPage

A PdfPage object that is the page in the document where graphics are drawn (measured in points - 1/72 of an inch).

|

Remarks

The overloaded AddToPageForeground method automatically converts world coordinates to page coordinates. See Coordinate Systems to learn more.

Call the AddToPageForeground method to draw graphics as the foreground of the page. The default DPI is equal to 96. To draw graphics as the background of the page content, call the PdfGraphics.AddToPageBackground method.

The following code snippets (auto-collected from DevExpress Examples) contain references to the AddToPageForeground(PdfPage) method.

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-highlight-search-results/CS/HighlightSearchResults/Program.cs#L55

csharp
}
    graphics.AddToPageForeground(result.Page);
}

pdf-document-api-generate-document-layout/CS/DocumentCreationAPI/Program.cs#L67

csharp
graphics.AddToPageForeground(page);
}

office-file-api-ai-implementation/CS/BusinessObjects/Helpers.cs#L233

csharp
graphics.DrawString(text, font, textBrush, rectangle);
    graphics.AddToPageForeground(page);
}

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

vb
Next
    graphics.AddToPageForeground(result.Page)
End Using

pdf-document-api-generate-document-layout/VB/DocumentCreationAPI/Program.vb#L68

vb
End Using
    graphics.AddToPageForeground(page)
End Using

See Also

PdfGraphics Class

PdfGraphics Members

DevExpress.Pdf Namespace