Opait PDF Library
Public Member Functions | Properties | List of all members
Opait.Pdf.PdfPage Class Reference

Represents a single page in a PDF document. More...

Public Member Functions

void SetSize (double width, double height)
 Set the page size using custom values. More...
 
void SetSize (PdfPageSize size, bool landscape=false)
 Sets the page size to one of standard types. More...
 
void SetSize (PdfImagePage imagePage)
 Sets the page size to the physical size of an image. More...
 
MemoryStream GetContentStream ()
 Loads and consolidates page content stream(s). More...
 
void DeleteHiddenText ()
 Deletes all hidden text (e.g. OCR) from the content stream. Also protects the current content with a Save/Restore pair if necessary. The stream is positioned for appends.
 
string GetContent (int indent)
 Gets the content of page formatted so that a single command appears on each line. More...
 
List< PdfImagePageGetImages ()
 Get all images used on this PDF page. More...
 
List< PdfFormGetForms ()
 Gets a list of XObject forms used in the PDF page content stream. More...
 

Properties

PdfDocument Document [get]
 Parent document of the page.
 
PdfDocument Destination [get, set]
 Gets or sets the currently assigned destination document. Used when a page is being copied to a new PDF document.
 
PdfPainter Painter [get]
 A painter object used to draw on the page.
 
double Width [get]
 The width of the page in logical units.
 
double Height [get]
 The height of the page in logical units.
 
PdfRectangle MediaBox [get, set]
 Page media box rectangle.
 
PdfRectangle CropBox [get, set]
 Page crop box rectangle.
 
int Rotation [get, set]
 Page rotation angle.
 
List< PdfFontFonts [get]
 Gets the list of fonts used in the page content stream.
 
PdfAnnots Annotations [get]
 Gets the list of annotations for the page.
 
bool IsLoaded [get]
 Gets a value to indicate whether the page has been loaded.
 
bool IsSaved [get]
 Gets a value to indicate whether the page has been saved. A saved page cannot be altered and its attributes are not valid.
 

Detailed Description

Represents a single page in a PDF document.

Member Function Documentation

◆ GetContent()

string Opait.Pdf.PdfPage.GetContent ( int  indent)

Gets the content of page formatted so that a single command appears on each line.

Parameters
indentNumber of spaces to indent certain blocks
Returns
Formatted content of the page.

◆ GetContentStream()

MemoryStream Opait.Pdf.PdfPage.GetContentStream ( )

Loads and consolidates page content stream(s).

Returns
Aggregated page content stream(s).

◆ GetForms()

List< PdfForm > Opait.Pdf.PdfPage.GetForms ( )

Gets a list of XObject forms used in the PDF page content stream.

Returns
A list of XObject forms from content stream.

◆ GetImages()

List< PdfImagePage > Opait.Pdf.PdfPage.GetImages ( )

Get all images used on this PDF page.

Returns
A list of images used on the page.

◆ SetSize() [1/3]

void Opait.Pdf.PdfPage.SetSize ( double  width,
double  height 
)

Set the page size using custom values.

Parameters
widthThe width of the page in points.
heightThe height of the page in points.

◆ SetSize() [2/3]

void Opait.Pdf.PdfPage.SetSize ( PdfImagePage  imagePage)

Sets the page size to the physical size of an image.

Parameters
imagePageSet the page size using the attributes of this image page.

◆ SetSize() [3/3]

void Opait.Pdf.PdfPage.SetSize ( PdfPageSize  size,
bool  landscape = false 
)

Sets the page size to one of standard types.

Parameters
sizeThe page size identifier.
landscape'true' if page is in landscape mode, otherwise 'false'