Class to access PDF page. More...
Public Member Functions | |
Int32 | GetIndex () |
Get page index. More... | |
Size | GetSize () |
Get page size. More... | |
Int32 | GetRotation () |
Get page rotation. More... | |
RectF^ | GetBox (PageBoxType boxType) |
Get page boundary which is a rectangle type value. More... | |
Matrix^ | GetDisplayMatrix (Int32 x, Int32 y, Int32 width, Int32 height, Int32 rotation) |
Get page transformation matrix. More... | |
void | Close () |
Close current PDF page, and release all page contents and related resources. More... | |
TextPage^ | LoadTextPage (UInt32 option) |
Prepare information of all characters in current page and return a PDF::TextPage object. More... | |
Int32 | CountAnnots (const List< AnnotType >^typeFilter) |
Count annotations, by specific type filter. More... | |
IAnnot^ | GetAnnot (const List< AnnotType >^typeFilter, Int32 index) |
Get an annotation with specified index, by specific type filter. More... | |
IAnnot^ | GetAnnotAtPos (const List< AnnotType >^typeFilter, PointF^ position, float tolerance) |
Get an annotation at a specific position, by specific type filter. More... | |
Int32 | GetAnnotIndex (IAnnot^ annot, const List< AnnotType >^typeFilter) |
Get the index of an annotation, within specific type filter. More... | |
IAnnot^ | AddAnnot (RectF^ rect, AnnotType annotType, const List< AnnotType >^typeFilter, Int32 index) |
Add a new annotation with a specific index, within specific type filter. More... | |
Boolean | RemoveAnnot (IAnnot^ annot) |
Remove the specific annotation from current page. More... | |
void | SetAnnotGroup (const List< IMarkup^ >^annotArray, Int32 headerIndex) |
Group all the input markup annotations together. More... | |
Signature^ | GetSignatureAtPos (PointF^ position, float tolerance) |
Get a signature at a specific position. More... | |
Boolean | RenderPage (PixelSource^ pxsrc, Matrix^ displayMatrix, UInt32 renderFlags, Pause^ pause) |
Render a PDF page. More... | |
Properties | |
Int64 | pointer |
Pointer to a handle of PDF page object. This pointer is not useful outside this SDK. The application should not access the pointer to the handle of the PDF page object directly. | |
Class to access PDF page.
PDF page can be loaded by function PDF::Document::LoadPage. After loading a PDF page, user can get some basic information, retrieve a text page, and render the PDF page. Function PDF::Page::Close should be called to close the loaded PDF page when no need to access it any more.
IAnnot ^ Foxit::PDF::Page::AddAnnot | ( | RectF^ | rect, |
AnnotType | annotType, | ||
const List< AnnotType >^ | typeFilter, | ||
Int32 | index | ||
) |
Add a new annotation with a specific index, within specific type filter.
This function can be used to add annotation of all types defined in enumeration Annotations::AnnotType except Annotations::AnnotType::PSInk, Annotations::AnnotType::ThreeDimensional, Annotations::AnnotType::PrinterMark, Annotations::AnnotType::TrapNet, Annotations::AnnotType::Sound, Annotations::AnnotType::Movie, Annotations::AnnotType::Screen, Annotations::AnnotType::Watermark, Annotations::AnnotType::Widget, Annotations::AnnotType::Unknown, Annotations::AnnotType::Popup, Annotations::AnnotType::Caret.
Foxit PDF SDK does not treat popup annotation as a single annotation because typically popup annotation does not appear alone but is associated with a markup annotation – the parent annotation of popup annotation. So, pop-up annotation cannot be added alone by this function. But Foxit PDF SDK will add a default pop-up annotation when this function is called to add a new markup annotation.
[in] | rect | A RectF object that specifies the rectangle of the new annotation, in PDF page coordinate system. The value can be set as (0, 0, 0, 0), except following annotation types : Annotations::AnnotType::Note, Annotations::AnnotType::FreeText, Annotations::AnnotType::Square, Annotations::AnnotType::Circle, Annotations::AnnotType::FileAttachment, Annotations::AnnotType::Stamp. |
[in] | annotType | Annotation type of the new annotation. This should be in the type range defined by parameter typeFilter. Please refer to enumeration Annotations::AnnotType and this should be one of its values except Annotations::AnnotType::PSInk, Annotations::AnnotType::ThreeDimensional, Annotations::AnnotType::PrinterMark, Annotations::AnnotType::TrapNet, Annotations::AnnotType::Sound, Annotations::AnnotType::Movie, Annotations::AnnotType::Screen, Annotations::AnnotType::Watermark, Annotations::AnnotType::Widget, Annotations::AnnotType::Unknown, Annotations::AnnotType::Popup, Annotations::AnnotType::Caret. |
[in] | typeFilter | An Annotations::AnnotType array that specifies the type filter used to count annotation. This can be nullptr or empty, it means this function should count all annotations. If this contains at least one valid Annotations::AnnotType, it means this function should only get annotation within this type filter. If Annotations::AnnotType::Unknown or Annotations::AnnotType::Popup is in this type filter, these two type will be ignored. |
[in] | index | The index value that specifies where the new annotation is to be added. Range: 0 to (annotCount-1). annotCount is returned by function Paeg::CountAnnots with same typeFilter. If input index is out of range, the new annotation will be added to the last within the range defined by parameter typeFilter. |
void Foxit::PDF::Page::Close | ( | ) |
Close current PDF page, and release all page contents and related resources.
Int32 Foxit::PDF::Page::CountAnnots | ( | const List< AnnotType >^ | typeFilter | ) |
Count annotations, by specific type filter.
This function can be used to count annotations of all types defined in enumeration Annotations::AnnotType except Annotations::AnnotType::Unknown and Annotations::AnnotType::Popup.
[in] | typeFilter | An Annotations::AnnotType array that specifies the type filter used to count annotation. This can be nullptr or empty, it means this function should count all annotations. If this contains at least one valid Annotations::AnnotType, it means this function should only count annotations within this type filter. If Annotations::AnnotType::Unknown or Annotations::AnnotType::Popup is in this type filter, these two type will be ignored. |
Get an annotation with specified index, by specific type filter.
This function can be used to get annotation of all types defined in enumeration Annotations::AnnotType except Annotations::AnnotType::Unknown and Annotations::AnnotType::Popup. Typically, popup annotation does not appear alone but is associated with a markup annotation – the parent annotation of popup annotation. So, user can call function IMarkup::GetPopup to get the popup annotation of a markup annotation. In this function, if the retrieved annotation is a markup annotation but it does not have a popup annotation, this function will add a popup annotation to this markup annotation with rectangle [].
[in] | typeFilter | An Annotations::AnnotType array that specifies the type filter used to count annotation. This can be nullptr or empty, it means this function should count all annotations. If this contains at least one valid Annotations::AnnotType, it means this function should only get annotation within this type filter. If Annotations::AnnotType::Unknown or Annotations::AnnotType::Popup is in this type filter, these two type will be ignored. |
[in] | index | A zero-based index of annotation to be got. Range: 0 to (annotCount-1). annotCount is returned by function Page::CountAnnots with same typeFilter. |
IAnnot ^ Foxit::PDF::Page::GetAnnotAtPos | ( | const List< AnnotType >^ | typeFilter, |
PointF^ | position, | ||
float | tolerance | ||
) |
Get an annotation at a specific position, by specific type filter.
This function can be used to get annotation of all types defined in enumeration Annotations::AnnotType except Annotations::AnnotType::Unknown and Annotations::AnnotType::Popup. Typically, popup annotation does not appear alone but is associated with a markup annotation – the parent annotation of popup annotation. So, user can call function IMarkup::GetPopup to get the popup annotation of a markup annotation. In this function, if the retrieved annotation is a markup annotation but it does not have a popup annotation, this function will add a popup annotation to this markup annotation with rectangle [].
[in] | typeFilter | An Annotations::AnnotType array that specifies the type filter used to count annotation. This can be nullptr or empty, it means this function should count all annotations. If this contains at least one valid Annotations::AnnotType, it means this function should only get annotation within this type filter. If Annotations::AnnotType::Unknown or Annotations::AnnotType::Popup is in this type filter, these two type will be ignored. |
[in] | position | A Foxit::PointF object that specifies the position, in PDF page coordinate. It should not be nullptr. |
[in] | tolerance | Tolerance value for the position point. Valid value: from 0.0f to 30.0f. |
Get the index of an annotation, within specific type filter.
This function can be used for annotations of all types defined in enumeration Annotations::AnnotType except Annotations::AnnotType::Unknown and Annotations::AnnotType::Popup. Foxit PDF SDK does not treat popup annotation as a single annotation because typically popup annotation does not appear alone but is associated with a markup annotation – the parent annotation of popup annotation.
[in] | annot | An Annotations::IAnnot object that specifies the annotation which index is to be retreived. User should ensure that parameter annot is in current page. |
[in] | typeFilter | An Annotations::AnnotType array that specifies the type filter used to count annotation. This can be nullptr or empty, it means this function should count all annotations. If this contains at least one valid Annotations::AnnotType, it means this function should only get annotation index within this type filter. If Annotations::AnnotType::Unknown or Annotations::AnnotType::Popup is in this type filter, these two type will be ignored. |
RectF ^ Foxit::PDF::Page::GetBox | ( | PageBoxType | boxType | ) |
Get page boundary which is a rectangle type value.
In PDF, coordinates of page is upward to Y-axis and rightward to X-axis, therefore left is less than right and top is greater than bottom.
The origin of coordinate is at the corner of bottom-left of page and the page unit is 1/72 inch.
[in] | boxType | A page boundary box type. Please refer to enumeration Foxit::PageBoxType and this should be one of its values. |
Matrix ^ Foxit::PDF::Page::GetDisplayMatrix | ( | Int32 | x, |
Int32 | y, | ||
Int32 | width, | ||
Int32 | height, | ||
Int32 | rotation | ||
) |
Get page transformation matrix.
The origin of coordinate is at the corner of bottom-left of page and the page unit is 1/72 inch.
Transformation matrix is used to transform PDF page coordinate to device coordinate. Call function Matrix::GetReverse to get a reversed matrix to transform to opposite direction.
[in] | x | Left position of the transformation area in device coordinate, commonly in pixels. |
[in] | y | Top position of the transformation area in device coordinate, commonly in pixels. |
[in] | width | Width of the transformation area in device coordinate, commonly in pixels. |
[in] | height | Height of the transformation area in device coordinate, commonly in pixels. |
[in] | rotation | Page rotation value. It should be one of following values:
|
Int32 Foxit::PDF::Page::GetIndex | ( | ) |
Get page index.
Int32 Foxit::PDF::Page::GetRotation | ( | ) |
Get page rotation.
Page width and height are just the size of a PDF page when value of "/Rotate" in page dictionary is 0.
Get a signature at a specific position.
[in] | position | A Foxit::PointF object that specifies the position, in PDF page coordinate. |
[in] | tolerance | Tolerance value for the position point. Valid value: from 0.0f to 30.0f. |
Size Foxit::PDF::Page::GetSize | ( | ) |
Get page size.
TextPage ^ Foxit::PDF::Page::LoadTextPage | ( | UInt32 | option | ) |
Prepare information of all characters in current page and return a PDF::TextPage object.
[in] | option | An unsigned integer value that specifies the parsing option. If set to 0, this function will load text page normally. For other options, please refer to enumeration PDF::TextParseOption and this could be one or a combination of its values. |
Boolean Foxit::PDF::Page::RemoveAnnot | ( | IAnnot^ | annot | ) |
Remove the specific annotation from current page.
This function can be used to remove annotations of all types defined in enumeration Annotations::AnnotType except Annotations::AnnotType::Watermark, Annotations::AnnotType::Unknown, Annotations::AnnotType::Popup.
Foxit PDF SDK does not treat popup annotation as a single annotation because typically popup annotation does not appear alone but is associated with a markup annotation – the parent annotation of popup annotation. So popup annotation cannot be removed directly. Popup annotation will be removed with its parent markup annotation.
[in] | annot | An Annotations::IAnnot object that specifies the annotation which is to be removed. User should ensure that parameter annot is in current page. |
Boolean Foxit::PDF::Page::RenderPage | ( | PixelSource^ | pxsrc, |
Matrix^ | displayMatrix, | ||
UInt32 | renderFlags, | ||
Pause^ | pause | ||
) |
Render a PDF page.
Rendering can be started over and over again for the same page, but there can be only one rendering procedure for a page at any time. If one page rendering is already active and another rendering is started, the previous rendering will be canceled.
When rendering a page, application can specify the color of background for rendering by parameter pxsrc. If application does not specify the background color, Foxit PDF SDK will use white background by default.
There is no need to parse the page before rendering the page. The engine will parse the page along with the rendering process. With this technique, by using RenderFlags::DropObjects with this function, it can render very complicated pages without much memory consumption.
[in,out] | pxsrc | A Foxit::PixelSource object.
|
[in] | displayMatrix | A Foxit::Matrix that receives the transformation matrix which is returned by function Page::GetDisplayMatrix. |
[in] | renderFlags | Renderer flags. All undefined bits are omitted. 0 is default and means to display normally. For other render flags, please refer to enumeration Foxit::RenderFlags and this could be one or combination of its values. |
[in] | pause | (Reserved, should be nullptr currently) A Foxit::Pause object that specifies the pause control for rendering page in progressive process. |
void Foxit::PDF::Page::SetAnnotGroup | ( | const List< IMarkup^ >^ | annotArray, |
Int32 | headerIndex | ||
) |
Group all the input markup annotations together.
[in] | annotArray | A markup annotation array that specifies markup annotations which are to be grouped together. The count of annotations in this array should be at least 2. All the markup annotations in this array should be in current page. |
[in] | headerIndex | The index that specifies a markup annotation in parameter annotArray to be the header of the group. |