PdfiumViewer
|
Provides functionality to render a PDF document. More...
Public Member Functions | |
void | Render (int page, Graphics graphics, float dpiX, float dpiY, Rectangle bounds, bool forPrinting) |
Renders a page of the PDF document to the provided graphics instance. More... | |
void | Render (int page, Graphics graphics, float dpiX, float dpiY, Rectangle bounds, PdfRenderFlags flags) |
Renders a page of the PDF document to the provided graphics instance. More... | |
Image | Render (int page, float dpiX, float dpiY, bool forPrinting) |
Renders a page of the PDF document to an image. More... | |
Image | Render (int page, float dpiX, float dpiY, PdfRenderFlags flags) |
Renders a page of the PDF document to an image. More... | |
Image | Render (int page, int width, int height, float dpiX, float dpiY, bool forPrinting) |
Renders a page of the PDF document to an image. More... | |
Image | Render (int page, int width, int height, float dpiX, float dpiY, PdfRenderFlags flags) |
Renders a page of the PDF document to an image. More... | |
Image | Render (int page, int width, int height, float dpiX, float dpiY, PdfRotation rotate, PdfRenderFlags flags) |
Renders a page of the PDF document to an image. More... | |
void | Save (string path) |
Save the PDF document to the specified location. More... | |
void | Save (Stream stream) |
Save the PDF document to the specified location. More... | |
PdfMatches | Search (string text, bool matchCase, bool wholeWord) |
Finds all occurences of text. More... | |
PdfMatches | Search (string text, bool matchCase, bool wholeWord, int page) |
Finds all occurences of text. More... | |
PdfMatches | Search (string text, bool matchCase, bool wholeWord, int startPage, int endPage) |
Finds all occurences of text. More... | |
string | GetPdfText (int page) |
Get all text on the page. More... | |
IEnumerable< PdfTextAndRect > | GetPdfTextAndRects (int page) |
Get all text and corresponding bounding box on the page. More... | |
string | GetBoundedText (int page, RectangleF rect) |
Get all text which touches hit box. More... | |
string | GetPdfText (PdfTextSpan textSpan) |
Get all text matching the text span. More... | |
IList< PdfRectangle > | GetTextBounds (PdfTextSpan textSpan) |
Get all bounding rectangles for the text span. More... | |
PointF | PointToPdf (int page, Point point) |
Convert a point from device coordinates to page coordinates. More... | |
Point | PointFromPdf (int page, PointF point) |
Convert a point from page coordinates to device coordinates. More... | |
RectangleF | RectangleToPdf (int page, Rectangle rect) |
Convert a rectangle from device coordinates to page coordinates. More... | |
Rectangle | RectangleFromPdf (int page, RectangleF rect) |
Convert a rectangle from page coordinates to device coordinates. More... | |
PrintDocument | CreatePrintDocument () |
Creates a PrintDocument for the PDF document. More... | |
PrintDocument | CreatePrintDocument (PdfPrintMode printMode) |
Creates a PrintDocument for the PDF document. More... | |
PrintDocument | CreatePrintDocument (PdfPrintSettings settings) |
Creates a PrintDocument for the PDF document. More... | |
PdfPageLinks | GetPageLinks (int page, Size size) |
Returns all links on the PDF page. More... | |
void | DeletePage (int page) |
Delete the page from the PDF document. More... | |
void | RotatePage (int page, PdfRotation rotation) |
Set rotation of the page. More... | |
PdfRotation | GetPageRotation (int page) |
Get rotation of the page. More... | |
void | ImportPages (PdfDocument source, string pageRange, int startDestIndex) |
Import pages from source document. More... | |
void | CopyPages (string pageRange, int startDestIndex) |
Copy pages within this document. More... | |
PdfInformation | GetInformation () |
Get metadata information from the PDF document. More... | |
void | Dispose () |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More... | |
Static Public Member Functions | |
static PdfDocument | Load (string path) |
Initializes a new instance of the PdfDocument class with the provided path. More... | |
static PdfDocument | Load (string path, string password) |
Initializes a new instance of the PdfDocument class with the provided path. More... | |
static PdfDocument | Load (IWin32Window owner, string path) |
Initializes a new instance of the PdfDocument class with the provided path. More... | |
static PdfDocument | Load (IWin32Window owner, Stream stream) |
Initializes a new instance of the PdfDocument class with the provided path. More... | |
static PdfDocument | Load (Stream stream) |
Initializes a new instance of the PdfDocument class with the provided stream. More... | |
static PdfDocument | Load (Stream stream, string password) |
Initializes a new instance of the PdfDocument class with the provided stream. More... | |
static PdfDocument | Compose (PdfDocument source, string pageRange) |
Compose new document from existing document and page ranges. More... | |
Protected Member Functions | |
void | Dispose (bool disposing) |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More... | |
Properties | |
int | PageCount [get] |
Number of pages in the PDF document. More... | |
PdfBookmarkCollection | Bookmarks [get] |
Bookmarks stored in this PdfFile More... | |
IList< SizeF > | PageSizes [get] |
Size of each page in the PDF document. More... | |
![]() | |
int | PageCount [get] |
Number of pages in the PDF document. More... | |
PdfBookmarkCollection | Bookmarks [get] |
Bookmarks stored in this PdfFile More... | |
IList< SizeF > | PageSizes [get] |
Size of each page in the PDF document. More... | |
Provides functionality to render a PDF document.
|
static |
Compose new document from existing document and page ranges.
source | The source document |
pageRange | 1,2-3 and so on, or null for entire |
void PdfiumViewer.PdfDocument.CopyPages | ( | string | pageRange, |
int | startDestIndex | ||
) |
Copy pages within this document.
pageRange | 1,2-3 and so on, or null for entire |
startDestIndex | The destination page index |
PrintDocument PdfiumViewer.PdfDocument.CreatePrintDocument | ( | ) |
PrintDocument PdfiumViewer.PdfDocument.CreatePrintDocument | ( | PdfPrintMode | printMode | ) |
Creates a PrintDocument for the PDF document.
printMode | Specifies the mode for printing. The default value for this parameter is CutMargin. |
Implements PdfiumViewer.IPdfDocument.
PrintDocument PdfiumViewer.PdfDocument.CreatePrintDocument | ( | PdfPrintSettings | settings | ) |
Creates a PrintDocument for the PDF document.
settings | The settings used to configure the print document. |
Implements PdfiumViewer.IPdfDocument.
void PdfiumViewer.PdfDocument.DeletePage | ( | int | page | ) |
Delete the page from the PDF document.
page | The page to delete. |
Implements PdfiumViewer.IPdfDocument.
void PdfiumViewer.PdfDocument.Dispose | ( | ) |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
<filterpriority>2</filterpriority>
|
protected |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
disposing | Whether this method is called from Dispose. |
string PdfiumViewer.PdfDocument.GetBoundedText | ( | int | page, |
RectangleF | rect | ||
) |
Get all text which touches hit box.
page | The page to get the text for. |
rect | The hit box |
PdfInformation PdfiumViewer.PdfDocument.GetInformation | ( | ) |
Get metadata information from the PDF document.
Implements PdfiumViewer.IPdfDocument.
PdfPageLinks PdfiumViewer.PdfDocument.GetPageLinks | ( | int | page, |
Size | size | ||
) |
Returns all links on the PDF page.
page | The page to get the links for. |
size | The size of the page. |
Implements PdfiumViewer.IPdfDocument.
PdfRotation PdfiumViewer.PdfDocument.GetPageRotation | ( | int | page | ) |
Get rotation of the page.
page | The page index |
string PdfiumViewer.PdfDocument.GetPdfText | ( | int | page | ) |
Get all text on the page.
page | The page to get the text for. |
Implements PdfiumViewer.IPdfDocument.
string PdfiumViewer.PdfDocument.GetPdfText | ( | PdfTextSpan | textSpan | ) |
Get all text matching the text span.
textSpan | The span to get the text for. |
Implements PdfiumViewer.IPdfDocument.
IEnumerable<PdfTextAndRect> PdfiumViewer.PdfDocument.GetPdfTextAndRects | ( | int | page | ) |
Get all text and corresponding bounding box on the page.
page | The page to get the text for. |
IList<PdfRectangle> PdfiumViewer.PdfDocument.GetTextBounds | ( | PdfTextSpan | textSpan | ) |
Get all bounding rectangles for the text span.
The algorithm used to get the bounding rectangles tries to join adjacent character bounds into larger rectangles.
textSpan | The span to get the bounding rectangles for. |
Implements PdfiumViewer.IPdfDocument.
void PdfiumViewer.PdfDocument.ImportPages | ( | PdfDocument | source, |
string | pageRange, | ||
int | startDestIndex | ||
) |
Import pages from source document.
source | The source document |
pageRange | 1,2-3 and so on, or null for entire |
startDestIndex | The destination page index |
|
static |
Initializes a new instance of the PdfDocument class with the provided path.
owner | Window to show any UI for. |
stream | Stream for the PDF document. |
|
static |
Initializes a new instance of the PdfDocument class with the provided path.
owner | Window to show any UI for. |
path | Path to the PDF document. |
|
static |
Initializes a new instance of the PdfDocument class with the provided stream.
stream | Stream for the PDF document. |
|
static |
Initializes a new instance of the PdfDocument class with the provided stream.
stream | Stream for the PDF document. |
password | Password for the PDF document. |
|
static |
Initializes a new instance of the PdfDocument class with the provided path.
path | Path to the PDF document. |
|
static |
Initializes a new instance of the PdfDocument class with the provided path.
path | Path to the PDF document. |
password | Password for the PDF document. |
Point PdfiumViewer.PdfDocument.PointFromPdf | ( | int | page, |
PointF | point | ||
) |
Convert a point from page coordinates to device coordinates.
page | The page number where the point is from. |
point | The point to convert. |
Implements PdfiumViewer.IPdfDocument.
PointF PdfiumViewer.PdfDocument.PointToPdf | ( | int | page, |
Point | point | ||
) |
Convert a point from device coordinates to page coordinates.
page | The page number where the point is from. |
point | The point to convert. |
Implements PdfiumViewer.IPdfDocument.
Rectangle PdfiumViewer.PdfDocument.RectangleFromPdf | ( | int | page, |
RectangleF | rect | ||
) |
Convert a rectangle from page coordinates to device coordinates.
page | The page where the rectangle is from. |
rect | The rectangle to convert. |
Implements PdfiumViewer.IPdfDocument.
RectangleF PdfiumViewer.PdfDocument.RectangleToPdf | ( | int | page, |
Rectangle | rect | ||
) |
Convert a rectangle from device coordinates to page coordinates.
page | The page where the rectangle is from. |
rect | The rectangle to convert. |
Implements PdfiumViewer.IPdfDocument.
Image PdfiumViewer.PdfDocument.Render | ( | int | page, |
float | dpiX, | ||
float | dpiY, | ||
bool | forPrinting | ||
) |
Renders a page of the PDF document to an image.
page | Number of the page to render. |
dpiX | Horizontal DPI. |
dpiY | Vertical DPI. |
forPrinting | Render the page for printing. |
Implements PdfiumViewer.IPdfDocument.
Image PdfiumViewer.PdfDocument.Render | ( | int | page, |
float | dpiX, | ||
float | dpiY, | ||
PdfRenderFlags | flags | ||
) |
Renders a page of the PDF document to an image.
page | Number of the page to render. |
dpiX | Horizontal DPI. |
dpiY | Vertical DPI. |
flags | Flags used to influence the rendering. |
Implements PdfiumViewer.IPdfDocument.
void PdfiumViewer.PdfDocument.Render | ( | int | page, |
Graphics | graphics, | ||
float | dpiX, | ||
float | dpiY, | ||
Rectangle | bounds, | ||
bool | forPrinting | ||
) |
Renders a page of the PDF document to the provided graphics instance.
page | Number of the page to render. |
graphics | Graphics instance to render the page on. |
dpiX | Horizontal DPI. |
dpiY | Vertical DPI. |
bounds | Bounds to render the page in. |
forPrinting | Render the page for printing. |
Implements PdfiumViewer.IPdfDocument.
void PdfiumViewer.PdfDocument.Render | ( | int | page, |
Graphics | graphics, | ||
float | dpiX, | ||
float | dpiY, | ||
Rectangle | bounds, | ||
PdfRenderFlags | flags | ||
) |
Renders a page of the PDF document to the provided graphics instance.
page | Number of the page to render. |
graphics | Graphics instance to render the page on. |
dpiX | Horizontal DPI. |
dpiY | Vertical DPI. |
bounds | Bounds to render the page in. |
flags | Flags used to influence the rendering. |
Implements PdfiumViewer.IPdfDocument.
Image PdfiumViewer.PdfDocument.Render | ( | int | page, |
int | width, | ||
int | height, | ||
float | dpiX, | ||
float | dpiY, | ||
bool | forPrinting | ||
) |
Renders a page of the PDF document to an image.
page | Number of the page to render. |
width | Width of the rendered image. |
height | Height of the rendered image. |
dpiX | Horizontal DPI. |
dpiY | Vertical DPI. |
forPrinting | Render the page for printing. |
Implements PdfiumViewer.IPdfDocument.
Image PdfiumViewer.PdfDocument.Render | ( | int | page, |
int | width, | ||
int | height, | ||
float | dpiX, | ||
float | dpiY, | ||
PdfRenderFlags | flags | ||
) |
Renders a page of the PDF document to an image.
page | Number of the page to render. |
width | Width of the rendered image. |
height | Height of the rendered image. |
dpiX | Horizontal DPI. |
dpiY | Vertical DPI. |
flags | Flags used to influence the rendering. |
Implements PdfiumViewer.IPdfDocument.
Image PdfiumViewer.PdfDocument.Render | ( | int | page, |
int | width, | ||
int | height, | ||
float | dpiX, | ||
float | dpiY, | ||
PdfRotation | rotate, | ||
PdfRenderFlags | flags | ||
) |
Renders a page of the PDF document to an image.
page | Number of the page to render. |
width | Width of the rendered image. |
height | Height of the rendered image. |
dpiX | Horizontal DPI. |
dpiY | Vertical DPI. |
rotate | Rotation. |
flags | Flags used to influence the rendering. |
Implements PdfiumViewer.IPdfDocument.
void PdfiumViewer.PdfDocument.RotatePage | ( | int | page, |
PdfRotation | rotation | ||
) |
Set rotation of the page.
page | The page to rotate. |
rotation | The page rotation. |
Implements PdfiumViewer.IPdfDocument.
void PdfiumViewer.PdfDocument.Save | ( | Stream | stream | ) |
Save the PDF document to the specified location.
stream | Stream to save the PDF document to. |
Implements PdfiumViewer.IPdfDocument.
void PdfiumViewer.PdfDocument.Save | ( | string | path | ) |
Save the PDF document to the specified location.
path | Path to save the PDF document to. |
Implements PdfiumViewer.IPdfDocument.
PdfMatches PdfiumViewer.PdfDocument.Search | ( | string | text, |
bool | matchCase, | ||
bool | wholeWord | ||
) |
Finds all occurences of text.
text | The text to search for. |
matchCase | Whether to match case. |
wholeWord | Whether to match whole words only. |
Implements PdfiumViewer.IPdfDocument.
PdfMatches PdfiumViewer.PdfDocument.Search | ( | string | text, |
bool | matchCase, | ||
bool | wholeWord, | ||
int | page | ||
) |
Finds all occurences of text.
text | The text to search for. |
matchCase | Whether to match case. |
wholeWord | Whether to match whole words only. |
page | The page to search on. |
Implements PdfiumViewer.IPdfDocument.
PdfMatches PdfiumViewer.PdfDocument.Search | ( | string | text, |
bool | matchCase, | ||
bool | wholeWord, | ||
int | startPage, | ||
int | endPage | ||
) |
Finds all occurences of text.
text | The text to search for. |
matchCase | Whether to match case. |
wholeWord | Whether to match whole words only. |
startPage | The page to start searching. |
endPage | The page to end searching. |
Implements PdfiumViewer.IPdfDocument.
|
get |
Bookmarks stored in this PdfFile
|
get |
Number of pages in the PDF document.
|
get |
Size of each page in the PDF document.