than_pdf_engine_bindings_generated
library
Functions
-
FORM_CanRedo(FPDF_FORMHANDLE hHandle, FPDF_PAGE page)
→ int
-
Function: FORM_CanRedo
Find out if it is possible for the current focused widget in a given
form to perform a redo operation.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
page - Handle to the page, as returned by FPDF_LoadPage().
Return Value:
True if it is possible to redo.
-
FORM_CanUndo(FPDF_FORMHANDLE hHandle, FPDF_PAGE page)
→ int
-
Function: FORM_CanUndo
Find out if it is possible for the current focused widget in a given
form to perform an undo operation.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
page - Handle to the page, as returned by FPDF_LoadPage().
Return Value:
True if it is possible to undo.
-
FORM_DoDocumentAAction(FPDF_FORMHANDLE hHandle, int aaType)
→ void
-
Function: FORM_DoDocumentAAction
This method is required for performing the document's
additional-action.
Parameters:
hHandle - Handle to the form fill module. Returned by
FPDFDOC_InitFormFillEnvironment.
aaType - The type of the additional-actions which defined
above.
Return Value:
None.
Comments:
This method will do nothing if there is no document
additional-action corresponding to the specified |aaType|.
-
FORM_DoDocumentJSAction(FPDF_FORMHANDLE hHandle)
→ void
-
Function: FORM_DoDocumentJSAction
This method is required for performing document-level JavaScript
actions. It should be invoked after the PDF document has been loaded.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
Return Value:
None.
Comments:
If there is document-level JavaScript action embedded in the
document, this method will execute the JavaScript action. Otherwise,
the method will do nothing.
-
FORM_DoDocumentOpenAction(FPDF_FORMHANDLE hHandle)
→ void
-
Function: FORM_DoDocumentOpenAction
This method is required for performing open-action when the document
is opened.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
Return Value:
None.
Comments:
This method will do nothing if there are no open-actions embedded
in the document.
-
FORM_DoPageAAction(FPDF_PAGE page, FPDF_FORMHANDLE hHandle, int aaType)
→ void
-
Function: FORM_DoPageAAction
This method is required for performing the page object's
additional-action when opened or closed.
Parameters:
page - Handle to the page, as returned by FPDF_LoadPage().
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
aaType - The type of the page object's additional-actions
which defined above.
Return Value:
None.
Comments:
This method will do nothing if no additional-action corresponding
to the specified |aaType| exists.
-
FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle)
→ int
-
Function: FORM_ForceToKillFocus.
Call this member function to force to kill the focus of the form
field which has focus. If it would kill the focus of a form field,
save the value of form field if was changed by theuser.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
Return Value:
True indicates success; otherwise false.
-
FORM_GetFocusedAnnot(FPDF_FORMHANDLE handle, Pointer<Int> page_index, Pointer<FPDF_ANNOTATION> annot)
→ int
-
Experimental API.
Function: FORM_GetFocusedAnnot.
Call this member function to get the currently focused annotation.
Parameters:
handle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
page_index - Buffer to hold the index number of the page which
contains the focused annotation. 0 for the first page.
Can't be NULL.
annot - Buffer to hold the focused annotation. Can't be NULL.
Return Value:
On success, return true and write to the out parameters. Otherwise
return false and leave the out parameters unmodified.
Comments:
Not currently supported for XFA forms - will report no focused
annotation.
Must call FPDFPage_CloseAnnot() when the annotation returned in |annot|
by this function is no longer needed.
This will return true and set |page_index| to -1 and |annot| to NULL,
if there is no focused annotation.
-
FORM_GetFocusedText(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, Pointer<Void> buffer, int buflen)
→ int
-
Experimental API
Function: FORM_GetFocusedText
Call this function to obtain the text within the current focused
field, if any.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
page - Handle to the page, as returned by FPDF_LoadPage().
buffer - Buffer for holding the form text, encoded in
UTF-16LE. If NULL, |buffer| is not modified.
buflen - Length of |buffer| in bytes. If |buflen| is less
than the length of the form text string, |buffer| is
not modified.
Return Value:
Length in bytes for the text in the focused field.
-
FORM_GetSelectedText(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, Pointer<Void> buffer, int buflen)
→ int
-
Function: FORM_GetSelectedText
Call this function to obtain selected text within a form text
field or form combobox text field.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
page - Handle to the page, as returned by FPDF_LoadPage().
buffer - Buffer for holding the selected text, encoded in
UTF-16LE. If NULL, |buffer| is not modified.
buflen - Length of |buffer| in bytes. If |buflen| is less
than the length of the selected text string,
|buffer| is not modified.
Return Value:
Length in bytes of selected text in form text field or form combobox
text field.
-
FORM_IsIndexSelected(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int index)
→ int
-
Experimental API
Function: FORM_IsIndexSelected
Returns whether or not the value at |index| of the focused
annotation is currently selected.
Parameters:
hHandle - Handle to the form fill module. Returned by
FPDFDOC_InitFormFillEnvironment.
page - Handle to the page. Returned by FPDF_LoadPage
index - 0-based Index of value to check
Return Value:
TRUE if value at |index| is currently selected.
FALSE if value at |index| is not selected or widget is not a
supported type.
Comments:
Intended for use with listbox/combobox widget types. Default
implementation is a no-op that will return false for other types.
Not currently supported for XFA forms - will return false.
-
FORM_OnAfterLoadPage(FPDF_PAGE page, FPDF_FORMHANDLE hHandle)
→ void
-
Function: FORM_OnAfterLoadPage
This method is required for implementing all the form related
functions. Should be invoked after user successfully loaded a
PDF page, and FPDFDOC_InitFormFillEnvironment() has been invoked.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
Return Value:
None.
-
FORM_OnBeforeClosePage(FPDF_PAGE page, FPDF_FORMHANDLE hHandle)
→ void
-
Function: FORM_OnBeforeClosePage
This method is required for implementing all the form related
functions. Should be invoked before user closes the PDF page.
Parameters:
page - Handle to the page, as returned by FPDF_LoadPage().
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
Return Value:
None.
-
FORM_OnChar(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int nChar, int modifier)
→ int
-
Function: FORM_OnChar
Call this member function when a keystroke translates to a
nonsystem character.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
page - Handle to the page, as returned by FPDF_LoadPage().
nChar - The character code value itself.
modifier - Mask of key flags (see fpdf_fwlevent.h for key
flag values).
Return Value:
True indicates success; otherwise false.
-
FORM_OnFocus(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y)
→ int
-
Function: FORM_OnFocus
This function focuses the form annotation at a given point. If the
annotation at the point already has focus, nothing happens. If there
is no annotation at the point, removes form focus.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
page - Handle to the page, as returned by FPDF_LoadPage().
modifier - Indicates whether various virtual keys are down.
page_x - Specifies the x-coordinate of the cursor in PDF user
space.
page_y - Specifies the y-coordinate of the cursor in PDF user
space.
Return Value:
True if there is an annotation at the given point and it has focus.
-
FORM_OnKeyDown(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int nKeyCode, int modifier)
→ int
-
Function: FORM_OnKeyDown
Call this member function when a nonsystem key is pressed.
Parameters:
hHandle - Handle to the form fill module, aseturned by
FPDFDOC_InitFormFillEnvironment().
page - Handle to the page, as returned by FPDF_LoadPage().
nKeyCode - The virtual-key code of the given key (see
fpdf_fwlevent.h for virtual key codes).
modifier - Mask of key flags (see fpdf_fwlevent.h for key
flag values).
Return Value:
True indicates success; otherwise false.
-
FORM_OnKeyUp(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int nKeyCode, int modifier)
→ int
-
Function: FORM_OnKeyUp
Call this member function when a nonsystem key is released.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
page - Handle to the page, as returned by FPDF_LoadPage().
nKeyCode - The virtual-key code of the given key (see
fpdf_fwlevent.h for virtual key codes).
modifier - Mask of key flags (see fpdf_fwlevent.h for key
flag values).
Return Value:
True indicates success; otherwise false.
Comments:
Currently unimplemented and always returns false. PDFium reserves this
API and may implement it in the future on an as-needed basis.
-
FORM_OnLButtonDoubleClick(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y)
→ int
-
Function: FORM_OnLButtonDoubleClick
Call this member function when the user double clicks the
left mouse button.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
page - Handle to the page, as returned by FPDF_LoadPage().
modifier - Indicates whether various virtual keys are down.
page_x - Specifies the x-coordinate of the cursor in PDF user
space.
page_y - Specifies the y-coordinate of the cursor in PDF user
space.
Return Value:
True indicates success; otherwise false.
-
FORM_OnLButtonDown(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y)
→ int
-
Function: FORM_OnLButtonDown
Call this member function when the user presses the left
mouse button.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
page - Handle to the page, as returned by FPDF_LoadPage().
modifier - Indicates whether various virtual keys are down.
page_x - Specifies the x-coordinate of the cursor in PDF user
space.
page_y - Specifies the y-coordinate of the cursor in PDF user
space.
Return Value:
True indicates success; otherwise false.
-
FORM_OnLButtonUp(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y)
→ int
-
Function: FORM_OnLButtonUp
Call this member function when the user releases the left
mouse button.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
page - Handle to the page, as returned by FPDF_LoadPage().
modifier - Indicates whether various virtual keys are down.
page_x - Specifies the x-coordinate of the cursor in device.
page_y - Specifies the y-coordinate of the cursor in device.
Return Value:
True indicates success; otherwise false.
-
FORM_OnMouseMove(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y)
→ int
-
Function: FORM_OnMouseMove
Call this member function when the mouse cursor moves.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
page - Handle to the page, as returned by FPDF_LoadPage().
modifier - Indicates whether various virtual keys are down.
page_x - Specifies the x-coordinate of the cursor in PDF user
space.
page_y - Specifies the y-coordinate of the cursor in PDF user
space.
Return Value:
True indicates success; otherwise false.
-
FORM_OnMouseWheel(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, Pointer<FS_POINTF> page_coord, int delta_x, int delta_y)
→ int
-
Experimental API
Function: FORM_OnMouseWheel
Call this member function when the user scrolls the mouse wheel.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
page - Handle to the page, as returned by FPDF_LoadPage().
modifier - Indicates whether various virtual keys are down.
page_coord - Specifies the coordinates of the cursor in PDF user
space.
delta_x - Specifies the amount of wheel movement on the x-axis,
in units of platform-agnostic wheel deltas. Negative
values mean left.
delta_y - Specifies the amount of wheel movement on the y-axis,
in units of platform-agnostic wheel deltas. Negative
values mean down.
Return Value:
True indicates success; otherwise false.
Comments:
For |delta_x| and |delta_y|, the caller must normalize
platform-specific wheel deltas. e.g. On Windows, a delta value of 240
for a WM_MOUSEWHEEL event normalizes to 2, since Windows defines
WHEEL_DELTA as 120.
-
FORM_OnRButtonDown(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y)
→ int
-
Function: FORM_OnRButtonDown
Same as above, execpt for the right mouse button.
Comments:
At the present time, has no effect except in XFA builds, but is
included for the sake of symmetry.
-
FORM_OnRButtonUp(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y)
→ int
-
Function: FORM_OnRButtonUp
Same as above, execpt for the right mouse button.
Comments:
At the present time, has no effect except in XFA builds, but is
included for the sake of symmetry.
-
FORM_Redo(FPDF_FORMHANDLE hHandle, FPDF_PAGE page)
→ int
-
Function: FORM_Redo
Make the current focused widget perform a redo operation.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
page - Handle to the page, as returned by FPDF_LoadPage().
Return Value:
True if the redo operation succeeded.
-
FORM_ReplaceAndKeepSelection(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, FPDF_WIDESTRING wsText)
→ void
-
Experimental API
Function: FORM_ReplaceAndKeepSelection
Call this function to replace the selected text in a form
text field or user-editable form combobox text field with another
text string (which can be empty or non-empty). If there is no
selected text, this function will append the replacement text after
the current caret position. After the insertion, the inserted text
will be selected.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
page - Handle to the page, as Returned by FPDF_LoadPage().
wsText - The text to be inserted, in UTF-16LE format.
Return Value:
None.
-
FORM_ReplaceSelection(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, FPDF_WIDESTRING wsText)
→ void
-
Function: FORM_ReplaceSelection
Call this function to replace the selected text in a form
text field or user-editable form combobox text field with another
text string (which can be empty or non-empty). If there is no
selected text, this function will append the replacement text after
the current caret position. After the insertion, the selection range
will be set to empty.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
page - Handle to the page, as Returned by FPDF_LoadPage().
wsText - The text to be inserted, in UTF-16LE format.
Return Value:
None.
-
FORM_SelectAllText(FPDF_FORMHANDLE hHandle, FPDF_PAGE page)
→ int
-
Experimental API
Function: FORM_SelectAllText
Call this function to select all the text within the currently focused
form text field or form combobox text field.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
page - Handle to the page, as returned by FPDF_LoadPage().
Return Value:
Whether the operation succeeded or not.
-
FORM_SetFocusedAnnot(FPDF_FORMHANDLE handle, FPDF_ANNOTATION annot)
→ int
-
Experimental API.
Function: FORM_SetFocusedAnnot.
Call this member function to set the currently focused annotation.
Parameters:
handle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
annot - Handle to an annotation.
Return Value:
True indicates success; otherwise false.
Comments:
|annot| can't be NULL. To kill focus, use FORM_ForceToKillFocus()
instead.
-
FORM_SetIndexSelected(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int index, int selected)
→ int
-
Experimental API
Function: FORM_SetIndexSelected
Selects/deselects the value at the given |index| of the focused
annotation.
Parameters:
hHandle - Handle to the form fill module. Returned by
FPDFDOC_InitFormFillEnvironment.
page - Handle to the page. Returned by FPDF_LoadPage
index - 0-based index of value to be set as
selected/unselected
selected - true to select, false to deselect
Return Value:
TRUE if the operation succeeded.
FALSE if the operation failed or widget is not a supported type.
Comments:
Intended for use with listbox/combobox widget types. Comboboxes
have at most a single value selected at a time which cannot be
deselected. Deselect on a combobox is a no-op that returns false.
Default implementation is a no-op that will return false for
other types.
Not currently supported for XFA forms - will return false.
-
FORM_Undo(FPDF_FORMHANDLE hHandle, FPDF_PAGE page)
→ int
-
Function: FORM_Undo
Make the current focused widget perform an undo operation.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
page - Handle to the page, as returned by FPDF_LoadPage().
Return Value:
True if the undo operation succeeded.
-
FPDF_AddInstalledFont(Pointer<Void> mapper, Pointer<Char> face, int charset)
→ void
-
Function: FPDF_AddInstalledFont
Add a system font to the list in PDFium.
Comments:
This function is only called during the system font list building
process.
Parameters:
mapper - Opaque pointer to Foxit font mapper
face - The font face name
charset - Font character set. See above defined constants.
Return Value:
None.
-
FPDF_CloseDocument(FPDF_DOCUMENT document)
→ void
-
Function: FPDF_CloseDocument
Close a loaded PDF document.
Parameters:
document - Handle to the loaded document.
Return value:
None.
-
FPDF_ClosePage(FPDF_PAGE page)
→ void
-
Function: FPDF_ClosePage
Close a loaded PDF page.
Parameters:
page - Handle to the loaded page.
Return value:
None.
-
FPDF_CloseXObject(FPDF_XOBJECT xobject)
→ void
-
Experimental API.
Close an FPDF_XOBJECT handle created by FPDF_NewXObjectFromPage().
FPDF_PAGEOBJECTs created from the FPDF_XOBJECT handle are not affected.
-
FPDF_CopyViewerPreferences(FPDF_DOCUMENT dest_doc, FPDF_DOCUMENT src_doc)
→ int
-
Copy the viewer preferences from |src_doc| into |dest_doc|.
-
FPDF_CountNamedDests(FPDF_DOCUMENT document)
→ int
-
Function: FPDF_CountNamedDests
Get the count of named destinations in the PDF document.
Parameters:
document - Handle to a document
Return value:
The count of named destinations.
-
FPDF_CreateClipPath(double left, double bottom, double right, double top)
→ FPDF_CLIPPATH
-
Create a new clip path, with a rectangle inserted.
-
FPDF_CreateNewDocument()
→ FPDF_DOCUMENT
-
Create a new PDF document.
-
FPDF_DestroyClipPath(FPDF_CLIPPATH clipPath)
→ void
-
Destroy the clip path.
-
FPDF_DestroyLibrary()
→ void
-
Function: FPDF_DestroyLibrary
Release global resources allocated to the PDFium library by
FPDF_InitLibrary() or FPDF_InitLibraryWithConfig().
Parameters:
None.
Return value:
None.
Comments:
After this function is called, you must not call any PDF
processing functions.
-
FPDF_DeviceToPage(FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y, int rotate, int device_x, int device_y, Pointer<Double> page_x, Pointer<Double> page_y)
→ int
-
Function: FPDF_DeviceToPage
Convert the screen coordinates of a point to page coordinates.
Parameters:
page - Handle to the page. Returned by FPDF_LoadPage.
start_x - Left pixel position of the display area in
device coordinates.
start_y - Top pixel position of the display area in device
coordinates.
size_x - Horizontal size (in pixels) for displaying the page.
size_y - Vertical size (in pixels) for displaying the page.
rotate - Page orientation:
0 (normal)
1 (rotated 90 degrees clockwise)
2 (rotated 180 degrees)
3 (rotated 90 degrees counter-clockwise)
device_x - X value in device coordinates to be converted.
device_y - Y value in device coordinates to be converted.
page_x - A pointer to a double receiving the converted X
value in page coordinates.
page_y - A pointer to a double receiving the converted Y
value in page coordinates.
Return value:
Returns true if the conversion succeeds, and |page_x| and |page_y|
successfully receives the converted coordinates.
Comments:
The page coordinate system has its origin at the left-bottom corner
of the page, with the X-axis on the bottom going to the right, and
the Y-axis on the left side going up.
-
FPDF_DocumentHasValidCrossReferenceTable(FPDF_DOCUMENT document)
→ int
-
Experimental API.
Function: FPDF_DocumentHasValidCrossReferenceTable
Whether the document's cross reference table is valid or not.
Parameters:
document - Handle to a document. Returned by FPDF_LoadDocument.
Return value:
True if the PDF parser did not encounter problems parsing the cross
reference table. False if the parser could not parse the cross
reference table and the table had to be rebuild from other data
within the document.
Comments:
The return value can change over time as the PDF parser evolves.
-
FPDF_FFLDraw(FPDF_FORMHANDLE hHandle, FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y, int rotate, int flags)
→ void
-
Function: FPDF_FFLDraw
Render FormFields and popup window on a page to a device independent
bitmap.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
bitmap - Handle to the device independent bitmap (as the
output buffer). Bitmap handles can be created by
FPDFBitmap_Create().
page - Handle to the page, as returned by FPDF_LoadPage().
start_x - Left pixel position of the display area in the
device coordinates.
start_y - Top pixel position of the display area in the device
coordinates.
size_x - Horizontal size (in pixels) for displaying the page.
size_y - Vertical size (in pixels) for displaying the page.
rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees
clockwise), 2 (rotated 180 degrees), 3 (rotated 90
degrees counter-clockwise).
flags - 0 for normal display, or combination of flags
defined above.
Return Value:
None.
Comments:
This function is designed to render annotations that are
user-interactive, which are widget annotations (for FormFields) and
popup annotations.
With the FPDF_ANNOT flag, this function will render a popup annotation
when users mouse-hover on a non-widget annotation. Regardless of
FPDF_ANNOT flag, this function will always render widget annotations
for FormFields.
In order to implement the FormFill functions, implementation should
call this function after rendering functions, such as
FPDF_RenderPageBitmap() or FPDF_RenderPageBitmap_Start(), have
finished rendering the page contents.
-
FPDF_FreeDefaultSystemFontInfo(Pointer<FPDF_SYSFONTINFO> font_info)
→ void
-
Function: FPDF_FreeDefaultSystemFontInfo
Free a default system font info interface
Parameters:
font_info - Pointer to a FPDF_SYSFONTINFO structure
Return Value:
None
Comments:
This function should be called on the output from
FPDF_GetDefaultSystemFontInfo() once it is no longer needed.
-
FPDF_GetDefaultSystemFontInfo()
→ Pointer<FPDF_SYSFONTINFO>
-
Function: FPDF_GetDefaultSystemFontInfo
Get default system font info interface for current platform
Parameters:
None
Return Value:
Pointer to a FPDF_SYSFONTINFO structure describing the default
interface, or NULL if the platform doesn't have a default interface.
Application should call FPDF_FreeDefaultSystemFontInfo to free the
returned pointer.
Comments:
For some platforms, PDFium implements a default version of system
font info interface. The default implementation can be passed to
FPDF_SetSystemFontInfo().
-
FPDF_GetDefaultTTFMap()
→ Pointer<FPDF_CharsetFontMap>
-
Function: FPDF_GetDefaultTTFMap
Returns a pointer to the default character set to TT Font name map. The
map is an array of FPDF_CharsetFontMap structs, with its end indicated
by a { -1, NULL } entry.
Parameters:
None.
Return Value:
Pointer to the Charset Font Map.
Note:
Once FPDF_GetDefaultTTFMapCount() and FPDF_GetDefaultTTFMapEntry() are no
longer experimental, this API will be marked as deprecated.
See https://crbug.com/348468114
-
FPDF_GetDefaultTTFMapCount()
→ int
-
Experimental API.
-
FPDF_GetDefaultTTFMapEntry(int index)
→ Pointer<FPDF_CharsetFontMap>
-
Experimental API.
-
FPDF_GetDocPermissions(FPDF_DOCUMENT document)
→ int
-
Function: FPDF_GetDocPermissions
Get file permission flags of the document.
Parameters:
document - Handle to a document. Returned by FPDF_LoadDocument.
Return value:
A 32-bit integer indicating permission flags. Please refer to the
PDF Reference for detailed descriptions. If the document is not
protected or was unlocked by the owner, 0xffffffff will be returned.
-
FPDF_GetDocUserPermissions(FPDF_DOCUMENT document)
→ int
-
Function: FPDF_GetDocUserPermissions
Get user file permission flags of the document.
Parameters:
document - Handle to a document. Returned by FPDF_LoadDocument.
Return value:
A 32-bit integer indicating permission flags. Please refer to the
PDF Reference for detailed descriptions. If the document is not
protected, 0xffffffff will be returned. Always returns user
permissions, even if the document was unlocked by the owner.
-
FPDF_GetFileIdentifier(FPDF_DOCUMENT document, FPDF_FILEIDTYPE id_type, Pointer<Void> buffer, int buflen)
→ int
-
-
FPDF_GetFileVersion(FPDF_DOCUMENT doc, Pointer<Int> fileVersion)
→ int
-
Function: FPDF_GetFileVersion
Get the file version of the given PDF document.
Parameters:
doc - Handle to a document.
fileVersion - The PDF file version. File version: 14 for 1.4, 15
for 1.5, ...
Return value:
True if succeeds, false otherwise.
Comments:
If the document was created by FPDF_CreateNewDocument,
then this function will always fail.
-
FPDF_GetFormType(FPDF_DOCUMENT document)
→ int
-
Experimental API
Function: FPDF_GetFormType
Returns the type of form contained in the PDF document.
Parameters:
document - Handle to document.
Return Value:
Integer value representing one of the FORMTYPE_ values.
Comments:
If |document| is NULL, then the return value is FORMTYPE_NONE.
-
FPDF_GetLastError()
→ int
-
Function: FPDF_GetLastError
Get last error code when a function fails.
Parameters:
None.
Return value:
A 32-bit integer indicating error code as defined above.
Comments:
If the previous SDK call succeeded, the return value of this
function is not defined. This function only works in conjunction
with APIs that mention FPDF_GetLastError() in their documentation.
-
FPDF_GetMetaText(FPDF_DOCUMENT document, FPDF_BYTESTRING tag, Pointer<Void> buffer, int buflen)
→ int
-
Get meta-data |tag| content from |document|.
-
FPDF_GetNamedDest(FPDF_DOCUMENT document, int index, Pointer<Void> buffer, Pointer<Long> buflen)
→ FPDF_DEST
-
Function: FPDF_GetNamedDest
Get the named destination by index.
Parameters:
document - Handle to a document
index - The index of a named destination.
buffer - The buffer to store the destination name,
used as wchar_t*.
buflen
in/out - Size of the buffer in bytes on input,
length of the result in bytes on output
or -1 if the buffer is too small.
Return value:
The destination handle for a given index, or NULL if there is no
named destination corresponding to |index|.
Comments:
Call this function twice to get the name of the named destination:
-
FPDF_GetNamedDestByName(FPDF_DOCUMENT document, FPDF_BYTESTRING name)
→ FPDF_DEST
-
Function: FPDF_GetNamedDestByName
Get a the destination handle for the given name.
Parameters:
document - Handle to the loaded document.
name - The name of a destination.
Return value:
The handle to the destination.
-
FPDF_GetPageAAction(FPDF_PAGE page, int aa_type)
→ FPDF_ACTION
-
Experimental API
Gets an additional-action from |page|.
-
FPDF_GetPageBoundingBox(FPDF_PAGE page, Pointer<FS_RECTF> rect)
→ int
-
Experimental API.
Function: FPDF_GetPageBoundingBox
Get the bounding box of the page. This is the intersection between
its media box and its crop box.
Parameters:
page - Handle to the page. Returned by FPDF_LoadPage.
rect - Pointer to a rect to receive the page bounding box.
On an error, |rect| won't be filled.
Return value:
True for success.
-
FPDF_GetPageCount(FPDF_DOCUMENT document)
→ int
-
Function: FPDF_GetPageCount
Get total number of pages in the document.
Parameters:
document - Handle to document. Returned by FPDF_LoadDocument.
Return value:
Total number of pages in the document.
-
FPDF_GetPageHeight(FPDF_PAGE page)
→ double
-
Function: FPDF_GetPageHeight
Get page height.
Parameters:
page - Handle to the page. Returned by FPDF_LoadPage.
Return value:
Page height (excluding non-displayable area) measured in points.
One point is 1/72 inch (around 0.3528 mm)
Note:
Prefer FPDF_GetPageHeightF() above. This will be deprecated in the
future.
Comments:
Changing the rotation of |page| affects the return value.
-
FPDF_GetPageHeightF(FPDF_PAGE page)
→ double
-
Experimental API
Function: FPDF_GetPageHeightF
Get page height.
Parameters:
page - Handle to the page. Returned by FPDF_LoadPage().
Return value:
Page height (excluding non-displayable area) measured in points.
One point is 1/72 inch (around 0.3528 mm)
Comments:
Changing the rotation of |page| affects the return value.
-
FPDF_GetPageLabel(FPDF_DOCUMENT document, int page_index, Pointer<Void> buffer, int buflen)
→ int
-
Get the page label for |page_index| from |document|.
-
FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, int page_index, Pointer<Double> width, Pointer<Double> height)
→ int
-
Function: FPDF_GetPageSizeByIndex
Get the size of the page at the given index.
Parameters:
document - Handle to document. Returned by FPDF_LoadDocument.
page_index - Page index, zero for the first page.
width - Pointer to a double to receive the page width
(in points).
height - Pointer to a double to receive the page height
(in points).
Return value:
Non-zero for success. 0 for error (document or page not found).
Note:
Prefer FPDF_GetPageSizeByIndexF() above. This will be deprecated in
the future.
-
FPDF_GetPageSizeByIndexF(FPDF_DOCUMENT document, int page_index, Pointer<FS_SIZEF> size)
→ int
-
Experimental API.
Function: FPDF_GetPageSizeByIndexF
Get the size of the page at the given index.
Parameters:
document - Handle to document. Returned by FPDF_LoadDocument().
page_index - Page index, zero for the first page.
size - Pointer to a FS_SIZEF to receive the page size.
(in points).
Return value:
Non-zero for success. 0 for error (document or page not found).
-
FPDF_GetPageWidth(FPDF_PAGE page)
→ double
-
Function: FPDF_GetPageWidth
Get page width.
Parameters:
page - Handle to the page. Returned by FPDF_LoadPage.
Return value:
Page width (excluding non-displayable area) measured in points.
One point is 1/72 inch (around 0.3528 mm).
Note:
Prefer FPDF_GetPageWidthF() above. This will be deprecated in the
future.
Comments:
Changing the rotation of |page| affects the return value.
-
FPDF_GetPageWidthF(FPDF_PAGE page)
→ double
-
Experimental API
Function: FPDF_GetPageWidthF
Get page width.
Parameters:
page - Handle to the page. Returned by FPDF_LoadPage().
Return value:
Page width (excluding non-displayable area) measured in points.
One point is 1/72 inch (around 0.3528 mm).
Comments:
Changing the rotation of |page| affects the return value.
-
FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document)
→ int
-
Function: FPDF_GetSecurityHandlerRevision
Get the revision for the security handler.
Parameters:
document - Handle to a document. Returned by FPDF_LoadDocument.
Return value:
The security handler revision number. Please refer to the PDF
Reference for a detailed description. If the document is not
protected, -1 will be returned.
-
FPDF_GetSignatureCount(FPDF_DOCUMENT document)
→ int
-
Experimental API.
Function: FPDF_GetSignatureCount
Get total number of signatures in the document.
Parameters:
document - Handle to document. Returned by FPDF_LoadDocument().
Return value:
Total number of signatures in the document on success, -1 on error.
-
FPDF_GetSignatureObject(FPDF_DOCUMENT document, int index)
→ FPDF_SIGNATURE
-
Experimental API.
Function: FPDF_GetSignatureObject
Get the Nth signature of the document.
Parameters:
document - Handle to document. Returned by FPDF_LoadDocument().
index - Index into the array of signatures of the document.
Return value:
Returns the handle to the signature, or NULL on failure. The caller
does not take ownership of the returned FPDF_SIGNATURE. Instead, it
remains valid until FPDF_CloseDocument() is called for the document.
-
FPDF_GetTrailerEnds(FPDF_DOCUMENT document, Pointer<UnsignedInt> buffer, int length)
→ int
-
Experimental API.
Function: FPDF_GetTrailerEnds
Get the byte offsets of trailer ends.
Parameters:
document - Handle to document. Returned by FPDF_LoadDocument().
buffer - The address of a buffer that receives the
byte offsets.
length - The size, in ints, of |buffer|.
Return value:
Returns the number of ints in the buffer on success, 0 on error.
-
FPDF_GetXFAPacketContent(FPDF_DOCUMENT document, int index, Pointer<Void> buffer, int buflen, Pointer<UnsignedLong> out_buflen)
→ int
-
Experimental API.
Function: FPDF_GetXFAPacketContent
Get the content of a packet in the XFA array.
Parameters:
document - Handle to the document.
index - Index number of the packet. 0 for the first packet.
buffer - Buffer for holding the content of the XFA packet.
buflen - Length of |buffer| in bytes.
out_buflen - Pointer to the variable that will receive the minimum
buffer size needed to contain the content of the XFA
packet.
Return value:
Whether the operation succeeded or not.
-
FPDF_GetXFAPacketCount(FPDF_DOCUMENT document)
→ int
-
Experimental API.
Function: FPDF_GetXFAPacketCount
Get the number of valid packets in the XFA entry.
Parameters:
document - Handle to the document.
Return value:
The number of valid packets, or -1 on error.
-
FPDF_GetXFAPacketName(FPDF_DOCUMENT document, int index, Pointer<Void> buffer, int buflen)
→ int
-
Experimental API.
Function: FPDF_GetXFAPacketName
Get the name of a packet in the XFA array.
Parameters:
document - Handle to the document.
index - Index number of the packet. 0 for the first packet.
buffer - Buffer for holding the name of the XFA packet.
buflen - Length of |buffer| in bytes.
Return value:
The length of the packet name in bytes, or 0 on error.
-
FPDF_ImportNPagesToOne(FPDF_DOCUMENT src_doc, double output_width, double output_height, int num_pages_on_x_axis, int num_pages_on_y_axis)
→ FPDF_DOCUMENT
-
Experimental API.
Create a new document from |src_doc|. The pages of |src_doc| will be
combined to provide |num_pages_on_x_axis x num_pages_on_y_axis| pages per
|output_doc| page.
-
FPDF_ImportPages(FPDF_DOCUMENT dest_doc, FPDF_DOCUMENT src_doc, int index)
→ int
-
Import pages to a FPDF_DOCUMENT.
-
FPDF_ImportPagesByIndex(FPDF_DOCUMENT dest_doc, FPDF_DOCUMENT src_doc, Pointer<Int> page_indices, int length, int index)
→ int
-
Experimental API.
Import pages to a FPDF_DOCUMENT.
-
FPDF_InitLibrary()
→ void
-
Function: FPDF_InitLibrary
Initialize the PDFium library (alternative form).
Parameters:
None
Return value:
None.
Comments:
Convenience function to call FPDF_InitLibraryWithConfig() with a
default configuration for backwards compatibility purposes. New
code should call FPDF_InitLibraryWithConfig() instead. This will
be deprecated in the future.
-
FPDF_InitLibraryWithConfig(Pointer<FPDF_LIBRARY_CONFIG> config)
→ void
-
Function: FPDF_InitLibraryWithConfig
Initialize the PDFium library and allocate global resources for it.
Parameters:
config - configuration information as above.
Return value:
None.
Comments:
You have to call this function before you can call any PDF
processing functions.
-
FPDF_LoadCustomDocument(Pointer<FPDF_FILEACCESS> pFileAccess, FPDF_BYTESTRING password)
→ FPDF_DOCUMENT
-
Function: FPDF_LoadCustomDocument
Load PDF document from a custom access descriptor.
Parameters:
pFileAccess - A structure for accessing the file.
password - Optional password for decrypting the PDF file.
Return value:
A handle to the loaded document, or NULL on failure.
Comments:
The application must keep the file resources |pFileAccess| points to
valid until the returned FPDF_DOCUMENT is closed. |pFileAccess|
itself does not need to outlive the FPDF_DOCUMENT.
-
FPDF_LoadDocument(FPDF_STRING file_path, FPDF_BYTESTRING password)
→ FPDF_DOCUMENT
-
Function: FPDF_LoadDocument
Open and load a PDF document.
Parameters:
file_path - Path to the PDF file (including extension).
password - A string used as the password for the PDF file.
If no password is needed, empty or NULL can be used.
See comments below regarding the encoding.
Return value:
A handle to the loaded document, or NULL on failure.
Comments:
Loaded document can be closed by FPDF_CloseDocument().
If this function fails, you can use FPDF_GetLastError() to retrieve
the reason why it failed.
-
FPDF_LoadMemDocument(Pointer<Void> data_buf, int size, FPDF_BYTESTRING password)
→ FPDF_DOCUMENT
-
Function: FPDF_LoadMemDocument
Open and load a PDF document from memory.
Parameters:
data_buf - Pointer to a buffer containing the PDF document.
size - Number of bytes in the PDF document.
password - A string used as the password for the PDF file.
If no password is needed, empty or NULL can be used.
Return value:
A handle to the loaded document, or NULL on failure.
Comments:
The memory buffer must remain valid when the document is open.
The loaded document can be closed by FPDF_CloseDocument.
If this function fails, you can use FPDF_GetLastError() to retrieve
the reason why it failed.
-
FPDF_LoadMemDocument64(Pointer<Void> data_buf, int size, FPDF_BYTESTRING password)
→ FPDF_DOCUMENT
-
Experimental API.
Function: FPDF_LoadMemDocument64
Open and load a PDF document from memory.
Parameters:
data_buf - Pointer to a buffer containing the PDF document.
size - Number of bytes in the PDF document.
password - A string used as the password for the PDF file.
If no password is needed, empty or NULL can be used.
Return value:
A handle to the loaded document, or NULL on failure.
Comments:
The memory buffer must remain valid when the document is open.
The loaded document can be closed by FPDF_CloseDocument.
If this function fails, you can use FPDF_GetLastError() to retrieve
the reason why it failed.
-
FPDF_LoadPage(FPDF_DOCUMENT document, int page_index)
→ FPDF_PAGE
-
Function: FPDF_LoadPage
Load a page inside the document.
Parameters:
document - Handle to document. Returned by FPDF_LoadDocument
page_index - Index number of the page. 0 for the first page.
Return value:
A handle to the loaded page, or NULL if page load fails.
Comments:
The loaded page can be rendered to devices using FPDF_RenderPage.
The loaded page can be closed using FPDF_ClosePage.
-
FPDF_LoadXFA(FPDF_DOCUMENT document)
→ int
-
Function: FPDF_LoadXFA
If the document consists of XFA fields, call this method to
attempt to load XFA fields.
Parameters:
document - Handle to document from FPDF_LoadDocument().
Return Value:
TRUE upon success, otherwise FALSE. If XFA support is not built
into PDFium, performs no action and always returns FALSE.
-
FPDF_MovePages(FPDF_DOCUMENT document, Pointer<Int> page_indices, int page_indices_len, int dest_page_index)
→ int
-
Experimental API.
Move the given pages to a new index position.
-
FPDF_NewFormObjectFromXObject(FPDF_XOBJECT xobject)
→ FPDF_PAGEOBJECT
-
Experimental API.
Create a new form object from an FPDF_XOBJECT object.
-
FPDF_NewXObjectFromPage(FPDF_DOCUMENT dest_doc, FPDF_DOCUMENT src_doc, int src_page_index)
→ FPDF_XOBJECT
-
Experimental API.
Create a template to generate form xobjects from |src_doc|'s page at
|src_page_index|, for use in |dest_doc|.
-
FPDF_PageToDevice(FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y, int rotate, double page_x, double page_y, Pointer<Int> device_x, Pointer<Int> device_y)
→ int
-
Function: FPDF_PageToDevice
Convert the page coordinates of a point to screen coordinates.
Parameters:
page - Handle to the page. Returned by FPDF_LoadPage.
start_x - Left pixel position of the display area in
device coordinates.
start_y - Top pixel position of the display area in device
coordinates.
size_x - Horizontal size (in pixels) for displaying the page.
size_y - Vertical size (in pixels) for displaying the page.
rotate - Page orientation:
0 (normal)
1 (rotated 90 degrees clockwise)
2 (rotated 180 degrees)
3 (rotated 90 degrees counter-clockwise)
page_x - X value in page coordinates.
page_y - Y value in page coordinate.
device_x - A pointer to an integer receiving the result X
value in device coordinates.
device_y - A pointer to an integer receiving the result Y
value in device coordinates.
Return value:
Returns true if the conversion succeeds, and |device_x| and
|device_y| successfully receives the converted coordinates.
Comments:
See comments for FPDF_DeviceToPage().
-
FPDF_RemoveFormFieldHighlight(FPDF_FORMHANDLE hHandle)
→ void
-
Function: FPDF_RemoveFormFieldHighlight
Remove the form field highlight color in the document.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
Return Value:
None.
Comments:
Please refresh the client window to remove the highlight immediately
if necessary.
-
FPDF_RenderPage_Close(FPDF_PAGE page)
→ void
-
Function: FPDF_RenderPage_Close
Release the resource allocate during page rendering. Need to be
called after finishing rendering or
cancel the rendering.
Parameters:
page - Handle to the page, as returned by FPDF_LoadPage().
Return value:
None.
-
FPDF_RenderPage_Continue(FPDF_PAGE page, Pointer<IFSDK_PAUSE> pause)
→ int
-
Function: FPDF_RenderPage_Continue
Continue rendering a PDF page.
Parameters:
page - Handle to the page, as returned by FPDF_LoadPage().
pause - The IFSDK_PAUSE interface (a callback mechanism
allowing the page rendering process to be paused
before it's finished). This can be NULL if you
don't want to pause.
Return value:
The rendering status. See flags for progressive process status for
the details.
-
FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y, int rotate, int flags)
→ void
-
Function: FPDF_RenderPageBitmap
Render contents of a page to a device independent bitmap.
Parameters:
bitmap - Handle to the device independent bitmap (as the
output buffer). The bitmap handle can be created
by FPDFBitmap_Create or retrieved from an image
object by FPDFImageObj_GetBitmap.
page - Handle to the page. Returned by FPDF_LoadPage
start_x - Left pixel position of the display area in
bitmap coordinates.
start_y - Top pixel position of the display area in bitmap
coordinates.
size_x - Horizontal size (in pixels) for displaying the page.
size_y - Vertical size (in pixels) for displaying the page.
rotate - Page orientation:
0 (normal)
1 (rotated 90 degrees clockwise)
2 (rotated 180 degrees)
3 (rotated 90 degrees counter-clockwise)
flags - 0 for normal display, or combination of the Page
Rendering flags defined above. With the FPDF_ANNOT
flag, it renders all annotations that do not require
user-interaction, which are all annotations except
widget and popup annotations.
Return value:
None.
-
FPDF_RenderPageBitmap_Start(FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y, int rotate, int flags, Pointer<IFSDK_PAUSE> pause)
→ int
-
Function: FPDF_RenderPageBitmap_Start
Start to render page contents to a device independent bitmap
progressively.
Parameters:
bitmap - Handle to the device independent bitmap (as the
output buffer). Bitmap handle can be created by
FPDFBitmap_Create().
page - Handle to the page, as returned by FPDF_LoadPage().
start_x - Left pixel position of the display area in the
bitmap coordinates.
start_y - Top pixel position of the display area in the bitmap
coordinates.
size_x - Horizontal size (in pixels) for displaying the page.
size_y - Vertical size (in pixels) for displaying the page.
rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees
clockwise), 2 (rotated 180 degrees), 3 (rotated 90
degrees counter-clockwise).
flags - 0 for normal display, or combination of flags
defined in fpdfview.h. With FPDF_ANNOT flag, it
renders all annotations that does not require
user-interaction, which are all annotations except
widget and popup annotations.
pause - The IFSDK_PAUSE interface.A callback mechanism
allowing the page rendering process
Return value:
Rendering Status. See flags for progressive process status for the
details.
-
FPDF_RenderPageBitmapWithColorScheme_Start(FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y, int rotate, int flags, Pointer<FPDF_COLORSCHEME> color_scheme, Pointer<IFSDK_PAUSE> pause)
→ int
-
Experimental API.
Function: FPDF_RenderPageBitmapWithColorScheme_Start
Start to render page contents to a device independent bitmap
progressively with a specified color scheme for the content.
Parameters:
bitmap - Handle to the device independent bitmap (as the
output buffer). Bitmap handle can be created by
FPDFBitmap_Create function.
page - Handle to the page as returned by FPDF_LoadPage
function.
start_x - Left pixel position of the display area in the
bitmap coordinate.
start_y - Top pixel position of the display area in the
bitmap coordinate.
size_x - Horizontal size (in pixels) for displaying the
page.
size_y - Vertical size (in pixels) for displaying the page.
rotate - Page orientation: 0 (normal), 1 (rotated 90
degrees clockwise), 2 (rotated 180 degrees),
3 (rotated 90 degrees counter-clockwise).
flags - 0 for normal display, or combination of flags
defined in fpdfview.h. With FPDF_ANNOT flag, it
renders all annotations that does not require
user-interaction, which are all annotations except
widget and popup annotations.
color_scheme - Color scheme to be used in rendering the |page|.
If null, this function will work similar to
FPDF_RenderPageBitmap_Start().
pause - The IFSDK_PAUSE interface. A callback mechanism
allowing the page rendering process.
Return value:
Rendering Status. See flags for progressive process status for the
details.
-
FPDF_RenderPageBitmapWithMatrix(FPDF_BITMAP bitmap, FPDF_PAGE page, Pointer<FS_MATRIX> matrix, Pointer<FS_RECTF> clipping, int flags)
→ void
-
Function: FPDF_RenderPageBitmapWithMatrix
Render contents of a page to a device independent bitmap.
Parameters:
bitmap - Handle to the device independent bitmap (as the
output buffer). The bitmap handle can be created
by FPDFBitmap_Create or retrieved by
FPDFImageObj_GetBitmap.
page - Handle to the page. Returned by FPDF_LoadPage.
matrix - The transform matrix, which must be invertible.
See PDF Reference 1.7, 4.2.2 Common Transformations.
clipping - The rect to clip to in device coords.
flags - 0 for normal display, or combination of the Page
Rendering flags defined above. With the FPDF_ANNOT
flag, it renders all annotations that do not require
user-interaction, which are all annotations except
widget and popup annotations.
Return value:
None. Note that behavior is undefined if det of |matrix| is 0.
-
FPDF_SaveAsCopy(FPDF_DOCUMENT document, Pointer<FPDF_FILEWRITE> file_write, int flags)
→ int
-
Function: FPDF_SaveAsCopy
Saves the copy of specified document in custom way.
Parameters:
document - Handle to document, as returned by
FPDF_LoadDocument() or FPDF_CreateNewDocument().
file_write - A pointer to a custom file write structure.
flags - Flags above that affect how the PDF gets saved.
Pass in 0 when there are no flags.
Return value:
TRUE for succeed, FALSE for failed.
-
FPDF_SaveWithVersion(FPDF_DOCUMENT document, Pointer<FPDF_FILEWRITE> file_write, int flags, int file_version)
→ int
-
Function: FPDF_SaveWithVersion
Same as FPDF_SaveAsCopy(), except the file version of the
saved document can be specified by the caller.
Parameters:
document - Handle to document.
file_write - A pointer to a custom file write structure.
flags - The creating flags.
file_version - The PDF file version. File version: 14 for 1.4,
15 for 1.5, ...
Return value:
TRUE if succeed, FALSE if failed.
-
FPDF_SetFormFieldHighlightAlpha(FPDF_FORMHANDLE hHandle, int alpha)
→ void
-
Function: FPDF_SetFormFieldHighlightAlpha
Set the transparency of the form field highlight color in the
document.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
doc - Handle to the document, as returaned by
FPDF_LoadDocument().
alpha - The transparency of the form field highlight color,
between 0-255.
Return Value:
None.
-
FPDF_SetFormFieldHighlightColor(FPDF_FORMHANDLE hHandle, int fieldType, int color)
→ void
-
Function: FPDF_SetFormFieldHighlightColor
Set the highlight color of the specified (or all) form fields
in the document.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
doc - Handle to the document, as returned by
FPDF_LoadDocument().
fieldType - A 32-bit integer indicating the type of a form
field (defined above).
color - The highlight color of the form field. Constructed by
0xxxrrggbb.
Return Value:
None.
Comments:
When the parameter fieldType is set to FPDF_FORMFIELD_UNKNOWN, the
highlight color will be applied to all the form fields in the
document.
Please refresh the client window to show the highlight immediately
if necessary.
-
FPDF_SetSandBoxPolicy(int policy, int enable)
→ void
-
Function: FPDF_SetSandBoxPolicy
Set the policy for the sandbox environment.
Parameters:
policy - The specified policy for setting, for example:
FPDF_POLICY_MACHINETIME_ACCESS.
enable - True to enable, false to disable the policy.
Return value:
None.
-
FPDF_SetSystemFontInfo(Pointer<FPDF_SYSFONTINFO> font_info)
→ void
-
Function: FPDF_SetSystemFontInfo
Set the system font info interface into PDFium
Parameters:
font_info - Pointer to a FPDF_SYSFONTINFO structure
Return Value:
None
Comments:
Platform support implementation should implement required methods of
FFDF_SYSFONTINFO interface, then call this function during PDFium
initialization process.
-
FPDF_StructElement_Attr_CountChildren(FPDF_STRUCTELEMENT_ATTR_VALUE value)
→ int
-
Experimental API.
Function: FPDF_StructElement_Attr_CountChildren
Count the number of children values in an attribute.
Parameters:
value - Handle to the value.
Return value:
The number of children, or -1 on error.
-
FPDF_StructElement_Attr_GetBlobValue(FPDF_STRUCTELEMENT_ATTR_VALUE value, Pointer<Void> buffer, int buflen, Pointer<UnsignedLong> out_buflen)
→ int
-
Experimental API.
Function: FPDF_StructElement_Attr_GetBlobValue
Get the value of a blob attribute in an attribute map as string.
Parameters:
value - Handle to the value.
buffer - A buffer for holding the returned value. This is only
modified if |buflen| is at least as long as the length
of the value. Optional, pass null to just retrieve the
size of the buffer needed.
buflen - The length of the buffer.
out_buflen - A pointer to variable that will receive the minimum
buffer size to contain the key. Not filled if FALSE is
returned.
Return value:
Returns TRUE if the attribute maps to a string value, FALSE
otherwise.
-
FPDF_StructElement_Attr_GetBooleanValue(FPDF_STRUCTELEMENT_ATTR_VALUE value, Pointer<Int> out_value)
→ int
-
Experimental API.
Function: FPDF_StructElement_Attr_GetBooleanValue
Get the value of a boolean attribute in an attribute map as
FPDF_BOOL. FPDF_StructElement_Attr_GetType() should have returned
FPDF_OBJECT_BOOLEAN for this property.
Parameters:
value - Handle to the value.
out_value - A pointer to variable that will receive the value. Not
filled if false is returned.
Return value:
Returns TRUE if the attribute maps to a boolean value, FALSE
otherwise.
-
FPDF_StructElement_Attr_GetChildAtIndex(FPDF_STRUCTELEMENT_ATTR_VALUE value, int index)
→ FPDF_STRUCTELEMENT_ATTR_VALUE
-
Experimental API.
Function: FPDF_StructElement_Attr_GetChildAtIndex
Get a child from an attribute.
Parameters:
value - Handle to the value.
index - The index for the child, 0-based.
Return value:
The child at the n-th index or NULL on error.
Comments:
The |index| must be less than the
FPDF_StructElement_Attr_CountChildren() return value.
-
FPDF_StructElement_Attr_GetCount(FPDF_STRUCTELEMENT_ATTR struct_attribute)
→ int
-
Experimental API.
Function: FPDF_StructElement_Attr_GetCount
Count the number of attributes in a structure element attribute map.
Parameters:
struct_attribute - Handle to the struct element attribute.
Return value:
The number of attributes, or -1 on error.
-
FPDF_StructElement_Attr_GetName(FPDF_STRUCTELEMENT_ATTR struct_attribute, int index, Pointer<Void> buffer, int buflen, Pointer<UnsignedLong> out_buflen)
→ int
-
Experimental API.
Function: FPDF_StructElement_Attr_GetName
Get the name of an attribute in a structure element attribute map.
Parameters:
struct_attribute - Handle to the struct element attribute.
index - The index of attribute in the map.
buffer - A buffer for output. May be NULL. This is only
modified if |buflen| is longer than the length
of the key. Optional, pass null to just
retrieve the size of the buffer needed.
buflen - The length of the buffer.
out_buflen - A pointer to variable that will receive the
minimum buffer size to contain the key. Not
filled if FALSE is returned.
Return value:
TRUE if the operation was successful, FALSE otherwise.
-
FPDF_StructElement_Attr_GetNumberValue(FPDF_STRUCTELEMENT_ATTR_VALUE value, Pointer<Float> out_value)
→ int
-
Experimental API.
Function: FPDF_StructElement_Attr_GetNumberValue
Get the value of a number attribute in an attribute map as float.
FPDF_StructElement_Attr_GetType() should have returned
FPDF_OBJECT_NUMBER for this property.
Parameters:
value - Handle to the value.
out_value - A pointer to variable that will receive the value. Not
filled if false is returned.
Return value:
Returns TRUE if the attribute maps to a number value, FALSE
otherwise.
-
FPDF_StructElement_Attr_GetStringValue(FPDF_STRUCTELEMENT_ATTR_VALUE value, Pointer<Void> buffer, int buflen, Pointer<UnsignedLong> out_buflen)
→ int
-
Experimental API.
Function: FPDF_StructElement_Attr_GetStringValue
Get the value of a string attribute in an attribute map as string.
FPDF_StructElement_Attr_GetType() should have returned
FPDF_OBJECT_STRING or FPDF_OBJECT_NAME for this property.
Parameters:
value - Handle to the value.
buffer - A buffer for holding the returned key in UTF-16LE.
This is only modified if |buflen| is longer than the
length of the key. Optional, pass null to just
retrieve the size of the buffer needed.
buflen - The length of the buffer.
out_buflen - A pointer to variable that will receive the minimum
buffer size to contain the key. Not filled if FALSE is
returned.
Return value:
Returns TRUE if the attribute maps to a string value, FALSE
otherwise.
-
FPDF_StructElement_Attr_GetType(FPDF_STRUCTELEMENT_ATTR_VALUE value)
→ int
-
Experimental API.
Function: FPDF_StructElement_Attr_GetType
Get the type of an attribute in a structure element attribute map.
Parameters:
value - Handle to the value.
Return value:
Returns the type of the value, or FPDF_OBJECT_UNKNOWN in case of
failure. Note that this will never return FPDF_OBJECT_REFERENCE, as
references are always dereferenced.
-
FPDF_StructElement_Attr_GetValue(FPDF_STRUCTELEMENT_ATTR struct_attribute, FPDF_BYTESTRING name)
→ FPDF_STRUCTELEMENT_ATTR_VALUE
-
Experimental API.
Function: FPDF_StructElement_Attr_GetValue
Get a handle to a value for an attribute in a structure element
attribute map.
Parameters:
struct_attribute - Handle to the struct element attribute.
name - The attribute name.
Return value:
Returns a handle to the value associated with the input, if any.
Returns NULL on failure. The caller does not own the handle.
The handle remains valid as long as |struct_attribute| remains
valid.
-
FPDF_StructElement_CountChildren(FPDF_STRUCTELEMENT struct_element)
→ int
-
Function: FPDF_StructElement_CountChildren
Count the number of children for the structure element.
Parameters:
struct_element - Handle to the struct element.
Return value:
The number of children, or -1 on error.
-
FPDF_StructElement_GetActualText(FPDF_STRUCTELEMENT struct_element, Pointer<Void> buffer, int buflen)
→ int
-
Experimental API.
Function: FPDF_StructElement_GetActualText
Get the actual text for a given element.
Parameters:
struct_element - Handle to the struct element.
buffer - A buffer for output the actual text. May be NULL.
buflen - The length of the buffer, in bytes. May be 0.
Return value:
The number of bytes in the actual text, including the terminating
NUL character. The number of bytes is returned regardless of the
|buffer| and |buflen| parameters.
Comments:
Regardless of the platform, the |buffer| is always in UTF-16LE
encoding. The string is terminated by a UTF16 NUL character. If
|buflen| is less than the required length, or |buffer| is NULL,
|buffer| will not be modified.
-
FPDF_StructElement_GetAltText(FPDF_STRUCTELEMENT struct_element, Pointer<Void> buffer, int buflen)
→ int
-
Function: FPDF_StructElement_GetAltText
Get the alt text for a given element.
Parameters:
struct_element - Handle to the struct element.
buffer - A buffer for output the alt text. May be NULL.
buflen - The length of the buffer, in bytes. May be 0.
Return value:
The number of bytes in the alt text, including the terminating NUL
character. The number of bytes is returned regardless of the
|buffer| and |buflen| parameters.
Comments:
Regardless of the platform, the |buffer| is always in UTF-16LE
encoding. The string is terminated by a UTF16 NUL character. If
|buflen| is less than the required length, or |buffer| is NULL,
|buffer| will not be modified.
-
FPDF_StructElement_GetAttributeAtIndex(FPDF_STRUCTELEMENT struct_element, int index)
→ FPDF_STRUCTELEMENT_ATTR
-
Experimental API.
Function: FPDF_StructElement_GetAttributeAtIndex
Get an attribute object in the structure element.
Parameters:
struct_element - Handle to the struct element.
index - The index for the attribute object, 0-based.
Return value:
The attribute object at the n-th index or NULL on error.
Comments:
If the attribute object exists but is not a dict, then this
function will return NULL. This will also return NULL for out of
bounds indices. The caller does not own the handle. The handle
remains valid as long as |struct_element| remains valid.
The |index| must be less than the
FPDF_StructElement_GetAttributeCount() return value.
-
FPDF_StructElement_GetAttributeCount(FPDF_STRUCTELEMENT struct_element)
→ int
-
Function: FPDF_StructElement_GetAttributeCount
Count the number of attributes for the structure element.
Parameters:
struct_element - Handle to the struct element.
Return value:
The number of attributes, or -1 on error.
-
FPDF_StructElement_GetChildAtIndex(FPDF_STRUCTELEMENT struct_element, int index)
→ FPDF_STRUCTELEMENT
-
Function: FPDF_StructElement_GetChildAtIndex
Get a child in the structure element.
Parameters:
struct_element - Handle to the struct element.
index - The index for the child, 0-based.
Return value:
The child at the n-th index or NULL on error.
Comments:
If the child exists but is not an element, then this function will
return NULL. This will also return NULL for out of bounds indices.
The |index| must be less than the FPDF_StructElement_CountChildren()
return value.
-
FPDF_StructElement_GetChildMarkedContentID(FPDF_STRUCTELEMENT struct_element, int index)
→ int
-
Experimental API.
Function: FPDF_StructElement_GetChildMarkedContentID
Get the child's content id
Parameters:
struct_element - Handle to the struct element.
index - The index for the child, 0-based.
Return value:
The marked content ID of the child. If no ID exists, returns -1.
Comments:
If the child exists but is not a stream or object, then this
function will return -1. This will also return -1 for out of bounds
indices. Compared to FPDF_StructElement_GetMarkedContentIdAtIndex,
it is scoped to the current page.
The |index| must be less than the FPDF_StructElement_CountChildren()
return value.
-
FPDF_StructElement_GetExpansion(FPDF_STRUCTELEMENT struct_element, Pointer<Void> buffer, int buflen)
→ int
-
Experimental API.
Function: FPDF_StructElement_GetExpansion
Get the expansion of an abbreviation or acronym for a given element.
Parameters:
struct_element - Handle to the struct element.
buffer - A buffer for output the expansion text. May be
NULL.
buflen - The length of the buffer, in bytes. May be 0.
Return value:
The number of bytes in the expansion text, including the terminating
NUL character. The number of bytes is returned regardless of the
|buffer| and |buflen| parameters.
Comments:
Regardless of the platform, the |buffer| is always in UTF-16LE
encoding. The string is terminated by a UTF16 NUL character. If
|buflen| is less than the required length, or |buffer| is NULL,
|buffer| will not be modified.
-
FPDF_StructElement_GetID(FPDF_STRUCTELEMENT struct_element, Pointer<Void> buffer, int buflen)
→ int
-
Function: FPDF_StructElement_GetID
Get the ID for a given element.
Parameters:
struct_element - Handle to the struct element.
buffer - A buffer for output the ID string. May be NULL.
buflen - The length of the buffer, in bytes. May be 0.
Return value:
The number of bytes in the ID string, including the terminating NUL
character. The number of bytes is returned regardless of the
|buffer| and |buflen| parameters.
Comments:
Regardless of the platform, the |buffer| is always in UTF-16LE
encoding. The string is terminated by a UTF16 NUL character. If
|buflen| is less than the required length, or |buffer| is NULL,
|buffer| will not be modified.
-
FPDF_StructElement_GetLang(FPDF_STRUCTELEMENT struct_element, Pointer<Void> buffer, int buflen)
→ int
-
Experimental API.
Function: FPDF_StructElement_GetLang
Get the case-insensitive IETF BCP 47 language code for an element.
Parameters:
struct_element - Handle to the struct element.
buffer - A buffer for output the lang string. May be NULL.
buflen - The length of the buffer, in bytes. May be 0.
Return value:
The number of bytes in the ID string, including the terminating NUL
character. The number of bytes is returned regardless of the
|buffer| and |buflen| parameters.
Comments:
Regardless of the platform, the |buffer| is always in UTF-16LE
encoding. The string is terminated by a UTF16 NUL character. If
|buflen| is less than the required length, or |buffer| is NULL,
|buffer| will not be modified.
-
FPDF_StructElement_GetMarkedContentID(FPDF_STRUCTELEMENT struct_element)
→ int
-
Function: FPDF_StructElement_GetMarkedContentID
Get the marked content ID for a given element.
Parameters:
struct_element - Handle to the struct element.
Return value:
The marked content ID of the element. If no ID exists, returns
-1.
Comments:
FPDF_StructElement_GetMarkedContentIdAtIndex() may be able to
extract more marked content IDs out of |struct_element|. This API
may be deprecated in the future.
-
FPDF_StructElement_GetMarkedContentIdAtIndex(FPDF_STRUCTELEMENT struct_element, int index)
→ int
-
Experimental API.
Function: FPDF_StructElement_GetMarkedContentIdAtIndex
Get the marked content id at a given index for a given element.
Parameters:
struct_element - Handle to the struct element.
index - The index of the marked content id, 0-based.
Return value:
The marked content ID of the element. If no ID exists, returns
-1.
Comments:
The |index| must be less than the
FPDF_StructElement_GetMarkedContentIdCount() return value.
This will likely supersede FPDF_StructElement_GetMarkedContentID().
-
FPDF_StructElement_GetMarkedContentIdCount(FPDF_STRUCTELEMENT struct_element)
→ int
-
Experimental API.
Function: FPDF_StructElement_GetMarkedContentIdCount
Get the count of marked content ids for a given element.
Parameters:
struct_element - Handle to the struct element.
Return value:
The count of marked content ids or -1 if none exists.
-
FPDF_StructElement_GetObjType(FPDF_STRUCTELEMENT struct_element, Pointer<Void> buffer, int buflen)
→ int
-
Experimental API.
Function: FPDF_StructElement_GetObjType
Get the object type (/Type) for a given element.
Parameters:
struct_element - Handle to the struct element.
buffer - A buffer for output. May be NULL.
buflen - The length of the buffer, in bytes. May be 0.
Return value:
The number of bytes in the object type, including the terminating
NUL character. The number of bytes is returned regardless of the
|buffer| and |buflen| parameters.
Comments:
Regardless of the platform, the |buffer| is always in UTF-16LE
encoding. The string is terminated by a UTF16 NUL character. If
|buflen| is less than the required length, or |buffer| is NULL,
|buffer| will not be modified.
-
FPDF_StructElement_GetParent(FPDF_STRUCTELEMENT struct_element)
→ FPDF_STRUCTELEMENT
-
Experimental API.
Function: FPDF_StructElement_GetParent
Get the parent of the structure element.
Parameters:
struct_element - Handle to the struct element.
Return value:
The parent structure element or NULL on error.
Comments:
If structure element is StructTreeRoot, then this function will
return NULL.
-
FPDF_StructElement_GetStringAttribute(FPDF_STRUCTELEMENT struct_element, FPDF_BYTESTRING attr_name, Pointer<Void> buffer, int buflen)
→ int
-
Experimental API.
Function: FPDF_StructElement_GetStringAttribute
Get a struct element attribute of type "name" or "string".
Parameters:
struct_element - Handle to the struct element.
attr_name - The name of the attribute to retrieve.
buffer - A buffer for output. May be NULL.
buflen - The length of the buffer, in bytes. May be 0.
Return value:
The number of bytes in the attribute value, including the
terminating NUL character. The number of bytes is returned
regardless of the |buffer| and |buflen| parameters.
Comments:
Regardless of the platform, the |buffer| is always in UTF-16LE
encoding. The string is terminated by a UTF16 NUL character. If
|buflen| is less than the required length, or |buffer| is NULL,
|buffer| will not be modified.
-
FPDF_StructElement_GetTitle(FPDF_STRUCTELEMENT struct_element, Pointer<Void> buffer, int buflen)
→ int
-
Function: FPDF_StructElement_GetTitle
Get the title (/T) for a given element.
Parameters:
struct_element - Handle to the struct element.
buffer - A buffer for output. May be NULL.
buflen - The length of the buffer, in bytes. May be 0.
Return value:
The number of bytes in the title, including the terminating NUL
character. The number of bytes is returned regardless of the
|buffer| and |buflen| parameters.
Comments:
Regardless of the platform, the |buffer| is always in UTF-16LE
encoding. The string is terminated by a UTF16 NUL character. If
|buflen| is less than the required length, or |buffer| is NULL,
|buffer| will not be modified.
-
FPDF_StructElement_GetType(FPDF_STRUCTELEMENT struct_element, Pointer<Void> buffer, int buflen)
→ int
-
Function: FPDF_StructElement_GetType
Get the type (/S) for a given element.
Parameters:
struct_element - Handle to the struct element.
buffer - A buffer for output. May be NULL.
buflen - The length of the buffer, in bytes. May be 0.
Return value:
The number of bytes in the type, including the terminating NUL
character. The number of bytes is returned regardless of the
|buffer| and |buflen| parameters.
Comments:
Regardless of the platform, the |buffer| is always in UTF-16LE
encoding. The string is terminated by a UTF16 NUL character. If
|buflen| is less than the required length, or |buffer| is NULL,
|buffer| will not be modified.
-
FPDF_StructTree_Close(FPDF_STRUCTTREE struct_tree)
→ void
-
Function: FPDF_StructTree_Close
Release a resource allocated by FPDF_StructTree_GetForPage().
Parameters:
struct_tree - Handle to the structure tree, as returned by
FPDF_StructTree_LoadPage().
Return value:
None.
-
FPDF_StructTree_CountChildren(FPDF_STRUCTTREE struct_tree)
→ int
-
Function: FPDF_StructTree_CountChildren
Count the number of children for the structure tree.
Parameters:
struct_tree - Handle to the structure tree, as returned by
FPDF_StructTree_LoadPage().
Return value:
The number of children, or -1 on error.
-
FPDF_StructTree_GetChildAtIndex(FPDF_STRUCTTREE struct_tree, int index)
→ FPDF_STRUCTELEMENT
-
Function: FPDF_StructTree_GetChildAtIndex
Get a child in the structure tree.
Parameters:
struct_tree - Handle to the structure tree, as returned by
FPDF_StructTree_LoadPage().
index - The index for the child, 0-based.
Return value:
The child at the n-th index or NULL on error. The caller does not
own the handle. The handle remains valid as long as |struct_tree|
remains valid.
Comments:
The |index| must be less than the FPDF_StructTree_CountChildren()
return value.
-
FPDF_StructTree_GetForPage(FPDF_PAGE page)
→ FPDF_STRUCTTREE
-
Function: FPDF_StructTree_GetForPage
Get the structure tree for a page.
Parameters:
page - Handle to the page, as returned by FPDF_LoadPage().
Return value:
A handle to the structure tree or NULL on error. The caller owns the
returned handle and must use FPDF_StructTree_Close() to release it.
The handle should be released before |page| gets released.
-
FPDF_VIEWERREF_GetDuplex(FPDF_DOCUMENT document)
→ _FPDF_DUPLEXTYPE_
-
-
FPDF_VIEWERREF_GetName(FPDF_DOCUMENT document, FPDF_BYTESTRING key, Pointer<Char> buffer, int length)
→ int
-
Function: FPDF_VIEWERREF_GetName
Gets the contents for a viewer ref, with a given key. The value must
be of type "name".
Parameters:
document - Handle to the loaded document.
key - Name of the key in the viewer pref dictionary,
encoded in UTF-8.
buffer - Caller-allocate buffer to receive the key, or NULL
-
FPDF_VIEWERREF_GetNumCopies(FPDF_DOCUMENT document)
→ int
-
Function: FPDF_VIEWERREF_GetNumCopies
Returns the number of copies to be printed.
Parameters:
document - Handle to the loaded document.
Return value:
The number of copies to be printed.
-
Function: FPDF_VIEWERREF_GetPrintPageRange
Page numbers to initialize print dialog box when file is printed.
Parameters:
document - Handle to the loaded document.
Return value:
The print page range to be used for printing.
-
Experimental API.
Function: FPDF_VIEWERREF_GetPrintPageRangeCount
Returns the number of elements in a FPDF_PAGERANGE.
Parameters:
pagerange - Handle to the page range.
Return value:
The number of elements in the page range. Returns 0 on error.
-
Experimental API.
Function: FPDF_VIEWERREF_GetPrintPageRangeElement
Returns an element from a FPDF_PAGERANGE.
Parameters:
pagerange - Handle to the page range.
index - Index of the element.
Return value:
The value of the element in the page range at a given index.
Returns -1 on error.
-
FPDF_VIEWERREF_GetPrintScaling(FPDF_DOCUMENT document)
→ int
-
Function: FPDF_VIEWERREF_GetPrintScaling
Whether the PDF document prefers to be scaled or not.
Parameters:
document - Handle to the loaded document.
Return value:
None.
-
FPDFAction_GetDest(FPDF_DOCUMENT document, FPDF_ACTION action)
→ FPDF_DEST
-
Get the destination of |action|.
-
FPDFAction_GetFilePath(FPDF_ACTION action, Pointer<Void> buffer, int buflen)
→ int
-
Get the file path of |action|.
-
FPDFAction_GetType(FPDF_ACTION action)
→ int
-
Get the type of |action|.
-
FPDFAction_GetURIPath(FPDF_DOCUMENT document, FPDF_ACTION action, Pointer<Void> buffer, int buflen)
→ int
-
Get the URI path of |action|.
-
FPDFAnnot_AddFileAttachment(FPDF_ANNOTATION annot, FPDF_WIDESTRING name)
→ FPDF_ATTACHMENT
-
Experimental API.
Add an embedded file with |name| to |annot|.
-
FPDFAnnot_AddInkStroke(FPDF_ANNOTATION annot, Pointer<FS_POINTF> points, int point_count)
→ int
-
Experimental API.
Add a new InkStroke, represented by an array of points, to the InkList of
|annot|. The API creates an InkList if one doesn't already exist in |annot|.
This API works only for ink annotations. Please refer to ISO 32000-1:2008
spec, section 12.5.6.13.
-
FPDFAnnot_AppendAttachmentPoints(FPDF_ANNOTATION annot, Pointer<FS_QUADPOINTSF> quad_points)
→ int
-
Experimental API.
Append to the list of attachment points (i.e. quadpoints) of an annotation.
If the annotation's appearance stream is defined and this annotation is of a
type with quadpoints, then update the bounding box too if the new quadpoints
define a bigger one.
-
FPDFAnnot_AppendObject(FPDF_ANNOTATION annot, FPDF_PAGEOBJECT obj)
→ int
-
Experimental API.
Add |obj| to |annot|. |obj| must have been created by
FPDFPageObj_CreateNew{Path|Rect}() or FPDFPageObj_New{Text|Image}Obj(), and
will be owned by |annot|. Note that an |obj| cannot belong to more than one
|annot|. Currently, only ink and stamp annotations are supported by this API.
Also note that only path, image, and text objects have APIs for creation.
-
FPDFAnnot_CountAttachmentPoints(FPDF_ANNOTATION annot)
→ int
-
Experimental API.
Get the number of sets of quadpoints of an annotation.
-
FPDFAnnot_GetAP(FPDF_ANNOTATION annot, int appearanceMode, Pointer<FPDF_WCHAR> buffer, int buflen)
→ int
-
Experimental API.
Get the AP (appearance string) from |annot|'s dictionary for a given
|appearanceMode|.
|buffer| is only modified if |buflen| is large enough to hold the whole AP
string. If |buflen| is smaller, the total size of the AP is still returned,
but nothing is copied.
If there is no appearance stream for |annot| in |appearanceMode|, an empty
string is written to |buf| and 2 is returned.
On other errors, nothing is written to |buffer| and 0 is returned.
-
FPDFAnnot_GetAttachmentPoints(FPDF_ANNOTATION annot, int quad_index, Pointer<FS_QUADPOINTSF> quad_points)
→ int
-
Experimental API.
Get the attachment points (i.e. quadpoints) of an annotation.
-
FPDFAnnot_GetBorder(FPDF_ANNOTATION annot, Pointer<Float> horizontal_radius, Pointer<Float> vertical_radius, Pointer<Float> border_width)
→ int
-
Experimental API.
Get the characteristics of the annotation's border (rounded rectangle).
-
FPDFAnnot_GetColor(FPDF_ANNOTATION annot, FPDFANNOT_COLORTYPE type, Pointer<UnsignedInt> R, Pointer<UnsignedInt> G, Pointer<UnsignedInt> B, Pointer<UnsignedInt> A)
→ DartFPDF_BOOL
-
-
FPDFAnnot_GetFileAttachment(FPDF_ANNOTATION annot)
→ FPDF_ATTACHMENT
-
Experimental API.
Get the attachment from |annot|.
-
FPDFAnnot_GetFlags(FPDF_ANNOTATION annot)
→ int
-
Experimental API.
Get the annotation flags of |annot|.
-
FPDFAnnot_GetFocusableSubtypes(FPDF_FORMHANDLE hHandle, Pointer<Int> subtypes, int count)
→ int
-
Experimental API.
Get the list of focusable annotation subtype as set by host.
-
FPDFAnnot_GetFocusableSubtypesCount(FPDF_FORMHANDLE hHandle)
→ int
-
Experimental API.
Get the count of focusable annotation subtypes as set by host
for a |hHandle|.
-
FPDFAnnot_GetFontColor(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot, Pointer<UnsignedInt> R, Pointer<UnsignedInt> G, Pointer<UnsignedInt> B)
→ int
-
Experimental API.
Get the RGB value of the font color for an |annot| with variable text.
-
FPDFAnnot_GetFontSize(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot, Pointer<Float> value)
→ int
-
Experimental API.
Get the float value of the font size for an |annot| with variable text.
If 0, the font is to be auto-sized: its size is computed as a function of
the height of the annotation rectangle.
-
FPDFAnnot_GetFormAdditionalActionJavaScript(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot, int event, Pointer<FPDF_WCHAR> buffer, int buflen)
→ int
-
Experimental API.
Get the JavaScript of an event of the annotation's additional actions.
|buffer| is only modified if |buflen| is large enough to hold the whole
JavaScript string. If |buflen| is smaller, the total size of the JavaScript
is still returned, but nothing is copied. If there is no JavaScript for
|event| in |annot|, an empty string is written to |buf| and 2 is returned,
denoting the size of the null terminator in the buffer. On other errors,
nothing is written to |buffer| and 0 is returned.
-
FPDFAnnot_GetFormControlCount(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot)
→ int
-
Experimental API.
Gets the count of annotations in the |annot|'s control group.
A group of interactive form annotations is collectively called a form
control group. Here, |annot|, an interactive form annotation, should be
either a radio button or a checkbox.
-
FPDFAnnot_GetFormControlIndex(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot)
→ int
-
Experimental API.
Gets the index of |annot| in |annot|'s control group.
A group of interactive form annotations is collectively called a form
control group. Here, |annot|, an interactive form annotation, should be
either a radio button or a checkbox.
-
FPDFAnnot_GetFormFieldAlternateName(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot, Pointer<FPDF_WCHAR> buffer, int buflen)
→ int
-
Experimental API.
Gets the alternate name of |annot|, which is an interactive form annotation.
|buffer| is only modified if |buflen| is longer than the length of contents.
In case of error, nothing will be added to |buffer| and the return value will
be 0. Note that return value of empty string is 2 for "\0\0".
-
FPDFAnnot_GetFormFieldAtPoint(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, Pointer<FS_POINTF> point)
→ FPDF_ANNOTATION
-
Experimental API.
Retrieves an interactive form annotation whose rectangle contains a given
point on a page. Must call FPDFPage_CloseAnnot() when the annotation returned
is no longer needed.
-
FPDFAnnot_GetFormFieldExportValue(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot, Pointer<FPDF_WCHAR> buffer, int buflen)
→ int
-
Experimental API.
Gets the export value of |annot| which is an interactive form annotation.
Intended for use with radio button and checkbox widget annotations.
|buffer| is only modified if |buflen| is longer than the length of contents.
In case of error, nothing will be added to |buffer| and the return value
will be 0. Note that return value of empty string is 2 for "\0\0".
-
FPDFAnnot_GetFormFieldFlags(FPDF_FORMHANDLE handle, FPDF_ANNOTATION annot)
→ int
-
Experimental API.
Get the annotation flags of |annot|.
-
FPDFAnnot_GetFormFieldName(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot, Pointer<FPDF_WCHAR> buffer, int buflen)
→ int
-
Experimental API.
Gets the name of |annot|, which is an interactive form annotation.
|buffer| is only modified if |buflen| is longer than the length of contents.
In case of error, nothing will be added to |buffer| and the return value will
be 0. Note that return value of empty string is 2 for "\0\0".
-
FPDFAnnot_GetFormFieldType(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot)
→ int
-
Experimental API.
Gets the form field type of |annot|, which is an interactive form annotation.
-
FPDFAnnot_GetFormFieldValue(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot, Pointer<FPDF_WCHAR> buffer, int buflen)
→ int
-
Experimental API.
Gets the value of |annot|, which is an interactive form annotation.
|buffer| is only modified if |buflen| is longer than the length of contents.
In case of error, nothing will be added to |buffer| and the return value will
be 0. Note that return value of empty string is 2 for "\0\0".
-
FPDFAnnot_GetInkListCount(FPDF_ANNOTATION annot)
→ int
-
Experimental API.
Get the number of paths in the ink list of an ink annotation.
-
FPDFAnnot_GetInkListPath(FPDF_ANNOTATION annot, int path_index, Pointer<FS_POINTF> buffer, int length)
→ int
-
Experimental API.
Get a path in the ink list of an ink annotation. |buffer| is an array of
points of the path. If |length| is less than the returned length, or |annot|
or |buffer| is NULL, |buffer| will not be modified.
-
FPDFAnnot_GetLine(FPDF_ANNOTATION annot, Pointer<FS_POINTF> start, Pointer<FS_POINTF> end)
→ int
-
Experimental API.
Get the starting and ending coordinates of a line annotation.
-
FPDFAnnot_GetLink(FPDF_ANNOTATION annot)
→ FPDF_LINK
-
Experimental API.
Gets FPDF_LINK object for |annot|. Intended to use for link annotations.
-
FPDFAnnot_GetLinkedAnnot(FPDF_ANNOTATION annot, FPDF_BYTESTRING key)
→ FPDF_ANNOTATION
-
Experimental API.
Get the annotation corresponding to |key| in |annot|'s dictionary. Common
keys for linking annotations include "IRT" and "Popup". Must call
FPDFPage_CloseAnnot() when the annotation returned by this function is no
longer needed.
-
FPDFAnnot_GetNumberValue(FPDF_ANNOTATION annot, FPDF_BYTESTRING key, Pointer<Float> value)
→ int
-
Experimental API.
Get the float value corresponding to |key| in |annot|'s dictionary. Writes
value to |value| and returns True if |key| exists in the dictionary and
|key|'s corresponding value is a number (FPDF_OBJECT_NUMBER), False
otherwise.
-
FPDFAnnot_GetObject(FPDF_ANNOTATION annot, int index)
→ FPDF_PAGEOBJECT
-
Experimental API.
Get the object in |annot| at |index|.
-
FPDFAnnot_GetObjectCount(FPDF_ANNOTATION annot)
→ int
-
Experimental API.
Get the total number of objects in |annot|, including path objects, text
objects, external objects, image objects, and shading objects.
-
FPDFAnnot_GetOptionCount(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot)
→ int
-
Experimental API.
Get the number of options in the |annot|'s "Opt" dictionary. Intended for
use with listbox and combobox widget annotations.
-
FPDFAnnot_GetOptionLabel(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot, int index, Pointer<FPDF_WCHAR> buffer, int buflen)
→ int
-
Experimental API.
Get the string value for the label of the option at |index| in |annot|'s
"Opt" dictionary. Intended for use with listbox and combobox widget
annotations. |buffer| is only modified if |buflen| is longer than the length
of contents. If index is out of range or in case of other error, nothing
will be added to |buffer| and the return value will be 0. Note that
return value of empty string is 2 for "\0\0".
-
FPDFAnnot_GetRect(FPDF_ANNOTATION annot, Pointer<FS_RECTF> rect)
→ int
-
Experimental API.
Get the annotation rectangle defining the location of the annotation.
-
FPDFAnnot_GetStringValue(FPDF_ANNOTATION annot, FPDF_BYTESTRING key, Pointer<FPDF_WCHAR> buffer, int buflen)
→ int
-
Experimental API.
Get the string value corresponding to |key| in |annot|'s dictionary. |buffer|
is only modified if |buflen| is longer than the length of contents. Note that
if |key| does not exist in the dictionary or if |key|'s corresponding value
in the dictionary is not a string (i.e. the value is not of type
FPDF_OBJECT_STRING or FPDF_OBJECT_NAME), then an empty string would be copied
to |buffer| and the return value would be 2. On other errors, nothing would
be added to |buffer| and the return value would be 0.
-
FPDFAnnot_GetSubtype(FPDF_ANNOTATION annot)
→ int
-
Experimental API.
Get the subtype of an annotation.
-
FPDFAnnot_GetValueType(FPDF_ANNOTATION annot, FPDF_BYTESTRING key)
→ int
-
Experimental API.
Get the type of the value corresponding to |key| in |annot|'s dictionary.
-
FPDFAnnot_GetVertices(FPDF_ANNOTATION annot, Pointer<FS_POINTF> buffer, int length)
→ int
-
Experimental API.
Get the vertices of a polygon or polyline annotation. |buffer| is an array of
points of the annotation. If |length| is less than the returned length, or
|annot| or |buffer| is NULL, |buffer| will not be modified.
-
FPDFAnnot_HasAttachmentPoints(FPDF_ANNOTATION annot)
→ int
-
Experimental API.
Check if the annotation is of a type that has attachment points
(i.e. quadpoints). Quadpoints are the vertices of the rectangle that
encompasses the texts affected by the annotation. They provide the
coordinates in the page where the annotation is attached. Only text markup
annotations (i.e. highlight, strikeout, squiggly, and underline) and link
annotations have quadpoints.
-
FPDFAnnot_HasKey(FPDF_ANNOTATION annot, FPDF_BYTESTRING key)
→ int
-
Experimental API.
Check if |annot|'s dictionary has |key| as a key.
-
FPDFAnnot_IsChecked(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot)
→ int
-
Experimental API.
Determine if |annot| is a form widget that is checked. Intended for use with
checkbox and radio button widgets.
-
FPDFAnnot_IsObjectSupportedSubtype(int subtype)
→ int
-
Experimental API.
Check if an annotation subtype is currently supported for object extraction,
update, and removal.
Currently supported subtypes: ink and stamp.
-
FPDFAnnot_IsOptionSelected(FPDF_FORMHANDLE handle, FPDF_ANNOTATION annot, int index)
→ int
-
Experimental API.
Determine whether or not the option at |index| in |annot|'s "Opt" dictionary
is selected. Intended for use with listbox and combobox widget annotations.
-
FPDFAnnot_IsSupportedSubtype(int subtype)
→ int
-
Experimental API.
Check if an annotation subtype is currently supported for creation.
Currently supported subtypes:
-
FPDFAnnot_RemoveInkList(FPDF_ANNOTATION annot)
→ int
-
Experimental API.
Removes an InkList in |annot|.
This API works only for ink annotations.
-
FPDFAnnot_RemoveObject(FPDF_ANNOTATION annot, int index)
→ int
-
Experimental API.
Remove the object in |annot| at |index|.
-
FPDFAnnot_SetAP(FPDF_ANNOTATION annot, int appearanceMode, FPDF_WIDESTRING value)
→ int
-
Experimental API.
Set the AP (appearance string) in |annot|'s dictionary for a given
|appearanceMode|.
-
FPDFAnnot_SetAttachmentPoints(FPDF_ANNOTATION annot, int quad_index, Pointer<FS_QUADPOINTSF> quad_points)
→ int
-
Experimental API.
Replace the attachment points (i.e. quadpoints) set of an annotation at
|quad_index|. This index needs to be within the result of
FPDFAnnot_CountAttachmentPoints().
If the annotation's appearance stream is defined and this annotation is of a
type with quadpoints, then update the bounding box too if the new quadpoints
define a bigger one.
-
FPDFAnnot_SetBorder(FPDF_ANNOTATION annot, double horizontal_radius, double vertical_radius, double border_width)
→ int
-
Experimental API.
Set the characteristics of the annotation's border (rounded rectangle).
-
FPDFAnnot_SetColor(FPDF_ANNOTATION annot, FPDFANNOT_COLORTYPE type, int R, int G, int B, int A)
→ DartFPDF_BOOL
-
-
FPDFAnnot_SetFlags(FPDF_ANNOTATION annot, int flags)
→ int
-
Experimental API.
Set the |annot|'s flags to be of the value |flags|.
-
FPDFAnnot_SetFocusableSubtypes(FPDF_FORMHANDLE hHandle, Pointer<Int> subtypes, int count)
→ int
-
Experimental API.
Set the list of focusable annotation subtypes. Annotations of subtype
FPDF_ANNOT_WIDGET are by default focusable. New subtypes set using this API
will override the existing subtypes.
-
FPDFAnnot_SetFontColor(FPDF_FORMHANDLE handle, FPDF_ANNOTATION annot, int R, int G, int B)
→ int
-
Experimental API.
Set the text color of an annotation.
-
FPDFAnnot_SetFormFieldFlags(FPDF_FORMHANDLE handle, FPDF_ANNOTATION annot, int flags)
→ int
-
Experimental API.
Sets the form field flags for an interactive form annotation.
-
FPDFAnnot_SetRect(FPDF_ANNOTATION annot, Pointer<FS_RECTF> rect)
→ int
-
Experimental API.
Set the annotation rectangle defining the location of the annotation. If the
annotation's appearance stream is defined and this annotation is of a type
without quadpoints, then update the bounding box too if the new rectangle
defines a bigger one.
-
FPDFAnnot_SetStringValue(FPDF_ANNOTATION annot, FPDF_BYTESTRING key, FPDF_WIDESTRING value)
→ int
-
Experimental API.
Set the string value corresponding to |key| in |annot|'s dictionary,
overwriting the existing value if any. The value type would be
FPDF_OBJECT_STRING after this function call succeeds.
-
FPDFAnnot_SetURI(FPDF_ANNOTATION annot, Pointer<Char> uri)
→ int
-
Experimental API.
Add a URI action to |annot|, overwriting the existing action, if any.
-
FPDFAnnot_UpdateObject(FPDF_ANNOTATION annot, FPDF_PAGEOBJECT obj)
→ int
-
Experimental API.
Update |obj| in |annot|. |obj| must be in |annot| already and must have
been retrieved by FPDFAnnot_GetObject(). Currently, only ink and stamp
annotations are supported by this API. Also note that only path, image, and
text objects have APIs for modification; see FPDFPath_(), FPDFText_(), and
FPDFImageObj_*().
-
FPDFAttachment_GetFile(FPDF_ATTACHMENT attachment, Pointer<Void> buffer, int buflen, Pointer<UnsignedLong> out_buflen)
→ int
-
Experimental API.
Get the file data of |attachment|.
When the attachment file data is readable, true is returned, and |out_buflen|
is updated to indicate the file data size. |buffer| is only modified if
|buflen| is non-null and long enough to contain the entire file data. Callers
must check both the return value and the input |buflen| is no less than the
returned |out_buflen| before using the data.
-
FPDFAttachment_GetName(FPDF_ATTACHMENT attachment, Pointer<FPDF_WCHAR> buffer, int buflen)
→ int
-
Experimental API.
Get the name of the |attachment| file. |buffer| is only modified if |buflen|
is longer than the length of the file name. On errors, |buffer| is unmodified
and the returned length is 0.
-
FPDFAttachment_GetStringValue(FPDF_ATTACHMENT attachment, FPDF_BYTESTRING key, Pointer<FPDF_WCHAR> buffer, int buflen)
→ int
-
Experimental API.
Get the string value corresponding to |key| in the params dictionary of the
embedded file |attachment|. |buffer| is only modified if |buflen| is longer
than the length of the string value. Note that if |key| does not exist in the
dictionary or if |key|'s corresponding value in the dictionary is not a
string (i.e. the value is not of type FPDF_OBJECT_STRING or
FPDF_OBJECT_NAME), then an empty string would be copied to |buffer| and the
return value would be 2. On other errors, nothing would be added to |buffer|
and the return value would be 0.
-
FPDFAttachment_GetSubtype(FPDF_ATTACHMENT attachment, Pointer<FPDF_WCHAR> buffer, int buflen)
→ int
-
Experimental API.
Get the MIME type (Subtype) of the embedded file |attachment|. |buffer| is
only modified if |buflen| is longer than the length of the MIME type string.
If the Subtype is not found or if there is no file stream, an empty string
would be copied to |buffer| and the return value would be 2. On other errors,
nothing would be added to |buffer| and the return value would be 0.
-
FPDFAttachment_GetValueType(FPDF_ATTACHMENT attachment, FPDF_BYTESTRING key)
→ int
-
Experimental API.
Get the type of the value corresponding to |key| in the params dictionary of
the embedded |attachment|.
-
FPDFAttachment_HasKey(FPDF_ATTACHMENT attachment, FPDF_BYTESTRING key)
→ int
-
Experimental API.
Check if the params dictionary of |attachment| has |key| as a key.
-
FPDFAttachment_SetFile(FPDF_ATTACHMENT attachment, FPDF_DOCUMENT document, Pointer<Void> contents, int len)
→ int
-
Experimental API.
Set the file data of |attachment|, overwriting the existing file data if any.
The creation date and checksum will be updated, while all other dictionary
entries will be deleted. Note that only contents with |len| smaller than
INT_MAX is supported.
-
FPDFAttachment_SetStringValue(FPDF_ATTACHMENT attachment, FPDF_BYTESTRING key, FPDF_WIDESTRING value)
→ int
-
Experimental API.
Set the string value corresponding to |key| in the params dictionary of the
embedded file |attachment|, overwriting the existing value if any. The value
type should be FPDF_OBJECT_STRING after this function call succeeds.
-
FPDFAvail_Create(Pointer<FX_FILEAVAIL> file_avail, Pointer<FPDF_FILEACCESS> file)
→ FPDF_AVAIL
-
Create a document availability provider.
-
FPDFAvail_Destroy(FPDF_AVAIL avail)
→ void
-
Destroy the |avail| document availability provider.
-
FPDFAvail_GetDocument(FPDF_AVAIL avail, FPDF_BYTESTRING password)
→ FPDF_DOCUMENT
-
Get document from the availability provider.
-
FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc)
→ int
-
Get the page number for the first available page in a linearized PDF.
-
FPDFAvail_IsDocAvail(FPDF_AVAIL avail, Pointer<FX_DOWNLOADHINTS> hints)
→ int
-
Checks if the document is ready for loading, if not, gets download hints.
-
FPDFAvail_IsFormAvail(FPDF_AVAIL avail, Pointer<FX_DOWNLOADHINTS> hints)
→ int
-
Check if form data is ready for initialization, if not, get the
|FX_DOWNLOADHINTS|.
-
FPDFAvail_IsLinearized(FPDF_AVAIL avail)
→ int
-
Check whether a document is a linearized PDF.
-
FPDFAvail_IsPageAvail(FPDF_AVAIL avail, int page_index, Pointer<FX_DOWNLOADHINTS> hints)
→ int
-
Check if |page_index| is ready for loading, if not, get the
|FX_DOWNLOADHINTS|.
-
FPDFBitmap_Create(int width, int height, int alpha)
→ FPDF_BITMAP
-
Function: FPDFBitmap_Create
Create a device independent bitmap (FXDIB).
Parameters:
width - The number of pixels in width for the bitmap.
Must be greater than 0.
height - The number of pixels in height for the bitmap.
Must be greater than 0.
alpha - A flag indicating whether the alpha channel is used.
Non-zero for using alpha, zero for not using.
Return value:
The created bitmap handle, or NULL if a parameter error or out of
memory.
Comments:
The bitmap always uses 4 bytes per pixel. The first byte is always
double word aligned.
-
FPDFBitmap_CreateEx(int width, int height, int format, Pointer<Void> first_scan, int stride)
→ FPDF_BITMAP
-
Function: FPDFBitmap_CreateEx
Create a device independent bitmap (FXDIB)
Parameters:
width - The number of pixels in width for the bitmap.
Must be greater than 0.
height - The number of pixels in height for the bitmap.
Must be greater than 0.
format - A number indicating for bitmap format, as defined
above.
first_scan - A pointer to the first byte of the first line if
using an external buffer. If this parameter is NULL,
then a new buffer will be created.
stride - Number of bytes for each scan line. The value must
be 0 or greater. When the value is 0,
FPDFBitmap_CreateEx() will automatically calculate
the appropriate value using |width| and |format|.
When using an external buffer, it is recommended for
the caller to pass in the value.
When not using an external buffer, it is recommended
for the caller to pass in 0.
Return value:
The bitmap handle, or NULL if parameter error or out of memory.
Comments:
Similar to FPDFBitmap_Create function, but allows for more formats
and an external buffer is supported. The bitmap created by this
function can be used in any place that a FPDF_BITMAP handle is
required.
-
FPDFBitmap_Destroy(FPDF_BITMAP bitmap)
→ void
-
Function: FPDFBitmap_Destroy
Destroy a bitmap and release all related buffers.
Parameters:
bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create
or FPDFImageObj_GetBitmap.
Return value:
None.
Comments:
This function will not destroy any external buffers provided when
the bitmap was created.
-
FPDFBitmap_FillRect(FPDF_BITMAP bitmap, int left, int top, int width, int height, int color)
→ int
-
Function: FPDFBitmap_FillRect
Fill a rectangle in a bitmap.
Parameters:
bitmap - The handle to the bitmap. Returned by
FPDFBitmap_Create.
left - The left position. Starting from 0 at the
left-most pixel.
top - The top position. Starting from 0 at the
top-most line.
width - Width in pixels to be filled.
height - Height in pixels to be filled.
color - A 32-bit value specifing the color, in 8888 ARGB
format.
Return value:
Returns whether the operation succeeded or not.
Comments:
This function sets the color and (optionally) alpha value in the
specified region of the bitmap.
-
FPDFBitmap_GetBuffer(FPDF_BITMAP bitmap)
→ Pointer<Void>
-
Function: FPDFBitmap_GetBuffer
Get data buffer of a bitmap.
Parameters:
bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create
or FPDFImageObj_GetBitmap.
Return value:
The pointer to the first byte of the bitmap buffer.
Comments:
The stride may be more than width * number of bytes per pixel
-
FPDFBitmap_GetFormat(FPDF_BITMAP bitmap)
→ int
-
Function: FPDFBitmap_GetFormat
Get the format of the bitmap.
Parameters:
bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create
or FPDFImageObj_GetBitmap.
Return value:
The format of the bitmap.
Comments:
Only formats supported by FPDFBitmap_CreateEx are supported by this
function; see the list of such formats above.
-
FPDFBitmap_GetHeight(FPDF_BITMAP bitmap)
→ int
-
Function: FPDFBitmap_GetHeight
Get height of a bitmap.
Parameters:
bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create
or FPDFImageObj_GetBitmap.
Return value:
The height of the bitmap in pixels.
-
FPDFBitmap_GetStride(FPDF_BITMAP bitmap)
→ int
-
Function: FPDFBitmap_GetStride
Get number of bytes for each line in the bitmap buffer.
Parameters:
bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create
or FPDFImageObj_GetBitmap.
Return value:
The number of bytes for each line in the bitmap buffer.
Comments:
The stride may be more than width * number of bytes per pixel.
-
FPDFBitmap_GetWidth(FPDF_BITMAP bitmap)
→ int
-
Function: FPDFBitmap_GetWidth
Get width of a bitmap.
Parameters:
bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create
or FPDFImageObj_GetBitmap.
Return value:
The width of the bitmap in pixels.
-
FPDFBookmark_Find(FPDF_DOCUMENT document, FPDF_WIDESTRING title)
→ FPDF_BOOKMARK
-
Find the bookmark with |title| in |document|.
-
FPDFBookmark_GetAction(FPDF_BOOKMARK bookmark)
→ FPDF_ACTION
-
Get the action associated with |bookmark|.
-
FPDFBookmark_GetCount(FPDF_BOOKMARK bookmark)
→ int
-
Experimental API.
Get the number of chlidren of |bookmark|.
-
FPDFBookmark_GetDest(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark)
→ FPDF_DEST
-
Get the destination associated with |bookmark|.
-
FPDFBookmark_GetFirstChild(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark)
→ FPDF_BOOKMARK
-
Get the first child of |bookmark|, or the first top-level bookmark item.
-
FPDFBookmark_GetNextSibling(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark)
→ FPDF_BOOKMARK
-
Get the next sibling of |bookmark|.
-
FPDFBookmark_GetTitle(FPDF_BOOKMARK bookmark, Pointer<Void> buffer, int buflen)
→ int
-
Get the title of |bookmark|.
-
FPDFCatalog_GetLanguage(FPDF_DOCUMENT document, Pointer<FPDF_WCHAR> buffer, int buflen)
→ int
-
Experimental API.
Gets the language of |document| from the catalog's /Lang entry.
-
FPDFCatalog_IsTagged(FPDF_DOCUMENT document)
→ int
-
Experimental API.
-
FPDFCatalog_SetLanguage(FPDF_DOCUMENT document, FPDF_WIDESTRING language)
→ int
-
Experimental API.
Sets the language of |document| to |language|.
-
FPDFClipPath_CountPaths(FPDF_CLIPPATH clip_path)
→ int
-
Experimental API.
Get number of paths inside |clip_path|.
-
FPDFClipPath_CountPathSegments(FPDF_CLIPPATH clip_path, int path_index)
→ int
-
Experimental API.
Get number of segments inside one path of |clip_path|.
-
FPDFClipPath_GetPathSegment(FPDF_CLIPPATH clip_path, int path_index, int segment_index)
→ FPDF_PATHSEGMENT
-
Experimental API.
Get segment in one specific path of |clip_path| at index.
-
FPDFDest_GetDestPageIndex(FPDF_DOCUMENT document, FPDF_DEST dest)
→ int
-
Get the page index of |dest|.
-
FPDFDest_GetLocationInPage(FPDF_DEST dest, Pointer<Int> hasXVal, Pointer<Int> hasYVal, Pointer<Int> hasZoomVal, Pointer<Float> x, Pointer<Float> y, Pointer<Float> zoom)
→ int
-
Get the (x, y, zoom) location of |dest| in the destination page, if the
destination is in
page /XYZ x y zoom syntax.
-
FPDFDest_GetView(FPDF_DEST dest, Pointer<UnsignedLong> pNumParams, Pointer<Float> pParams)
→ int
-
Experimental API.
Get the view (fit type) specified by |dest|.
-
FPDFDoc_AddAttachment(FPDF_DOCUMENT document, FPDF_WIDESTRING name)
→ FPDF_ATTACHMENT
-
Experimental API.
Add an embedded file with |name| in |document|. If |name| is empty, or if
|name| is the name of a existing embedded file in |document|, or if
|document|'s embedded file name tree is too deep (i.e. |document| has too
many embedded files already), then a new attachment will not be added.
-
FPDFDoc_CloseJavaScriptAction(FPDF_JAVASCRIPT_ACTION javascript)
→ void
-
javascript - Handle to a JavaScript action.
-
FPDFDoc_DeleteAttachment(FPDF_DOCUMENT document, int index)
→ int
-
Experimental API.
Delete the embedded attachment at |index| in |document|. Note that this does
not remove the attachment data from the PDF file; it simply removes the
file's entry in the embedded files name tree so that it does not appear in
the attachment list. This behavior may change in the future.
-
FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle)
→ void
-
Function: FPDFDOC_ExitFormFillEnvironment
Take ownership of |hHandle| and exit form fill environment.
Parameters:
hHandle - Handle to the form fill module, as returned by
FPDFDOC_InitFormFillEnvironment().
Return Value:
None.
Comments:
This function is a no-op when |hHandle| is null.
-
FPDFDoc_GetAttachment(FPDF_DOCUMENT document, int index)
→ FPDF_ATTACHMENT
-
Experimental API.
Get the embedded attachment at |index| in |document|. Note that the returned
attachment handle is only valid while |document| is open.
-
FPDFDoc_GetAttachmentCount(FPDF_DOCUMENT document)
→ int
-
Experimental API.
Get the number of embedded files in |document|.
-
FPDFDoc_GetJavaScriptAction(FPDF_DOCUMENT document, int index)
→ FPDF_JAVASCRIPT_ACTION
-
Experimental API.
Get the JavaScript action at |index| in |document|.
-
FPDFDoc_GetJavaScriptActionCount(FPDF_DOCUMENT document)
→ int
-
Experimental API.
Get the number of JavaScript actions in |document|.
-
FPDFDoc_GetPageMode(FPDF_DOCUMENT document)
→ int
-
Get the document's PageMode.
-
FPDFDOC_InitFormFillEnvironment(FPDF_DOCUMENT document, Pointer<FPDF_FORMFILLINFO> formInfo)
→ FPDF_FORMHANDLE
-
Function: FPDFDOC_InitFormFillEnvironment
Initialize form fill environment.
Parameters:
document - Handle to document from FPDF_LoadDocument().
formInfo - Pointer to a FPDF_FORMFILLINFO structure.
Return Value:
Handle to the form fill module, or NULL on failure.
Comments:
This function should be called before any form fill operation.
The FPDF_FORMFILLINFO passed in via |formInfo| must remain valid until
the returned FPDF_FORMHANDLE is closed.
-
FPDFFont_Close(FPDF_FONT font)
→ void
-
Close a loaded PDF font.
-
FPDFFont_GetAscent(FPDF_FONT font, double font_size, Pointer<Float> ascent)
→ int
-
Experimental API.
Get ascent distance of a font.
-
FPDFFont_GetBaseFontName(FPDF_FONT font, Pointer<Char> buffer, int length)
→ int
-
Experimental API.
Get the base name of a font.
-
FPDFFont_GetDescent(FPDF_FONT font, double font_size, Pointer<Float> descent)
→ int
-
Experimental API.
Get descent distance of a font.
-
FPDFFont_GetFamilyName(FPDF_FONT font, Pointer<Char> buffer, int length)
→ int
-
Experimental API.
Get the family name of a font.
-
FPDFFont_GetFlags(FPDF_FONT font)
→ int
-
Experimental API.
Get the descriptor flags of a font.
-
FPDFFont_GetFontData(FPDF_FONT font, Pointer<Uint8> buffer, int buflen, Pointer<Size> out_buflen)
→ int
-
Experimental API.
Get the decoded data from the |font| object.
-
FPDFFont_GetGlyphPath(FPDF_FONT font, int glyph, double font_size)
→ FPDF_GLYPHPATH
-
Experimental API.
Get the glyphpath describing how to draw a font glyph.
-
FPDFFont_GetGlyphWidth(FPDF_FONT font, int glyph, double font_size, Pointer<Float> width)
→ int
-
Experimental API.
Get the width of a glyph in a font.
-
FPDFFont_GetIsEmbedded(FPDF_FONT font)
→ int
-
Experimental API.
Get whether |font| is embedded or not.
-
FPDFFont_GetItalicAngle(FPDF_FONT font, Pointer<Int> angle)
→ int
-
Experimental API.
Get the italic angle of a font.
-
FPDFFont_GetWeight(FPDF_FONT font)
→ int
-
Experimental API.
Get the font weight of a font.
-
FPDFFormObj_CountObjects(FPDF_PAGEOBJECT form_object)
→ int
-
Get number of page objects inside |form_object|.
-
FPDFFormObj_GetObject(FPDF_PAGEOBJECT form_object, int index)
→ FPDF_PAGEOBJECT
-
Get page object in |form_object| at |index|.
-
FPDFFormObj_RemoveObject(FPDF_PAGEOBJECT form_object, FPDF_PAGEOBJECT page_object)
→ int
-
Experimental API.
-
FPDFGlyphPath_CountGlyphSegments(FPDF_GLYPHPATH glyphpath)
→ int
-
Experimental API.
Get number of segments inside glyphpath.
-
FPDFGlyphPath_GetGlyphPathSegment(FPDF_GLYPHPATH glyphpath, int index)
→ FPDF_PATHSEGMENT
-
Experimental API.
Get segment in glyphpath at index.
-
FPDFImageObj_GetBitmap(FPDF_PAGEOBJECT image_object)
→ FPDF_BITMAP
-
Get a bitmap rasterization of |image_object|. FPDFImageObj_GetBitmap() only
operates on |image_object| and does not take the associated image mask into
account. It also ignores the matrix for |image_object|.
The returned bitmap will be owned by the caller, and FPDFBitmap_Destroy()
must be called on the returned bitmap when it is no longer needed.
-
FPDFImageObj_GetIccProfileDataDecoded(FPDF_PAGEOBJECT image_object, FPDF_PAGE page, Pointer<Uint8> buffer, int buflen, Pointer<Size> out_buflen)
→ int
-
Experimental API.
Get ICC profile decoded data of |image_object|. If the |image_object| is not
an image object or if it does not have an image, then the return value will
be false. It also returns false if the |image_object| has no ICC profile.
|buffer| is only modified if ICC profile exists and |buflen| is longer than
the length of the ICC profile decoded data.
-
FPDFImageObj_GetImageDataDecoded(FPDF_PAGEOBJECT image_object, Pointer<Void> buffer, int buflen)
→ int
-
Get the decoded image data of |image_object|. The decoded data is the
uncompressed image data, i.e. the raw image data after having all filters
applied. |buffer| is only modified if |buflen| is longer than the length of
the decoded image data.
-
FPDFImageObj_GetImageDataRaw(FPDF_PAGEOBJECT image_object, Pointer<Void> buffer, int buflen)
→ int
-
Get the raw image data of |image_object|. The raw data is the image data as
stored in the PDF without applying any filters. |buffer| is only modified if
|buflen| is longer than the length of the raw image data.
-
FPDFImageObj_GetImageFilter(FPDF_PAGEOBJECT image_object, int index, Pointer<Void> buffer, int buflen)
→ int
-
Get the filter at |index| of |image_object|'s list of filters. Note that the
filters need to be applied in order, i.e. the first filter should be applied
first, then the second, etc. |buffer| is only modified if |buflen| is longer
than the length of the filter string.
-
FPDFImageObj_GetImageFilterCount(FPDF_PAGEOBJECT image_object)
→ int
-
Get the number of filters (i.e. decoders) of the image in |image_object|.
-
FPDFImageObj_GetImageMetadata(FPDF_PAGEOBJECT image_object, FPDF_PAGE page, Pointer<FPDF_IMAGEOBJ_METADATA> metadata)
→ int
-
Get the image metadata of |image_object|, including dimension, DPI, bits per
pixel, and colorspace. If the |image_object| is not an image object or if it
does not have an image, then the return value will be false. Otherwise,
failure to retrieve any specific parameter would result in its value being 0.
-
FPDFImageObj_GetImagePixelSize(FPDF_PAGEOBJECT image_object, Pointer<UnsignedInt> width, Pointer<UnsignedInt> height)
→ int
-
Experimental API.
Get the image size in pixels. Faster method to get only image size.
-
FPDFImageObj_GetRenderedBitmap(FPDF_DOCUMENT document, FPDF_PAGE page, FPDF_PAGEOBJECT image_object)
→ FPDF_BITMAP
-
Experimental API.
Get a bitmap rasterization of |image_object| that takes the image mask and
image matrix into account. To render correctly, the caller must provide the
|document| associated with |image_object|. If there is a |page| associated
with |image_object|, the caller should provide that as well.
The returned bitmap will be owned by the caller, and FPDFBitmap_Destroy()
must be called on the returned bitmap when it is no longer needed.
-
FPDFImageObj_LoadJpegFile(Pointer<FPDF_PAGE> pages, int count, FPDF_PAGEOBJECT image_object, Pointer<FPDF_FILEACCESS> file_access)
→ int
-
Load an image from a JPEG image file and then set it into |image_object|.
-
FPDFImageObj_LoadJpegFileInline(Pointer<FPDF_PAGE> pages, int count, FPDF_PAGEOBJECT image_object, Pointer<FPDF_FILEACCESS> file_access)
→ int
-
Load an image from a JPEG image file and then set it into |image_object|.
-
FPDFImageObj_SetBitmap(Pointer<FPDF_PAGE> pages, int count, FPDF_PAGEOBJECT image_object, FPDF_BITMAP bitmap)
→ int
-
Set |bitmap| to |image_object|.
-
FPDFImageObj_SetMatrix(FPDF_PAGEOBJECT image_object, double a, double b, double c, double d, double e, double f)
→ int
-
Set the transform matrix of |image_object|.
-
FPDFJavaScriptAction_GetName(FPDF_JAVASCRIPT_ACTION javascript, Pointer<FPDF_WCHAR> buffer, int buflen)
→ int
-
Experimental API.
Get the name from the |javascript| handle. |buffer| is only modified if
|buflen| is longer than the length of the name. On errors, |buffer| is
unmodified and the returned length is 0.
-
FPDFJavaScriptAction_GetScript(FPDF_JAVASCRIPT_ACTION javascript, Pointer<FPDF_WCHAR> buffer, int buflen)
→ int
-
Experimental API.
Get the script from the |javascript| handle. |buffer| is only modified if
|buflen| is longer than the length of the script. On errors, |buffer| is
unmodified and the returned length is 0.
-
FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page)
→ void
-
Function: FPDFLink_CloseWebLinks
Release resources used by weblink feature.
Parameters:
link_page - Handle returned by FPDFLink_LoadWebLinks.
Return Value:
None.
-
FPDFLink_CountQuadPoints(FPDF_LINK link_annot)
→ int
-
Get the count of quadrilateral points to the |link_annot|.
-
FPDFLink_CountRects(FPDF_PAGELINK link_page, int link_index)
→ int
-
Function: FPDFLink_CountRects
Count number of rectangular areas for the link.
Parameters:
link_page - Handle returned by FPDFLink_LoadWebLinks.
link_index - Zero-based index for the link.
Return Value:
Number of rectangular areas for the link. If |link_index| does
not correspond to a valid link, then 0 is returned.
-
FPDFLink_CountWebLinks(FPDF_PAGELINK link_page)
→ int
-
Function: FPDFLink_CountWebLinks
Count number of detected web links.
Parameters:
link_page - Handle returned by FPDFLink_LoadWebLinks.
Return Value:
Number of detected web links.
-
FPDFLink_Enumerate(FPDF_PAGE page, Pointer<Int> start_pos, Pointer<FPDF_LINK> link_annot)
→ int
-
Enumerates all the link annotations in |page|.
-
FPDFLink_GetAction(FPDF_LINK link)
→ FPDF_ACTION
-
Get action info for |link|.
-
FPDFLink_GetAnnot(FPDF_PAGE page, FPDF_LINK link_annot)
→ FPDF_ANNOTATION
-
Experimental API.
Gets FPDF_ANNOTATION object for |link_annot|.
-
FPDFLink_GetAnnotRect(FPDF_LINK link_annot, Pointer<FS_RECTF> rect)
→ int
-
Get the rectangle for |link_annot|.
-
FPDFLink_GetDest(FPDF_DOCUMENT document, FPDF_LINK link)
→ FPDF_DEST
-
Get destination info for |link|.
-
FPDFLink_GetLinkAtPoint(FPDF_PAGE page, double x, double y)
→ FPDF_LINK
-
Find a link at point (|x|,|y|) on |page|.
-
FPDFLink_GetLinkZOrderAtPoint(FPDF_PAGE page, double x, double y)
→ int
-
Find the Z-order of link at point (|x|,|y|) on |page|.
-
FPDFLink_GetQuadPoints(FPDF_LINK link_annot, int quad_index, Pointer<FS_QUADPOINTSF> quad_points)
→ int
-
Get the quadrilateral points for the specified |quad_index| in |link_annot|.
-
FPDFLink_GetRect(FPDF_PAGELINK link_page, int link_index, int rect_index, Pointer<Double> left, Pointer<Double> top, Pointer<Double> right, Pointer<Double> bottom)
→ int
-
Function: FPDFLink_GetRect
Fetch the boundaries of a rectangle for a link.
Parameters:
link_page - Handle returned by FPDFLink_LoadWebLinks.
link_index - Zero-based index for the link.
rect_index - Zero-based index for a rectangle.
left - Pointer to a double value receiving the rectangle
left boundary.
top - Pointer to a double value receiving the rectangle
top boundary.
right - Pointer to a double value receiving the rectangle
right boundary.
bottom - Pointer to a double value receiving the rectangle
bottom boundary.
Return Value:
On success, return TRUE and fill in |left|, |top|, |right|, and
|bottom|. If |link_page| is invalid or if |link_index| does not
correspond to a valid link, then return FALSE, and the out
parameters remain unmodified.
-
Experimental API.
Function: FPDFLink_GetTextRange
Fetch the start char index and char count for a link.
Parameters:
link_page - Handle returned by FPDFLink_LoadWebLinks.
link_index - Zero-based index for the link.
start_char_index - pointer to int receiving the start char index
char_count - pointer to int receiving the char count
Return Value:
On success, return TRUE and fill in |start_char_index| and
|char_count|. if |link_page| is invalid or if |link_index| does
not correspond to a valid link, then return FALSE and the out
parameters remain unmodified.
-
FPDFLink_GetURL(FPDF_PAGELINK link_page, int link_index, Pointer<FPDF_WCHAR> buffer, int buflen)
→ int
-
Function: FPDFLink_GetURL
Fetch the URL information for a detected web link.
Parameters:
link_page - Handle returned by FPDFLink_LoadWebLinks.
link_index - Zero-based index for the link.
buffer - A unicode buffer for the result.
buflen - Number of 16-bit code units (not bytes) for the
buffer, including an additional terminator.
Return Value:
If |buffer| is NULL or |buflen| is zero, return the number of 16-bit
code units (not bytes) needed to buffer the result (an additional
terminator is included in this count).
Otherwise, copy the result into |buffer|, truncating at |buflen| if
the result is too large to fit, and return the number of 16-bit code
units actually copied into the buffer (the additional terminator is
also included in this count).
If |link_index| does not correspond to a valid link, then the result
is an empty string.
-
FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page)
→ FPDF_PAGELINK
-
Function: FPDFLink_LoadWebLinks
Prepare information about weblinks in a page.
Parameters:
text_page - Handle to a text page information structure.
Returned by FPDFText_LoadPage function.
Return Value:
A handle to the page's links information structure, or
NULL if something goes wrong.
Comments:
Weblinks are those links implicitly embedded in PDF pages. PDF also
has a type of annotation called "link" (FPDFTEXT doesn't deal with
that kind of link). FPDFTEXT weblink feature is useful for
automatically detecting links in the page contents. For example,
things like "https://www.example.com" will be detected, so
applications can allow user to click on those characters to activate
the link, even the PDF doesn't come with link annotations.
-
FPDFPage_CloseAnnot(FPDF_ANNOTATION annot)
→ void
-
Experimental API.
Close an annotation. Must be called when the annotation returned by
FPDFPage_CreateAnnot() or FPDFPage_GetAnnot() is no longer needed. This
function does not remove the annotation from the document.
-
FPDFPage_CountObjects(FPDF_PAGE page)
→ int
-
Get number of page objects inside |page|.
-
FPDFPage_CreateAnnot(FPDF_PAGE page, int subtype)
→ FPDF_ANNOTATION
-
Experimental API.
Create an annotation in |page| of the subtype |subtype|. If the specified
subtype is illegal or unsupported, then a new annotation will not be created.
Must call FPDFPage_CloseAnnot() when the annotation returned by this
function is no longer needed.
-
FPDFPage_Delete(FPDF_DOCUMENT document, int page_index)
→ void
-
Delete the page at |page_index|.
-
FPDFPage_Flatten(FPDF_PAGE page, int nFlag)
→ int
-
Flatten annotations and form fields into the page contents.
-
FPDFPage_FormFieldZOrderAtPoint(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, double page_x, double page_y)
→ int
-
Function: FPDFPage_FormFieldZOrderAtPoint
Get the form field z-order by point.
Parameters:
hHandle - Handle to the form fill module. Returned by
FPDFDOC_InitFormFillEnvironment().
page - Handle to the page. Returned by FPDF_LoadPage().
page_x - X position in PDF "user space".
page_y - Y position in PDF "user space".
Return Value:
Return the z-order of the form field; -1 indicates no field.
Higher numbers are closer to the front.
-
FPDFPage_GenerateContent(FPDF_PAGE page)
→ int
-
Generate the content of |page|.
-
FPDFPage_GetAnnot(FPDF_PAGE page, int index)
→ FPDF_ANNOTATION
-
Experimental API.
Get annotation in |page| at |index|. Must call FPDFPage_CloseAnnot() when the
annotation returned by this function is no longer needed.
-
FPDFPage_GetAnnotCount(FPDF_PAGE page)
→ int
-
Experimental API.
Get the number of annotations in |page|.
-
FPDFPage_GetAnnotIndex(FPDF_PAGE page, FPDF_ANNOTATION annot)
→ int
-
Experimental API.
Get the index of |annot| in |page|. This is the opposite of
FPDFPage_GetAnnot().
-
FPDFPage_GetArtBox(FPDF_PAGE page, Pointer<Float> left, Pointer<Float> bottom, Pointer<Float> right, Pointer<Float> top)
→ int
-
Get "ArtBox" entry from the page dictionary.
-
FPDFPage_GetBleedBox(FPDF_PAGE page, Pointer<Float> left, Pointer<Float> bottom, Pointer<Float> right, Pointer<Float> top)
→ int
-
Get "BleedBox" entry from the page dictionary.
-
FPDFPage_GetCropBox(FPDF_PAGE page, Pointer<Float> left, Pointer<Float> bottom, Pointer<Float> right, Pointer<Float> top)
→ int
-
Get "CropBox" entry from the page dictionary.
-
FPDFPage_GetDecodedThumbnailData(FPDF_PAGE page, Pointer<Void> buffer, int buflen)
→ int
-
Experimental API.
Gets the decoded data from the thumbnail of |page| if it exists.
This only modifies |buffer| if |buflen| less than or equal to the
size of the decoded data. Returns the size of the decoded
data or 0 if thumbnail DNE. Optional, pass null to just retrieve
the size of the buffer needed.
-
FPDFPage_GetMediaBox(FPDF_PAGE page, Pointer<Float> left, Pointer<Float> bottom, Pointer<Float> right, Pointer<Float> top)
→ int
-
Get "MediaBox" entry from the page dictionary.
-
FPDFPage_GetObject(FPDF_PAGE page, int index)
→ FPDF_PAGEOBJECT
-
Get object in |page| at |index|.
-
FPDFPage_GetRawThumbnailData(FPDF_PAGE page, Pointer<Void> buffer, int buflen)
→ int
-
Experimental API.
Gets the raw data from the thumbnail of |page| if it exists.
This only modifies |buffer| if |buflen| is less than or equal to
the size of the raw data. Returns the size of the raw data or 0
if thumbnail DNE. Optional, pass null to just retrieve the size
of the buffer needed.
-
FPDFPage_GetRotation(FPDF_PAGE page)
→ int
-
Get the rotation of |page|.
-
FPDFPage_GetThumbnailAsBitmap(FPDF_PAGE page)
→ FPDF_BITMAP
-
Experimental API.
Returns the thumbnail of |page| as a FPDF_BITMAP. Returns a nullptr
if unable to access the thumbnail's stream.
-
FPDFPage_GetTrimBox(FPDF_PAGE page, Pointer<Float> left, Pointer<Float> bottom, Pointer<Float> right, Pointer<Float> top)
→ int
-
Get "TrimBox" entry from the page dictionary.
-
FPDFPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, double page_x, double page_y)
→ int
-
Function: FPDFPage_HasFormFieldAtPoint
Get the form field type by point.
Parameters:
hHandle - Handle to the form fill module. Returned by
FPDFDOC_InitFormFillEnvironment().
page - Handle to the page. Returned by FPDF_LoadPage().
page_x - X position in PDF "user space".
page_y - Y position in PDF "user space".
Return Value:
Return the type of the form field; -1 indicates no field.
See field types above.
-
FPDFPage_HasTransparency(FPDF_PAGE page)
→ int
-
Checks if |page| contains transparency.
-
FPDFPage_InsertClipPath(FPDF_PAGE page, FPDF_CLIPPATH clipPath)
→ void
-
Clip the page content, the page content that outside the clipping region
become invisible.
-
FPDFPage_InsertObject(FPDF_PAGE page, FPDF_PAGEOBJECT page_object)
→ int
-
Insert |page_object| into |page|.
-
FPDFPage_InsertObjectAtIndex(FPDF_PAGE page, FPDF_PAGEOBJECT page_object, int index)
→ int
-
Insert |page_object| into |page| at the specified |index|.
-
FPDFPage_New(FPDF_DOCUMENT document, int page_index, double width, double height)
→ FPDF_PAGE
-
Create a new PDF page.
-
FPDFPage_RemoveAnnot(FPDF_PAGE page, int index)
→ int
-
Experimental API.
Remove the annotation in |page| at |index|.
-
FPDFPage_RemoveObject(FPDF_PAGE page, FPDF_PAGEOBJECT page_object)
→ int
-
Experimental API.
Remove |page_object| from |page|.
-
FPDFPage_SetArtBox(FPDF_PAGE page, double left, double bottom, double right, double top)
→ void
-
Set "ArtBox" entry to the page dictionary.
-
FPDFPage_SetBleedBox(FPDF_PAGE page, double left, double bottom, double right, double top)
→ void
-
Set "BleedBox" entry to the page dictionary.
-
FPDFPage_SetCropBox(FPDF_PAGE page, double left, double bottom, double right, double top)
→ void
-
Set "CropBox" entry to the page dictionary.
-
FPDFPage_SetMediaBox(FPDF_PAGE page, double left, double bottom, double right, double top)
→ void
-
Set "MediaBox" entry to the page dictionary.
-
FPDFPage_SetRotation(FPDF_PAGE page, int rotate)
→ void
-
Set rotation for |page|.
-
FPDFPage_SetTrimBox(FPDF_PAGE page, double left, double bottom, double right, double top)
→ void
-
Set "TrimBox" entry to the page dictionary.
-
FPDFPage_TransformAnnots(FPDF_PAGE page, double a, double b, double c, double d, double e, double f)
→ void
-
Transform all annotations in |page|.
-
FPDFPage_TransFormWithClip(FPDF_PAGE page, Pointer<FS_MATRIX> matrix, Pointer<FS_RECTF> clipRect)
→ int
-
Apply transforms to |page|.
-
FPDFPageObj_AddExistingMark(FPDF_PAGEOBJECT page_object, FPDF_PAGEOBJECTMARK mark)
→ int
-
Experimental API.
Add an existing content mark to a |page_object|. If consecutive page objects
have the same |mark|, the generated PDF will contain a single mark that spans
all of them. If the page objects are not consecutive, multiple copies of the
|mark| are inserted in the PDF.
-
FPDFPageObj_AddMark(FPDF_PAGEOBJECT page_object, FPDF_BYTESTRING name)
→ FPDF_PAGEOBJECTMARK
-
Experimental API.
Add a new content mark to a |page_object|.
-
FPDFPageObj_CountMarks(FPDF_PAGEOBJECT page_object)
→ int
-
Experimental API.
Get number of content marks in |page_object|.
-
FPDFPageObj_CreateNewPath(double x, double y)
→ FPDF_PAGEOBJECT
-
Create a new path object at an initial position.
-
FPDFPageObj_CreateNewRect(double x, double y, double w, double h)
→ FPDF_PAGEOBJECT
-
Create a closed path consisting of a rectangle.
-
FPDFPageObj_CreateTextObj(FPDF_DOCUMENT document, FPDF_FONT font, double font_size)
→ FPDF_PAGEOBJECT
-
Create a new text object using a loaded font.
-
FPDFPageObj_Destroy(FPDF_PAGEOBJECT page_object)
→ void
-
Destroy |page_object| by releasing its resources. |page_object| must have
been created by FPDFPageObj_CreateNew{Path|Rect}() or
FPDFPageObj_New{Text|Image}Obj(). This function must be called on
newly-created objects if they are not added to a page through
FPDFPage_InsertObject() or to an annotation through FPDFAnnot_AppendObject().
-
FPDFPageObj_GetBounds(FPDF_PAGEOBJECT page_object, Pointer<Float> left, Pointer<Float> bottom, Pointer<Float> right, Pointer<Float> top)
→ int
-
Get the bounding box of |page_object|.
-
FPDFPageObj_GetClipPath(FPDF_PAGEOBJECT page_object)
→ FPDF_CLIPPATH
-
Experimental API.
Get the clip path of the page object.
-
FPDFPageObj_GetDashArray(FPDF_PAGEOBJECT page_object, Pointer<Float> dash_array, int dash_count)
→ int
-
Experimental API.
Get the line dash array of |page_object|.
-
FPDFPageObj_GetDashCount(FPDF_PAGEOBJECT page_object)
→ int
-
Experimental API.
Get the line dash array of |page_object|.
-
FPDFPageObj_GetDashPhase(FPDF_PAGEOBJECT page_object, Pointer<Float> phase)
→ int
-
Experimental API.
Get the line dash |phase| of |page_object|.
-
FPDFPageObj_GetFillColor(FPDF_PAGEOBJECT page_object, Pointer<UnsignedInt> R, Pointer<UnsignedInt> G, Pointer<UnsignedInt> B, Pointer<UnsignedInt> A)
→ int
-
Get the fill RGBA of a page object. Range of values: 0 - 255.
-
FPDFPageObj_GetIsActive(FPDF_PAGEOBJECT page_object, Pointer<Int> active)
→ int
-
Experimental API.
Gets active state for |page_object| within page.
-
FPDFPageObj_GetLineCap(FPDF_PAGEOBJECT page_object)
→ int
-
Get the line cap of |page_object|.
-
FPDFPageObj_GetLineJoin(FPDF_PAGEOBJECT page_object)
→ int
-
Get the line join of |page_object|.
-
FPDFPageObj_GetMark(FPDF_PAGEOBJECT page_object, int index)
→ FPDF_PAGEOBJECTMARK
-
Experimental API.
Get content mark in |page_object| at |index|.
-
FPDFPageObj_GetMarkedContentID(FPDF_PAGEOBJECT page_object)
→ int
-
Experimental API.
Get the marked content ID for the object.
-
FPDFPageObj_GetMatrix(FPDF_PAGEOBJECT page_object, Pointer<FS_MATRIX> matrix)
→ int
-
Experimental API.
Get the transform matrix of a page object.
-
FPDFPageObj_GetRotatedBounds(FPDF_PAGEOBJECT page_object, Pointer<FS_QUADPOINTSF> quad_points)
→ int
-
Experimental API.
Get the quad points that bounds |page_object|.
-
FPDFPageObj_GetStrokeColor(FPDF_PAGEOBJECT page_object, Pointer<UnsignedInt> R, Pointer<UnsignedInt> G, Pointer<UnsignedInt> B, Pointer<UnsignedInt> A)
→ int
-
Get the stroke RGBA of a page object. Range of values: 0 - 255.
-
FPDFPageObj_GetStrokeWidth(FPDF_PAGEOBJECT page_object, Pointer<Float> width)
→ int
-
Get the stroke width of a page object.
-
FPDFPageObj_GetType(FPDF_PAGEOBJECT page_object)
→ int
-
Get type of |page_object|.
-
FPDFPageObj_HasTransparency(FPDF_PAGEOBJECT page_object)
→ int
-
Checks if |page_object| contains transparency.
-
FPDFPageObj_NewImageObj(FPDF_DOCUMENT document)
→ FPDF_PAGEOBJECT
-
Create a new image object.
-
FPDFPageObj_NewTextObj(FPDF_DOCUMENT document, FPDF_BYTESTRING font, double font_size)
→ FPDF_PAGEOBJECT
-
Create a new text object using one of the standard PDF fonts.
-
FPDFPageObj_RemoveMark(FPDF_PAGEOBJECT page_object, FPDF_PAGEOBJECTMARK mark)
→ int
-
Experimental API.
Removes a content |mark| from a |page_object|.
The mark handle will be invalid after the removal.
-
FPDFPageObj_SetBlendMode(FPDF_PAGEOBJECT page_object, FPDF_BYTESTRING blend_mode)
→ void
-
Set the blend mode of |page_object|.
-
FPDFPageObj_SetDashArray(FPDF_PAGEOBJECT page_object, Pointer<Float> dash_array, int dash_count, double phase)
→ int
-
Experimental API.
Set the line dash array of |page_object|.
-
FPDFPageObj_SetDashPhase(FPDF_PAGEOBJECT page_object, double phase)
→ int
-
Experimental API.
Set the line dash phase of |page_object|.
-
FPDFPageObj_SetFillColor(FPDF_PAGEOBJECT page_object, int R, int G, int B, int A)
→ int
-
Set the fill RGBA of a page object. Range of values: 0 - 255.
-
FPDFPageObj_SetIsActive(FPDF_PAGEOBJECT page_object, int active)
→ int
-
Experimental API.
Sets if |page_object| is active within page.
-
FPDFPageObj_SetLineCap(FPDF_PAGEOBJECT page_object, int line_cap)
→ int
-
Set the line cap of |page_object|.
-
FPDFPageObj_SetLineJoin(FPDF_PAGEOBJECT page_object, int line_join)
→ int
-
Set the line join of |page_object|.
-
FPDFPageObj_SetMatrix(FPDF_PAGEOBJECT page_object, Pointer<FS_MATRIX> matrix)
→ int
-
Experimental API.
Set the transform matrix of a page object.
-
FPDFPageObj_SetStrokeColor(FPDF_PAGEOBJECT page_object, int R, int G, int B, int A)
→ int
-
Set the stroke RGBA of a page object. Range of values: 0 - 255.
-
FPDFPageObj_SetStrokeWidth(FPDF_PAGEOBJECT page_object, double width)
→ int
-
Set the stroke width of a page object.
-
FPDFPageObj_Transform(FPDF_PAGEOBJECT page_object, double a, double b, double c, double d, double e, double f)
→ void
-
Transform |page_object| by the given matrix.
-
FPDFPageObj_TransformClipPath(FPDF_PAGEOBJECT page_object, double a, double b, double c, double d, double e, double f)
→ void
-
Transform (scale, rotate, shear, move) the clip path of page object.
page_object - Handle to a page object. Returned by
FPDFPageObj_NewImageObj().
-
FPDFPageObj_TransformF(FPDF_PAGEOBJECT page_object, Pointer<FS_MATRIX> matrix)
→ int
-
Experimental API.
Transform |page_object| by the given matrix.
-
FPDFPageObjMark_CountParams(FPDF_PAGEOBJECTMARK mark)
→ int
-
Experimental API.
Get the number of key/value pair parameters in |mark|.
-
FPDFPageObjMark_GetName(FPDF_PAGEOBJECTMARK mark, Pointer<FPDF_WCHAR> buffer, int buflen, Pointer<UnsignedLong> out_buflen)
→ int
-
Experimental API.
Get the name of a content mark.
-
FPDFPageObjMark_GetParamBlobValue(FPDF_PAGEOBJECTMARK mark, FPDF_BYTESTRING key, Pointer<UnsignedChar> buffer, int buflen, Pointer<UnsignedLong> out_buflen)
→ int
-
Experimental API.
Get the value of a blob property in a content mark by key.
-
FPDFPageObjMark_GetParamFloatValue(FPDF_PAGEOBJECTMARK mark, FPDF_BYTESTRING key, Pointer<Float> out_value)
→ int
-
Experimental API.
Get the value of a number property in a content mark by key as float.
FPDFPageObjMark_GetParamValueType() should have returned FPDF_OBJECT_NUMBER
for this property.
-
FPDFPageObjMark_GetParamIntValue(FPDF_PAGEOBJECTMARK mark, FPDF_BYTESTRING key, Pointer<Int> out_value)
→ int
-
Experimental API.
Get the value of a number property in a content mark by key as int.
FPDFPageObjMark_GetParamValueType() should have returned FPDF_OBJECT_NUMBER
for this property.
-
FPDFPageObjMark_GetParamKey(FPDF_PAGEOBJECTMARK mark, int index, Pointer<FPDF_WCHAR> buffer, int buflen, Pointer<UnsignedLong> out_buflen)
→ int
-
Experimental API.
Get the key of a property in a content mark.
-
FPDFPageObjMark_GetParamStringValue(FPDF_PAGEOBJECTMARK mark, FPDF_BYTESTRING key, Pointer<FPDF_WCHAR> buffer, int buflen, Pointer<UnsignedLong> out_buflen)
→ int
-
Experimental API.
Get the value of a string property in a content mark by key.
-
FPDFPageObjMark_GetParamValueType(FPDF_PAGEOBJECTMARK mark, FPDF_BYTESTRING key)
→ int
-
Experimental API.
Get the type of the value of a property in a content mark by key.
-
FPDFPageObjMark_RemoveParam(FPDF_PAGEOBJECT page_object, FPDF_PAGEOBJECTMARK mark, FPDF_BYTESTRING key)
→ int
-
Experimental API.
Removes a property from a content mark by key.
-
FPDFPageObjMark_SetBlobParam(FPDF_DOCUMENT document, FPDF_PAGEOBJECT page_object, FPDF_PAGEOBJECTMARK mark, FPDF_BYTESTRING key, Pointer<UnsignedChar> value, int value_len)
→ int
-
Experimental API.
Set the value of a blob property in a content mark by key. If a parameter
with key |key| exists, its value is set to |value|. Otherwise, it is added as
a new parameter.
-
FPDFPageObjMark_SetFloatParam(FPDF_DOCUMENT document, FPDF_PAGEOBJECT page_object, FPDF_PAGEOBJECTMARK mark, FPDF_BYTESTRING key, double value)
→ int
-
Experimental API.
Set the value of a float property in a content mark by key. If a parameter
with key |key| exists, its value is set to |value|. Otherwise, it is added as
a new parameter.
-
FPDFPageObjMark_SetIntParam(FPDF_DOCUMENT document, FPDF_PAGEOBJECT page_object, FPDF_PAGEOBJECTMARK mark, FPDF_BYTESTRING key, int value)
→ int
-
Experimental API.
Set the value of an int property in a content mark by key. If a parameter
with key |key| exists, its value is set to |value|. Otherwise, it is added as
a new parameter.
-
FPDFPageObjMark_SetStringParam(FPDF_DOCUMENT document, FPDF_PAGEOBJECT page_object, FPDF_PAGEOBJECTMARK mark, FPDF_BYTESTRING key, FPDF_BYTESTRING value)
→ int
-
Experimental API.
Set the value of a string property in a content mark by key. If a parameter
with key |key| exists, its value is set to |value|. Otherwise, it is added as
a new parameter.
-
FPDFPath_BezierTo(FPDF_PAGEOBJECT path, double x1, double y1, double x2, double y2, double x3, double y3)
→ int
-
Add a cubic Bezier curve to the given path, starting at the current point.
-
FPDFPath_Close(FPDF_PAGEOBJECT path)
→ int
-
Close the current subpath of a given path.
-
FPDFPath_CountSegments(FPDF_PAGEOBJECT path)
→ int
-
Get number of segments inside |path|.
-
FPDFPath_GetDrawMode(FPDF_PAGEOBJECT path, Pointer<Int> fillmode, Pointer<Int> stroke)
→ int
-
Get the drawing mode of a path.
-
FPDFPath_GetPathSegment(FPDF_PAGEOBJECT path, int index)
→ FPDF_PATHSEGMENT
-
Get segment in |path| at |index|.
-
FPDFPath_LineTo(FPDF_PAGEOBJECT path, double x, double y)
→ int
-
Add a line between the current point and a new point in the path.
-
FPDFPath_MoveTo(FPDF_PAGEOBJECT path, double x, double y)
→ int
-
Move a path's current point.
-
FPDFPath_SetDrawMode(FPDF_PAGEOBJECT path, int fillmode, int stroke)
→ int
-
Set the drawing mode of a path.
-
FPDFPathSegment_GetClose(FPDF_PATHSEGMENT segment)
→ int
-
Gets if the |segment| closes the current subpath of a given path.
-
FPDFPathSegment_GetPoint(FPDF_PATHSEGMENT segment, Pointer<Float> x, Pointer<Float> y)
→ int
-
Get coordinates of |segment|.
-
FPDFPathSegment_GetType(FPDF_PATHSEGMENT segment)
→ int
-
Get type of |segment|.
-
FPDFSignatureObj_GetByteRange(FPDF_SIGNATURE signature, Pointer<Int> buffer, int length)
→ int
-
Experimental API.
Function: FPDFSignatureObj_GetByteRange
Get the byte range of a signature object.
Parameters:
signature - Handle to the signature object. Returned by
FPDF_GetSignatureObject().
buffer - The address of a buffer that receives the
byte range.
length - The size, in ints, of |buffer|.
Return value:
Returns the number of ints in the byte range on
success, 0 on error.
-
FPDFSignatureObj_GetContents(FPDF_SIGNATURE signature, Pointer<Void> buffer, int length)
→ int
-
Experimental API.
Function: FPDFSignatureObj_GetContents
Get the contents of a signature object.
Parameters:
signature - Handle to the signature object. Returned by
FPDF_GetSignatureObject().
buffer - The address of a buffer that receives the contents.
length - The size, in bytes, of |buffer|.
Return value:
Returns the number of bytes in the contents on success, 0 on error.
-
FPDFSignatureObj_GetDocMDPPermission(FPDF_SIGNATURE signature)
→ int
-
Experimental API.
Function: FPDFSignatureObj_GetDocMDPPermission
Get the DocMDP permission of a signature object.
Parameters:
signature - Handle to the signature object. Returned by
FPDF_GetSignatureObject().
Return value:
Returns the permission (1, 2 or 3) on success, 0 on error.
-
FPDFSignatureObj_GetReason(FPDF_SIGNATURE signature, Pointer<Void> buffer, int length)
→ int
-
Experimental API.
Function: FPDFSignatureObj_GetReason
Get the reason (comment) of the signature object.
Parameters:
signature - Handle to the signature object. Returned by
FPDF_GetSignatureObject().
buffer - The address of a buffer that receives the reason.
length - The size, in bytes, of |buffer|.
Return value:
Returns the number of bytes in the reason on success, 0 on error.
-
FPDFSignatureObj_GetSubFilter(FPDF_SIGNATURE signature, Pointer<Char> buffer, int length)
→ int
-
Experimental API.
Function: FPDFSignatureObj_GetSubFilter
Get the encoding of the value of a signature object.
Parameters:
signature - Handle to the signature object. Returned by
FPDF_GetSignatureObject().
buffer - The address of a buffer that receives the encoding.
length - The size, in bytes, of |buffer|.
Return value:
Returns the number of bytes in the encoding name (including the
trailing NUL character) on success, 0 on error.
-
FPDFSignatureObj_GetTime(FPDF_SIGNATURE signature, Pointer<Char> buffer, int length)
→ int
-
Experimental API.
Function: FPDFSignatureObj_GetTime
Get the time of signing of a signature object.
Parameters:
signature - Handle to the signature object. Returned by
FPDF_GetSignatureObject().
buffer - The address of a buffer that receives the time.
length - The size, in bytes, of |buffer|.
Return value:
Returns the number of bytes in the encoding name (including the
trailing NUL character) on success, 0 on error.
-
FPDFText_ClosePage(FPDF_TEXTPAGE text_page)
→ void
-
Function: FPDFText_ClosePage
Release all resources allocated for a text page information
structure.
Parameters:
text_page - Handle to a text page information structure.
Returned by FPDFText_LoadPage function.
Return Value:
None.
-
FPDFText_CountChars(FPDF_TEXTPAGE text_page)
→ int
-
Function: FPDFText_CountChars
Get number of characters in a page.
Parameters:
text_page - Handle to a text page information structure.
Returned by FPDFText_LoadPage function.
Return value:
Number of characters in the page. Return -1 for error.
Generated characters, like additional space characters, new line
characters, are also counted.
Comments:
Characters in a page form a "stream", inside the stream, each
character has an index.
We will use the index parameters in many of FPDFTEXT functions. The
first character in the page
has an index value of zero.
-
FPDFText_CountRects(FPDF_TEXTPAGE text_page, int start_index, int count)
→ int
-
Function: FPDFText_CountRects
Counts number of rectangular areas occupied by a segment of text,
and caches the result for subsequent FPDFText_GetRect() calls.
Parameters:
text_page - Handle to a text page information structure.
Returned by FPDFText_LoadPage function.
start_index - Index for the start character.
count - Number of characters, or -1 for all remaining.
Return value:
Number of rectangles, 0 if text_page is null, or -1 on bad
start_index.
Comments:
This function, along with FPDFText_GetRect can be used by
applications to detect the position on the page for a text segment,
so proper areas can be highlighted. The FPDFText_* functions will
automatically merge small character boxes into bigger one if those
characters are on the same line and use same font settings.
-
FPDFText_FindClose(FPDF_SCHHANDLE handle)
→ void
-
Function: FPDFText_FindClose
Release a search context.
Parameters:
handle - A search context handle returned by
FPDFText_FindStart.
Return Value:
None.
-
FPDFText_FindNext(FPDF_SCHHANDLE handle)
→ int
-
Function: FPDFText_FindNext
Search in the direction from page start to end.
Parameters:
handle - A search context handle returned by
FPDFText_FindStart.
Return Value:
Whether a match is found.
-
FPDFText_FindPrev(FPDF_SCHHANDLE handle)
→ int
-
Function: FPDFText_FindPrev
Search in the direction from page end to start.
Parameters:
handle - A search context handle returned by
FPDFText_FindStart.
Return Value:
Whether a match is found.
-
FPDFText_FindStart(FPDF_TEXTPAGE text_page, FPDF_WIDESTRING findwhat, int flags, int start_index)
→ FPDF_SCHHANDLE
-
Function: FPDFText_FindStart
Start a search.
Parameters:
text_page - Handle to a text page information structure.
Returned by FPDFText_LoadPage function.
findwhat - A unicode match pattern.
flags - Option flags.
start_index - Start from this character. -1 for end of the page.
Return Value:
A handle for the search context. FPDFText_FindClose must be called
to release this handle.
-
FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page, double left, double top, double right, double bottom, Pointer<FPDF_WCHAR> buffer, int buflen)
→ int
-
Function: FPDFText_GetBoundedText
Extract unicode text within a rectangular boundary on the page.
Parameters:
text_page - Handle to a text page information structure.
Returned by FPDFText_LoadPage function.
left - Left boundary.
top - Top boundary.
right - Right boundary.
bottom - Bottom boundary.
buffer - Caller-allocated buffer to receive UTF-16 values.
buflen - Number of UTF-16 values (not bytes) that
buffer
is capable of holding.
Return Value:
If buffer is NULL or buflen is zero, return number of UTF-16
values (not bytes) of text present within the rectangle, excluding
a terminating NUL. Generally you should pass a buffer at least one
larger than this if you want a terminating NUL, which will be
provided if space is available. Otherwise, return number of UTF-16
values copied into the buffer, including the terminating NUL when
space for it is available.
Comment:
If the buffer is too small, as much text as will fit is copied into
it. May return a split surrogate in that case.
-
FPDFText_GetCharAngle(FPDF_TEXTPAGE text_page, int index)
→ double
-
Experimental API.
Function: FPDFText_GetCharAngle
Get character rotation angle.
Parameters:
text_page - Handle to a text page information structure.
Returned by FPDFText_LoadPage function.
index - Zero-based index of the character.
Return Value:
On success, return the angle value in radian. Value will always be
greater or equal to 0. If |text_page| is invalid, or if |index| is
out of bounds, then return -1.
-
FPDFText_GetCharBox(FPDF_TEXTPAGE text_page, int index, Pointer<Double> left, Pointer<Double> right, Pointer<Double> bottom, Pointer<Double> top)
→ int
-
Function: FPDFText_GetCharBox
Get bounding box of a particular character.
Parameters:
text_page - Handle to a text page information structure.
Returned by FPDFText_LoadPage function.
index - Zero-based index of the character.
left - Pointer to a double number receiving left position
of the character box.
right - Pointer to a double number receiving right position
of the character box.
bottom - Pointer to a double number receiving bottom position
of the character box.
top - Pointer to a double number receiving top position of
the character box.
Return Value:
On success, return TRUE and fill in |left|, |right|, |bottom|, and
|top|. If |text_page| is invalid, or if |index| is out of bounds,
then return FALSE, and the out parameters remain unmodified.
Comments:
All positions are measured in PDF "user space".
-
FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page, double x, double y, double xTolerance, double yTolerance)
→ int
-
Function: FPDFText_GetCharIndexAtPos
Get the index of a character at or nearby a certain position on the
page.
Parameters:
text_page - Handle to a text page information structure.
Returned by FPDFText_LoadPage function.
x - X position in PDF "user space".
y - Y position in PDF "user space".
xTolerance - An x-axis tolerance value for character hit
detection, in point units.
yTolerance - A y-axis tolerance value for character hit
detection, in point units.
Return Value:
The zero-based index of the character at, or nearby the point (x,y).
If there is no character at or nearby the point, return value will
be -1. If an error occurs, -3 will be returned.
-
FPDFText_GetCharIndexFromTextIndex(FPDF_TEXTPAGE text_page, int nTextIndex)
→ int
-
Get the character index in |text_page| internal character list.
-
FPDFText_GetCharOrigin(FPDF_TEXTPAGE text_page, int index, Pointer<Double> x, Pointer<Double> y)
→ int
-
Function: FPDFText_GetCharOrigin
Get origin of a particular character.
Parameters:
text_page - Handle to a text page information structure.
Returned by FPDFText_LoadPage function.
index - Zero-based index of the character.
x - Pointer to a double number receiving x coordinate of
the character origin.
y - Pointer to a double number receiving y coordinate of
the character origin.
Return Value:
Whether the call succeeded. If false, x and y are unchanged.
Comments:
All positions are measured in PDF "user space".
-
FPDFText_GetFillColor(FPDF_TEXTPAGE text_page, int index, Pointer<UnsignedInt> R, Pointer<UnsignedInt> G, Pointer<UnsignedInt> B, Pointer<UnsignedInt> A)
→ int
-
Experimental API.
Function: FPDFText_GetFillColor
Get the fill color of a particular character.
Parameters:
text_page - Handle to a text page information structure.
Returned by FPDFText_LoadPage function.
index - Zero-based index of the character.
R - Pointer to an unsigned int number receiving the
red value of the fill color.
G - Pointer to an unsigned int number receiving the
green value of the fill color.
B - Pointer to an unsigned int number receiving the
blue value of the fill color.
A - Pointer to an unsigned int number receiving the
alpha value of the fill color.
Return value:
Whether the call succeeded. If false, |R|, |G|, |B| and |A| are
unchanged.
-
FPDFText_GetFontInfo(FPDF_TEXTPAGE text_page, int index, Pointer<Void> buffer, int buflen, Pointer<Int> flags)
→ int
-
Experimental API.
Function: FPDFText_GetFontInfo
Get the font name and flags of a particular character.
Parameters:
text_page - Handle to a text page information structure.
Returned by FPDFText_LoadPage function.
index - Zero-based index of the character.
buffer - A buffer receiving the font name.
buflen - The length of |buffer| in bytes.
flags - Optional pointer to an int receiving the font flags.
These flags should be interpreted per PDF spec 1.7
Section 5.7.1 Font Descriptor Flags.
Return value:
On success, return the length of the font name, including the
trailing NUL character, in bytes. If this length is less than or
equal to |length|, |buffer| is set to the font name, |flags| is
set to the font flags. |buffer| is in UTF-8 encoding. Return 0 on
failure.
-
FPDFText_GetFontSize(FPDF_TEXTPAGE text_page, int index)
→ double
-
Function: FPDFText_GetFontSize
Get the font size of a particular character.
Parameters:
text_page - Handle to a text page information structure.
Returned by FPDFText_LoadPage function.
index - Zero-based index of the character.
Return value:
The font size of the particular character, measured in points (about
1/72 inch). This is the typographic size of the font (so called
"em size").
-
FPDFText_GetFontWeight(FPDF_TEXTPAGE text_page, int index)
→ int
-
Experimental API.
Function: FPDFText_GetFontWeight
Get the font weight of a particular character.
Parameters:
text_page - Handle to a text page information structure.
Returned by FPDFText_LoadPage function.
index - Zero-based index of the character.
Return value:
On success, return the font weight of the particular character. If
|text_page| is invalid, if |index| is out of bounds, or if the
character's text object is undefined, return -1.
-
FPDFText_GetLooseCharBox(FPDF_TEXTPAGE text_page, int index, Pointer<FS_RECTF> rect)
→ int
-
Experimental API.
Function: FPDFText_GetLooseCharBox
Get a "loose" bounding box of a particular character, i.e., covering
the entire glyph bounds, without taking the actual glyph shape into
account.
Parameters:
text_page - Handle to a text page information structure.
Returned by FPDFText_LoadPage function.
index - Zero-based index of the character.
rect - Pointer to a FS_RECTF receiving the character box.
Return Value:
On success, return TRUE and fill in |rect|. If |text_page| is
invalid, or if |index| is out of bounds, then return FALSE, and the
|rect| out parameter remains unmodified.
Comments:
All positions are measured in PDF "user space".
-
FPDFText_GetMatrix(FPDF_TEXTPAGE text_page, int index, Pointer<FS_MATRIX> matrix)
→ int
-
Experimental API.
Function: FPDFText_GetMatrix
Get the effective transformation matrix for a particular character.
Parameters:
text_page - Handle to a text page information structure.
Returned by FPDFText_LoadPage().
index - Zero-based index of the character.
matrix - Pointer to a FS_MATRIX receiving the transformation
matrix.
Return Value:
On success, return TRUE and fill in |matrix|. If |text_page| is
invalid, or if |index| is out of bounds, or if |matrix| is NULL,
then return FALSE, and |matrix| remains unmodified.
-
FPDFText_GetRect(FPDF_TEXTPAGE text_page, int rect_index, Pointer<Double> left, Pointer<Double> top, Pointer<Double> right, Pointer<Double> bottom)
→ int
-
Function: FPDFText_GetRect
Get a rectangular area from the result generated by
FPDFText_CountRects.
Parameters:
text_page - Handle to a text page information structure.
Returned by FPDFText_LoadPage function.
rect_index - Zero-based index for the rectangle.
left - Pointer to a double value receiving the rectangle
left boundary.
top - Pointer to a double value receiving the rectangle
top boundary.
right - Pointer to a double value receiving the rectangle
right boundary.
bottom - Pointer to a double value receiving the rectangle
bottom boundary.
Return Value:
On success, return TRUE and fill in |left|, |top|, |right|, and
|bottom|. If |text_page| is invalid then return FALSE, and the out
parameters remain unmodified. If |text_page| is valid but
|rect_index| is out of bounds, then return FALSE and set the out
parameters to 0.
-
FPDFText_GetSchCount(FPDF_SCHHANDLE handle)
→ int
-
Function: FPDFText_GetSchCount
Get the number of matched characters in the search result.
Parameters:
handle - A search context handle returned by
FPDFText_FindStart.
Return Value:
Number of matched characters.
-
FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle)
→ int
-
Function: FPDFText_GetSchResultIndex
Get the starting character index of the search result.
Parameters:
handle - A search context handle returned by
FPDFText_FindStart.
Return Value:
Index for the starting character.
-
FPDFText_GetStrokeColor(FPDF_TEXTPAGE text_page, int index, Pointer<UnsignedInt> R, Pointer<UnsignedInt> G, Pointer<UnsignedInt> B, Pointer<UnsignedInt> A)
→ int
-
Experimental API.
Function: FPDFText_GetStrokeColor
Get the stroke color of a particular character.
Parameters:
text_page - Handle to a text page information structure.
Returned by FPDFText_LoadPage function.
index - Zero-based index of the character.
R - Pointer to an unsigned int number receiving the
red value of the stroke color.
G - Pointer to an unsigned int number receiving the
green value of the stroke color.
B - Pointer to an unsigned int number receiving the
blue value of the stroke color.
A - Pointer to an unsigned int number receiving the
alpha value of the stroke color.
Return value:
Whether the call succeeded. If false, |R|, |G|, |B| and |A| are
unchanged.
-
FPDFText_GetText(FPDF_TEXTPAGE text_page, int start_index, int count, Pointer<FPDF_WCHAR> result)
→ int
-
Function: FPDFText_GetText
Extract unicode text string from the page.
Parameters:
text_page - Handle to a text page information structure.
Returned by FPDFText_LoadPage function.
start_index - Index for the start characters.
count - Number of UCS-2 values to be extracted.
result - A buffer (allocated by application) receiving the
extracted UCS-2 values. The buffer must be able to
hold
count UCS-2 values plus a terminator.
Return Value:
Number of characters written into the result buffer, including the
trailing terminator.
Comments:
This function ignores characters without UCS-2 representations.
It considers all characters on the page, even those that are not
visible when the page has a cropbox. To filter out the characters
outside of the cropbox, use FPDF_GetPageBoundingBox() and
FPDFText_GetCharBox().
-
FPDFText_GetTextIndexFromCharIndex(FPDF_TEXTPAGE text_page, int nCharIndex)
→ int
-
Get the text index in |text_page| internal character list.
-
FPDFText_GetTextObject(FPDF_TEXTPAGE text_page, int index)
→ FPDF_PAGEOBJECT
-
Experimental API.
Function: FPDFText_GetTextObject
Get the FPDF_PAGEOBJECT associated with a given character.
Parameters:
text_page - Handle to a text page information structure.
Returned by FPDFText_LoadPage function.
index - Zero-based index of the character.
Return value:
The associated text object for the character at |index|, or NULL on
error. The returned text object, if non-null, is of type
|FPDF_PAGEOBJ_TEXT|. The caller does not own the returned object.
-
FPDFText_GetUnicode(FPDF_TEXTPAGE text_page, int index)
→ int
-
Function: FPDFText_GetUnicode
Get Unicode of a character in a page.
Parameters:
text_page - Handle to a text page information structure.
Returned by FPDFText_LoadPage function.
index - Zero-based index of the character.
Return value:
The Unicode of the particular character.
If a character is not encoded in Unicode and Foxit engine can't
convert to Unicode,
the return value will be zero.
-
FPDFText_HasUnicodeMapError(FPDF_TEXTPAGE text_page, int index)
→ int
-
Experimental API.
Function: FPDFText_HasUnicodeMapError
Get if a character in a page has an invalid unicode mapping.
Parameters:
text_page - Handle to a text page information structure.
Returned by FPDFText_LoadPage function.
index - Zero-based index of the character.
Return value:
1 if the character has an invalid unicode mapping.
0 if the character has no known unicode mapping issues.
-1 if there was an error.
-
FPDFText_IsGenerated(FPDF_TEXTPAGE text_page, int index)
→ int
-
Experimental API.
Function: FPDFText_IsGenerated
Get if a character in a page is generated by PDFium.
Parameters:
text_page - Handle to a text page information structure.
Returned by FPDFText_LoadPage function.
index - Zero-based index of the character.
Return value:
1 if the character is generated by PDFium.
0 if the character is not generated by PDFium.
-1 if there was an error.
-
FPDFText_IsHyphen(FPDF_TEXTPAGE text_page, int index)
→ int
-
Experimental API.
Function: FPDFText_IsHyphen
Get if a character in a page is a hyphen.
Parameters:
text_page - Handle to a text page information structure.
Returned by FPDFText_LoadPage function.
index - Zero-based index of the character.
Return value:
1 if the character is a hyphen.
0 if the character is not a hyphen.
-1 if there was an error.
-
FPDFText_LoadCidType2Font(FPDF_DOCUMENT document, Pointer<Uint8> font_data, int font_data_size, FPDF_BYTESTRING to_unicode_cmap, Pointer<Uint8> cid_to_gid_map_data, int cid_to_gid_map_data_size)
→ FPDF_FONT
-
Experimental API.
Returns a font object loaded from a stream of data for a type 2 CID font. The
font is loaded into the document. Unlike FPDFText_LoadFont(), the ToUnicode
data and the CIDToGIDMap data are caller provided, instead of auto-generated.
-
FPDFText_LoadFont(FPDF_DOCUMENT document, Pointer<Uint8> data, int size, int font_type, int cid)
→ FPDF_FONT
-
Returns a font object loaded from a stream of data. The font is loaded
into the document. Various font data structures, such as the ToUnicode data,
are auto-generated based on the inputs.
-
FPDFText_LoadPage(FPDF_PAGE page)
→ FPDF_TEXTPAGE
-
Function: FPDFText_LoadPage
Prepare information about all characters in a page.
Parameters:
page - Handle to the page. Returned by FPDF_LoadPage function
(in FPDFVIEW module).
Return value:
A handle to the text page information structure.
NULL if something goes wrong.
Comments:
Application must call FPDFText_ClosePage to release the text page
information.
-
FPDFText_LoadStandardFont(FPDF_DOCUMENT document, FPDF_BYTESTRING font)
→ FPDF_FONT
-
Experimental API.
Loads one of the standard 14 fonts per PDF spec 1.7 page 416. The preferred
way of using font style is using a dash to separate the name from the style,
for example 'Helvetica-BoldItalic'.
-
FPDFText_SetCharcodes(FPDF_PAGEOBJECT text_object, Pointer<Uint32> charcodes, int count)
→ int
-
Experimental API.
Set the text using charcodes for a text object. If it had text, it will be
replaced.
-
FPDFText_SetPositions(FPDF_PAGEOBJECT text_object, Pointer<Float> positions, int count)
→ int
-
Experimental API.
Set the character positions for a text object.
-
FPDFText_SetText(FPDF_PAGEOBJECT text_object, FPDF_WIDESTRING text)
→ int
-
Set the text for a text object. If it had text, it will be replaced.
-
FPDFTextObj_GetFont(FPDF_PAGEOBJECT text)
→ FPDF_FONT
-
Experimental API.
Get the font of a text object.
-
FPDFTextObj_GetFontSize(FPDF_PAGEOBJECT text, Pointer<Float> size)
→ int
-
Get the font size of a text object.
-
FPDFTextObj_GetRenderedBitmap(FPDF_DOCUMENT document, FPDF_PAGE page, FPDF_PAGEOBJECT text_object, double scale)
→ FPDF_BITMAP
-
Experimental API.
Get a bitmap rasterization of |text_object|. To render correctly, the caller
must provide the |document| associated with |text_object|. If there is a
|page| associated with |text_object|, the caller should provide that as well.
The returned bitmap will be owned by the caller, and FPDFBitmap_Destroy()
must be called on the returned bitmap when it is no longer needed.
-
FPDFTextObj_GetText(FPDF_PAGEOBJECT text_object, FPDF_TEXTPAGE text_page, Pointer<FPDF_WCHAR> buffer, int length)
→ int
-
Get the text of a text object.
-
FPDFTextObj_GetTextRenderMode(FPDF_PAGEOBJECT text)
→ FPDF_TEXT_RENDERMODE
-
-
FPDFTextObj_SetFontSize(FPDF_PAGEOBJECT text, double size)
→ int
-
Experimental API.
Set the font size of a text object.
-
FPDFTextObj_SetTextRenderMode(FPDF_PAGEOBJECT text, FPDF_TEXT_RENDERMODE render_mode)
→ DartFPDF_BOOL
-
-
FSDK_SetLocaltimeFunction(Pointer<NativeFunction<Pointer<tm> Function(Pointer<Long>)>> func)
→ void
-
Set replacement function for calls to localtime().
-
FSDK_SetTimeFunction(Pointer<NativeFunction<time_t Function()>> func)
→ void
-
Set replacement function for calls to time().
-
FSDK_SetUnSpObjProcessHandler(Pointer<UNSUPPORT_INFO> unsp_info)
→ int
-
Setup an unsupported object handler.
-
pdf_core_create()
→ pdf_core_t
-
-
pdf_core_destroy(pdf_core_t pdf_core_ptr)
→ void
-
-
pdf_core_fileOpened(pdf_core_t pdf_core_ptr)
→ bool
-
-
pdf_core_free_getAllPageSizes(page_size_data_t page_size_data_ptr)
→ void
-
-
pdf_core_getAllPageSizes(pdf_core_t pdf_core_ptr, Pointer<Int> out_count_ptr)
→ page_size_data_t
-
-
pdf_core_getPageCount(pdf_core_t pdf_core_ptr)
→ int
-
-
pdf_core_openFile(pdf_core_t pdf_core_ptr, Pointer<Char> path, Pointer<Char> password)
→ bool
-
-
pdf_core_openMemory64Raw(pdf_core_t pdf_core_ptr, Pointer<UnsignedChar> buffer, int buffer_size, Pointer<Char> password)
→ bool
-
-
pdf_core_openMemoryRaw(pdf_core_t pdf_core_ptr, Pointer<UnsignedChar> buffer, int buffer_size, Pointer<Char> password)
→ bool
-
-
pdf_page_create(pdf_core_t pdf_core_ptr, int page_index)
→ pdf_page_t
-
-
pdf_page_destroy(pdf_page_t pdf_page_ptr)
→ void
-
-
pdf_page_free_renderToJpegWH(Pointer<UnsignedChar> render_jpg_buff)
→ void
-
-
pdf_page_free_renderToPngWH(Pointer<UnsignedChar> render_png_buff)
→ void
-
-
pdf_page_getHeight(pdf_page_t pdf_page_ptr)
→ double
-
-
pdf_page_getHeightF(pdf_page_t pdf_page_ptr)
→ double
-
-
pdf_page_getWidth(pdf_page_t pdf_page_ptr)
→ double
-
-
pdf_page_getWidthF(pdf_page_t pdf_page_ptr)
→ double
-
-
pdf_page_isVaild(pdf_page_t pdf_page_ptr)
→ bool
-
-
pdf_page_renderToJpegWH(pdf_page_t pdf_page_ptr, Pointer<Int> data_size, int width, int height, int quality)
→ Pointer<UnsignedChar>
-
============================================================
Render JPEG
-
pdf_page_renderToPngWH(pdf_page_t pdf_page_ptr, Pointer<Int> data_size, int width, int height)
→ Pointer<UnsignedChar>
-
============================================================
Render PNG
-
pdf_page_saveAsJpgWH(pdf_page_t pdf_page_ptr, Pointer<Char> out_path, int width, int height, int quality)
→ bool
-
-
pdf_page_saveAsPngWH(pdf_page_t pdf_page_ptr, Pointer<Char> out_path, int width, int height)
→ bool
-
============================================================
Save
-
pdf_util_saveJpgWithIndex(Pointer<Char> pdf_path, Pointer<Char> password, Pointer<Char> out_path, int page_index, int width, int height, int quality)
→ bool
-
============================================================
PDF Util
-
pdf_util_savePngWithIndex(Pointer<Char> pdf_path, Pointer<Char> password, Pointer<Char> out_path, int page_index, int width, int height)
→ bool
-
-
pdfium_destroy()
→ void
-
-
pdfium_init()
→ void
-
============================================================
PDFium
-
stbi_flip_vertically_on_write(int flip_boolean)
→ void
-
-
stbi_write_bmp(Pointer<Char> filename, int w, int h, int comp, Pointer<Void> data)
→ int
-
-
stbi_write_bmp_to_func(Pointer<stbi_write_func> func, Pointer<Void> context, int w, int h, int comp, Pointer<Void> data)
→ int
-
-
stbi_write_hdr(Pointer<Char> filename, int w, int h, int comp, Pointer<Float> data)
→ int
-
-
stbi_write_hdr_to_func(Pointer<stbi_write_func> func, Pointer<Void> context, int w, int h, int comp, Pointer<Float> data)
→ int
-
-
stbi_write_jpg(Pointer<Char> filename, int x, int y, int comp, Pointer<Void> data, int quality)
→ int
-
-
stbi_write_jpg_to_func(Pointer<stbi_write_func> func, Pointer<Void> context, int x, int y, int comp, Pointer<Void> data, int quality)
→ int
-
-
stbi_write_png(Pointer<Char> filename, int w, int h, int comp, Pointer<Void> data, int stride_in_bytes)
→ int
-
-
stbi_write_png_to_func(Pointer<stbi_write_func> func, Pointer<Void> context, int w, int h, int comp, Pointer<Void> data, int stride_in_bytes)
→ int
-
-
stbi_write_tga(Pointer<Char> filename, int w, int h, int comp, Pointer<Void> data)
→ int
-
-
stbi_write_tga_to_func(Pointer<stbi_write_func> func, Pointer<Void> context, int w, int h, int comp, Pointer<Void> data)
→ int
-