summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-05-13 16:39:41 -0700
committerTom Sepez <tsepez@chromium.org>2015-05-13 16:39:41 -0700
commit8aa1eac606d8e5030de6509f5d5d66e90db521f4 (patch)
treefe5722129198e83f2c96c5fd928b9e29fe3bc6fa
parentfdc5e691745cf16fb105f3ad4a9fb5f8f64f56b4 (diff)
downloadpdfium-8aa1eac606d8e5030de6509f5d5d66e90db521f4.tar.xz
Tidy public/ directory.
- Make include guards consistent with standard and filenames. - Remove stray semicolon folowing extern "C" section close-brace. - Untabify. - Delete trailing whitespace. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1128003005
-rw-r--r--public/fpdf_dataavail.h237
-rw-r--r--public/fpdf_doc.h246
-rw-r--r--public/fpdf_edit.h247
-rw-r--r--public/fpdf_ext.h116
-rw-r--r--public/fpdf_flatten.h54
-rw-r--r--public/fpdf_formfill.h1270
-rw-r--r--public/fpdf_fwlevent.h176
-rw-r--r--public/fpdf_ppo.h37
-rw-r--r--public/fpdf_progressive.h110
-rw-r--r--public/fpdf_save.h91
-rw-r--r--public/fpdf_searchex.h26
-rw-r--r--public/fpdf_sysfontinfo.h366
-rw-r--r--public/fpdf_text.h310
-rw-r--r--public/fpdf_transformpage.h92
-rw-r--r--public/fpdfview.h714
15 files changed, 2037 insertions, 2055 deletions
diff --git a/public/fpdf_dataavail.h b/public/fpdf_dataavail.h
index 37ea797ea9..317a355f62 100644
--- a/public/fpdf_dataavail.h
+++ b/public/fpdf_dataavail.h
@@ -1,20 +1,20 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef _FPDF_DATAAVAIL_H_
-#define _FPDF_DATAAVAIL_H_
+#ifndef PUBLIC_FPDF_DATAAVAIL_H_
+#define PUBLIC_FPDF_DATAAVAIL_H_
#include <stddef.h> // For size_t.
#include "fpdfview.h"
/** The result of the process which check linearized PDF. */
-#define FSDK_IS_LINEARIZED 1
-#define FSDK_NOT_LINEARIZED 0
-#define FSDK_UNKNOW_LINEARIZED -1
+#define FSDK_IS_LINEARIZED 1
+#define FSDK_NOT_LINEARIZED 0
+#define FSDK_UNKNOW_LINEARIZED -1
#ifdef __cplusplus
@@ -23,199 +23,198 @@ extern "C" {
/**
* Interface: FX_FILEAVAIL
- * Interface for checking whether the section of the file is available.
+ * Interface for checking whether the section of the file is available.
*/
typedef struct _FX_FILEAVAIL {
- /**
- * Version number of the interface. Currently must be 1.
- */
- int version;
-
- /**
- * Method: IsDataAvail
- * Report whether the specified data section is available. A section is available only if all bytes in the section is available.
- * Interface Version:
- * 1
- * Implementation Required:
- * Yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * offset - The offset of the data section in the file.
- * size - The size of the data section
- * Return Value:
- * true means the specified data section is available.
- * Comments:
- * Called by Foxit SDK to check whether the data section is ready.
- */
- FPDF_BOOL (*IsDataAvail)(struct _FX_FILEAVAIL* pThis, size_t offset, size_t size);
+ /**
+ * Version number of the interface. Currently must be 1.
+ */
+ int version;
+
+ /**
+ * Method: IsDataAvail
+ * Report whether the specified data section is available. A section is available only if all bytes in the section is available.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * Yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * offset - The offset of the data section in the file.
+ * size - The size of the data section
+ * Return Value:
+ * true means the specified data section is available.
+ * Comments:
+ * Called by Foxit SDK to check whether the data section is ready.
+ */
+ FPDF_BOOL (*IsDataAvail)(struct _FX_FILEAVAIL* pThis, size_t offset, size_t size);
} FX_FILEAVAIL;
typedef void* FPDF_AVAIL;
/**
* Function: FPDFAvail_Create
-* Create a document availability provider.
+* Create a document availability provider.
*
-* Parameters:
-* file_avail - Pointer to file availability interface to check availability of file data.
-* file - Pointer to a file access interface for reading data from file.
+* Parameters:
+* file_avail - Pointer to file availability interface to check availability of file data.
+* file - Pointer to a file access interface for reading data from file.
* Return value:
-* A handle to the document availability provider. NULL for error.
+* A handle to the document availability provider. NULL for error.
* Comments:
-* Application must call FPDFAvail_Destroy when done with the availability provider.
+* Application must call FPDFAvail_Destroy when done with the availability provider.
*/
DLLEXPORT FPDF_AVAIL STDCALL FPDFAvail_Create(FX_FILEAVAIL* file_avail, FPDF_FILEACCESS* file);
/**
* Function: FPDFAvail_Destroy
-* Destroy a document availibity provider.
+* Destroy a document availibity provider.
*
-* Parameters:
-* avail - Handle to document availability provider returned by FPDFAvail_Create
+* Parameters:
+* avail - Handle to document availability provider returned by FPDFAvail_Create
* Return Value:
-* None.
+* None.
*/
DLLEXPORT void STDCALL FPDFAvail_Destroy(FPDF_AVAIL avail);
/**
* Interface: FX_DOWNLOADHINTS
- * Download hints interface. Used to receive hints for further downloading.
+ * Download hints interface. Used to receive hints for further downloading.
*/
typedef struct _FX_DOWNLOADHINTS {
- /**
- * Version number of the interface. Currently must be 1.
- */
- int version;
-
- /**
- * Method: AddSegment
- * Add a section to be downloaded.
- * Interface Version:
- * 1
- * Implementation Required:
- * Yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * offset - The offset of the hint reported to be downloaded.
- * size - The size of the hint reported to be downloaded.
- * Return Value:
- * None.
- * Comments:
- * Called by Foxit SDK to report some downloading hints for download manager.
- * The position and size of section may be not accurate, part of the section might be already available.
- * The download manager must deal with that to maximize download efficiency.
- */
- void (*AddSegment)(struct _FX_DOWNLOADHINTS* pThis, size_t offset, size_t size);
+ /**
+ * Version number of the interface. Currently must be 1.
+ */
+ int version;
+
+ /**
+ * Method: AddSegment
+ * Add a section to be downloaded.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * Yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * offset - The offset of the hint reported to be downloaded.
+ * size - The size of the hint reported to be downloaded.
+ * Return Value:
+ * None.
+ * Comments:
+ * Called by Foxit SDK to report some downloading hints for download manager.
+ * The position and size of section may be not accurate, part of the section might be already available.
+ * The download manager must deal with that to maximize download efficiency.
+ */
+ void (*AddSegment)(struct _FX_DOWNLOADHINTS* pThis, size_t offset, size_t size);
} FX_DOWNLOADHINTS;
/**
* Function: FPDFAvail_IsDocAvail
-* Check whether the document is ready for loading, if not, get download hints.
+* Check whether the document is ready for loading, if not, get download hints.
*
-* Parameters:
-* avail - Handle to document availability provider returned by FPDFAvail_Create
-* hints - Pointer to a download hints interface, receiving generated hints
+* Parameters:
+* avail - Handle to document availability provider returned by FPDFAvail_Create
+* hints - Pointer to a download hints interface, receiving generated hints
* Return value:
-* Non-zero for page is fully available, 0 for page not yet available.
+* Non-zero for page is fully available, 0 for page not yet available.
* Comments:
-* The application should call this function whenever new data arrived, and process all the
-* generated download hints if any, until the function returns non-zero value. Then the
-* application can call FPDFAvail_GetDocument() to get a document handle.
+* The application should call this function whenever new data arrived, and process all the
+* generated download hints if any, until the function returns non-zero value. Then the
+* application can call FPDFAvail_GetDocument() to get a document handle.
*/
DLLEXPORT int STDCALL FPDFAvail_IsDocAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS* hints);
/**
* Function: FPDFAvail_GetDocument
-* Get document from the availability provider.
+* Get document from the availability provider.
*
* Parameters:
-* avail - Handle to document availability provider returned by FPDFAvail_Create
-* password - Optional password for decrypting the PDF file.
+* avail - Handle to document availability provider returned by FPDFAvail_Create
+* password - Optional password for decrypting the PDF file.
* Return value:
-* Handle to the document.
+* Handle to the document.
* Comments:
-* After FPDFAvail_IsDocAvail() returns TRUE, the application should call this function to
-* get the document handle. To close the document, use FPDF_CloseDocument function.
+* After FPDFAvail_IsDocAvail() returns TRUE, the application should call this function to
+* get the document handle. To close the document, use FPDF_CloseDocument function.
*/
DLLEXPORT FPDF_DOCUMENT STDCALL FPDFAvail_GetDocument(FPDF_AVAIL avail,
FPDF_BYTESTRING password);
/**
* Function: FPDFAvail_GetFirstPageNum
-* Get page number for the first available page in a linearized PDF
+* Get page number for the first available page in a linearized PDF
*
* Parameters:
-* doc - A document handle returned by FPDFAvail_GetDocument
+* doc - A document handle returned by FPDFAvail_GetDocument
* Return Value:
-* Zero-based index for the first available page.
+* Zero-based index for the first available page.
* Comments:
-* For most linearized PDFs, the first available page would be just the first page, however,
-* some PDFs might make other page to be the first available page.
-* For non-linearized PDF, this function will always return zero.
+* For most linearized PDFs, the first available page would be just the first page, however,
+* some PDFs might make other page to be the first available page.
+* For non-linearized PDF, this function will always return zero.
*/
DLLEXPORT int STDCALL FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc);
/**
* Function: FPDFAvail_IsPageAvail
-* Check whether a page is ready for loading, if not, get download hints.
+* Check whether a page is ready for loading, if not, get download hints.
*
-* Parameters:
-* avail - Handle to document availability provider returned by FPDFAvail_Create
-* page_index - Index number of the page. 0 for the first page.
-* hints - Pointer to a download hints interface, receiving generated hints
+* Parameters:
+* avail - Handle to document availability provider returned by FPDFAvail_Create
+* page_index - Index number of the page. 0 for the first page.
+* hints - Pointer to a download hints interface, receiving generated hints
* Return value:
-* Non-zero for page is fully available, 0 for page not yet available.
+* Non-zero for page is fully available, 0 for page not yet available.
* Comments:
-* This function call be called only after FPDFAvail_GetDocument if called.
-* The application should call this function whenever new data arrived, and process all the
-* generated download hints if any, until the function returns non-zero value. Then the
-* application can perform page loading.
+* This function call be called only after FPDFAvail_GetDocument if called.
+* The application should call this function whenever new data arrived, and process all the
+* generated download hints if any, until the function returns non-zero value. Then the
+* application can perform page loading.
*/
DLLEXPORT int STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail, int page_index, FX_DOWNLOADHINTS* hints);
/**
* Function: FPDFAvail_ISFormAvail
-* Check whether Form data is ready for init, if not, get download hints.
+* Check whether Form data is ready for init, if not, get download hints.
*
-* Parameters:
-* avail - Handle to document availability provider returned by FPDFAvail_Create
-* hints - Pointer to a download hints interface, receiving generated hints
+* Parameters:
+* avail - Handle to document availability provider returned by FPDFAvail_Create
+* hints - Pointer to a download hints interface, receiving generated hints
* Return value:
-* Non-zero for Form data is fully available, 0 for Form data not yet available.
-* Details: -1 - error, the input parameter not correct, such as hints is null.
-* 0 - data not available
-* 1 - data available
-* 2 - no form data.
+* Non-zero for Form data is fully available, 0 for Form data not yet available.
+* Details: -1 - error, the input parameter not correct, such as hints is null.
+* 0 - data not available
+* 1 - data available
+* 2 - no form data.
* Comments:
-* This function call be called only after FPDFAvail_GetDocument if called.
-* The application should call this function whenever new data arrived, and process all the
-* generated download hints if any, until the function returns non-zero value. Then the
-* application can perform page loading. Recommend to call FPDFDOC_InitFormFillEnvironment
-* after the function returns non-zero value.
+* This function call be called only after FPDFAvail_GetDocument if called.
+* The application should call this function whenever new data arrived, and process all the
+* generated download hints if any, until the function returns non-zero value. Then the
+* application can perform page loading. Recommend to call FPDFDOC_InitFormFillEnvironment
+* after the function returns non-zero value.
*/
DLLEXPORT int STDCALL FPDFAvail_IsFormAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS* hints);
/**
* Function: FPDFAvail_IsLinearized
-* To check whether a document is Linearized PDF file.
+* To check whether a document is Linearized PDF file.
*
* Parameters:
-* avail - Handle to document availability provider returned by FPDFAvail_Create
+* avail - Handle to document availability provider returned by FPDFAvail_Create
* Return value:
-* return TRUE means the document is linearized PDF else not.
-* FSDK_IS_LINEARIZED is a linearize file.
-* FSDK_NOT_LINEARIZED is not a linearize file.
-* FSDK_UNKNOW_LINEARIZED don't know whether the file is a linearize file.
+* return TRUE means the document is linearized PDF else not.
+* FSDK_IS_LINEARIZED is a linearize file.
+* FSDK_NOT_LINEARIZED is not a linearize file.
+* FSDK_UNKNOW_LINEARIZED don't know whether the file is a linearize file.
* Comments:
-* It return TRUE/FALSE as soon as we have first 1K data. If the file's size less than
-* 1K,we don't known whether the PDF is a linearized file.
+* It return TRUE/FALSE as soon as we have first 1K data. If the file's size less than
+* 1K,we don't known whether the PDF is a linearized file.
*
*/
DLLEXPORT FPDF_BOOL STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail);
#ifdef __cplusplus
-};
-#endif
-
+}
#endif
+#endif // PUBLIC_FPDF_DATAAVAIL_H_
diff --git a/public/fpdf_doc.h b/public/fpdf_doc.h
index 1587ef4069..511badb539 100644
--- a/public/fpdf_doc.h
+++ b/public/fpdf_doc.h
@@ -1,11 +1,11 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef _FPDFDOC_H_
-#define _FPDFDOC_H_
+#ifndef PUBLIC_FPDF_DOC_H_
+#define PUBLIC_FPDF_DOC_H_
#include "fpdfview.h"
@@ -15,35 +15,35 @@ extern "C" {
#endif
// Function: FPDFBookmark_GetFirstChild
-// Get the first child of a bookmark item, or the first top level bookmark item.
+// Get the first child of a bookmark item, or the first top level bookmark item.
// Parameters:
-// document - Handle to the document. Returned by FPDF_LoadDocument or FPDF_LoadMemDocument.
-// bookmark - Handle to the current bookmark. Can be NULL if you want to get the first top level item.
+// document - Handle to the document. Returned by FPDF_LoadDocument or FPDF_LoadMemDocument.
+// bookmark - Handle to the current bookmark. Can be NULL if you want to get the first top level item.
// Return value:
-// Handle to the first child or top level bookmark item. NULL if no child or top level bookmark found.
+// Handle to the first child or top level bookmark item. NULL if no child or top level bookmark found.
//
DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_GetFirstChild(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark);
// Function: FPDFBookmark_GetNextSibling
-// Get next bookmark item at the same level.
+// Get next bookmark item at the same level.
// Parameters:
-// document - Handle to the document. Returned by FPDF_LoadDocument or FPDF_LoadMemDocument.
-// bookmark - Handle to the current bookmark. Cannot be NULL.
+// document - Handle to the document. Returned by FPDF_LoadDocument or FPDF_LoadMemDocument.
+// bookmark - Handle to the current bookmark. Cannot be NULL.
// Return value:
-// Handle to the next bookmark item at the same level. NULL if this is the last bookmark at this level.
+// Handle to the next bookmark item at the same level. NULL if this is the last bookmark at this level.
//
DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_GetNextSibling(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark);
// Function: FPDFBookmark_GetTitle
-// Get title of a bookmark.
+// Get title of a bookmark.
// Parameters:
-// bookmark - Handle to the bookmark.
-// buffer - Buffer for the title. Can be NULL.
+// bookmark - Handle to the bookmark.
+// buffer - Buffer for the title. Can be NULL.
// buflen - The length of the buffer in bytes. Can be 0.
// Return value:
-// Number of bytes the title consumes, including trailing zeros.
+// Number of bytes the title consumes, including trailing zeros.
// Comments:
-// Regardless of the platform, the title is always in UTF-16LE encoding. That means the buffer
+// Regardless of the platform, the title is always in UTF-16LE encoding. That means the buffer
// can be treated as an array of WORD (on Intel and compatible CPUs), each WORD representing the Unicode of
// a character(some special Unicode may take 2 WORDs).The string is followed by two bytes of zero
// indicating the end of the string.
@@ -54,158 +54,158 @@ DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_GetNextSibling(FPDF_DOCUMENT docume
DLLEXPORT unsigned long STDCALL FPDFBookmark_GetTitle(FPDF_BOOKMARK bookmark, void* buffer, unsigned long buflen);
// Function: FPDFBookmark_Find
-// Find a bookmark in the document, using the bookmark title.
-// Parameters:
-// document - Handle to the document. Returned by FPDF_LoadDocument or FPDF_LoadMemDocument.
-// title - The UTF-16LE encoded Unicode string for the bookmark title to be searched. Can't be NULL.
+// Find a bookmark in the document, using the bookmark title.
+// Parameters:
+// document - Handle to the document. Returned by FPDF_LoadDocument or FPDF_LoadMemDocument.
+// title - The UTF-16LE encoded Unicode string for the bookmark title to be searched. Can't be NULL.
// Return value:
-// Handle to the found bookmark item. NULL if the title can't be found.
+// Handle to the found bookmark item. NULL if the title can't be found.
// Comments:
-// It always returns the first found bookmark if more than one bookmarks have the same title.
+// It always returns the first found bookmark if more than one bookmarks have the same title.
//
DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_Find(FPDF_DOCUMENT document, FPDF_WIDESTRING title);
// Function: FPDFBookmark_GetDest
-// Get the destination associated with a bookmark item.
+// Get the destination associated with a bookmark item.
// Parameters:
-// document - Handle to the document.
-// bookmark - Handle to the bookmark.
+// document - Handle to the document.
+// bookmark - Handle to the bookmark.
// Return value:
-// Handle to the destination data. NULL if no destination is associated with this bookmark.
+// Handle to the destination data. NULL if no destination is associated with this bookmark.
//
DLLEXPORT FPDF_DEST STDCALL FPDFBookmark_GetDest(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark);
// Function: FPDFBookmark_GetAction
-// Get the action associated with a bookmark item.
+// Get the action associated with a bookmark item.
// Parameters:
-// bookmark - Handle to the bookmark.
+// bookmark - Handle to the bookmark.
// Return value:
-// Handle to the action data. NULL if no action is associated with this bookmark. In this case, the
-// application should try FPDFBookmark_GetDest.
+// Handle to the action data. NULL if no action is associated with this bookmark. In this case, the
+// application should try FPDFBookmark_GetDest.
//
DLLEXPORT FPDF_ACTION STDCALL FPDFBookmark_GetAction(FPDF_BOOKMARK bookmark);
-#define PDFACTION_UNSUPPORTED 0 // Unsupported action type.
-#define PDFACTION_GOTO 1 // Go to a destination within current document.
-#define PDFACTION_REMOTEGOTO 2 // Go to a destination within another document.
-#define PDFACTION_URI 3 // Universal Resource Identifier, including web pages and
- // other Internet based resources.
-#define PDFACTION_LAUNCH 4 // Launch an application or open a file.
+#define PDFACTION_UNSUPPORTED 0 // Unsupported action type.
+#define PDFACTION_GOTO 1 // Go to a destination within current document.
+#define PDFACTION_REMOTEGOTO 2 // Go to a destination within another document.
+#define PDFACTION_URI 3 // Universal Resource Identifier, including web pages and
+ // other Internet based resources.
+#define PDFACTION_LAUNCH 4 // Launch an application or open a file.
// Function: FPDFAction_GetType
-// Get type of an action.
+// Get type of an action.
// Parameters:
-// action - Handle to the action.
+// action - Handle to the action.
// Return value:
-// A type number as defined above.
+// A type number as defined above.
//
DLLEXPORT unsigned long STDCALL FPDFAction_GetType(FPDF_ACTION action);
// Function: FPDFAction_GetDest
-// Get destination of an action.
+// Get destination of an action.
// Parameters:
-// document - Handle to the document.
-// action - Handle to the action. It must be a GOTO or REMOTEGOTO action.
+// document - Handle to the document.
+// action - Handle to the action. It must be a GOTO or REMOTEGOTO action.
// Return value:
-// Handle to the destination data.
+// Handle to the destination data.
// Comments:
-// In case of remote goto action, the application should first use FPDFAction_GetFilePath to
-// get file path, then load that particular document, and use its document handle to call this
-// function.
+// In case of remote goto action, the application should first use FPDFAction_GetFilePath to
+// get file path, then load that particular document, and use its document handle to call this
+// function.
//
DLLEXPORT FPDF_DEST STDCALL FPDFAction_GetDest(FPDF_DOCUMENT document, FPDF_ACTION action);
// Function: FPDFAction_GetURIPath
-// Get URI path of a URI action.
+// Get URI path of a URI action.
// Parameters:
-// document - Handle to the document.
-// action - Handle to the action. Must be a URI action.
-// buffer - A buffer for output the path string. Can be NULL.
-// buflen - The length of the buffer, number of bytes. Can be 0.
+// document - Handle to the document.
+// action - Handle to the action. Must be a URI action.
+// buffer - A buffer for output the path string. Can be NULL.
+// buflen - The length of the buffer, number of bytes. Can be 0.
// Return value:
-// Number of bytes the URI path consumes, including trailing zeros.
+// Number of bytes the URI path consumes, including trailing zeros.
// Comments:
-// The URI path is always encoded in 7-bit ASCII.
-//
-// The return value always indicated number of bytes required for the buffer, even when there is
-// no buffer specified, or the buffer size is less then required. In this case, the buffer will not
-// be modified.
+// The URI path is always encoded in 7-bit ASCII.
+//
+// The return value always indicated number of bytes required for the buffer, even when there is
+// no buffer specified, or the buffer size is less then required. In this case, the buffer will not
+// be modified.
//
-DLLEXPORT unsigned long STDCALL FPDFAction_GetURIPath(FPDF_DOCUMENT document, FPDF_ACTION action,
- void* buffer, unsigned long buflen);
+DLLEXPORT unsigned long STDCALL FPDFAction_GetURIPath(FPDF_DOCUMENT document, FPDF_ACTION action,
+ void* buffer, unsigned long buflen);
// Function: FPDFDest_GetPageIndex
-// Get page index of a destination.
+// Get page index of a destination.
// Parameters:
-// document - Handle to the document.
-// dest - Handle to the destination.
+// document - Handle to the document.
+// dest - Handle to the destination.
// Return value:
-// The page index. Starting from 0 for the first page.
+// The page index. Starting from 0 for the first page.
//
DLLEXPORT unsigned long STDCALL FPDFDest_GetPageIndex(FPDF_DOCUMENT document, FPDF_DEST dest);
// Function: FPDFLink_GetLinkAtPoint
-// Find a link at specified point on a document page.
+// Find a link at specified point on a document page.
// Parameters:
-// page - Handle to the document page.
-// x - The x coordinate of the point, specified in page coordinate system.
-// y - The y coordinate of the point, specified in page coordinate system.
+// page - Handle to the document page.
+// x - The x coordinate of the point, specified in page coordinate system.
+// y - The y coordinate of the point, specified in page coordinate system.
// Return value:
-// Handle to the link. NULL if no link found at that point.
+// Handle to the link. NULL if no link found at that point.
// Comments:
-// The point coordinates are specified in page coordinate system. You can convert coordinates
-// from screen system to page system using FPDF_DeviceToPage functions.
+// The point coordinates are specified in page coordinate system. You can convert coordinates
+// from screen system to page system using FPDF_DeviceToPage functions.
//
DLLEXPORT FPDF_LINK STDCALL FPDFLink_GetLinkAtPoint(FPDF_PAGE page, double x, double y);
// Function: FPDFLink_GetDest
-// Get destination info of a link.
+// Get destination info of a link.
// Parameters:
-// document - Handle to the document.
-// link - Handle to the link. Returned by FPDFLink_GetLinkAtPoint.
+// document - Handle to the document.
+// link - Handle to the link. Returned by FPDFLink_GetLinkAtPoint.
// Return value:
-// Handle to the destination. NULL if there is no destination associated with the link, in this case
-// the application should try FPDFLink_GetAction.
+// Handle to the destination. NULL if there is no destination associated with the link, in this case
+// the application should try FPDFLink_GetAction.
//
DLLEXPORT FPDF_DEST STDCALL FPDFLink_GetDest(FPDF_DOCUMENT document, FPDF_LINK link);
// Function: FPDFLink_GetAction
-// Get action info of a link.
+// Get action info of a link.
// Parameters:
-// link - Handle to the link.
+// link - Handle to the link.
// Return value:
-// Handle to the action. NULL if there is no action associated with the link.
+// Handle to the action. NULL if there is no action associated with the link.
//
DLLEXPORT FPDF_ACTION STDCALL FPDFLink_GetAction(FPDF_LINK link);
// Function: FPDFLink_Enumerate
-// This function would enumerate all the link annotations in a single PDF page.
+// This function would enumerate all the link annotations in a single PDF page.
// Parameters:
-// page[in] - Handle to the page.
-// startPos[in,out] - The start position to enumerate the link annotations, which should be specified to start from
-// - 0 for the first call, and would receive the next position for enumerating to start from.
-// linkAnnot[out] - Receive the link handle.
+// page[in] - Handle to the page.
+// startPos[in,out] - The start position to enumerate the link annotations, which should be specified to start from
+// - 0 for the first call, and would receive the next position for enumerating to start from.
+// linkAnnot[out] - Receive the link handle.
// Return value:
-// TRUE if succceed, else False;
+// TRUE if succceed, else False;
//
DLLEXPORT FPDF_BOOL STDCALL FPDFLink_Enumerate(FPDF_PAGE page, int* startPos, FPDF_LINK* linkAnnot);
// Function: FPDFLink_GetAnnotRect
-// Get the annotation rectangle. (Specified by the ¡°Rect¡± entry of annotation dictionary).
+// Get the annotation rectangle. (Specified by the ¡°Rect¡± entry of annotation dictionary).
// Parameters:
-// linkAnnot[in] - Handle to the link annotation.
-// rect[out] - The annotation rect.
+// linkAnnot[in] - Handle to the link annotation.
+// rect[out] - The annotation rect.
// Return value:
-// TRUE if succceed, else False;
+// TRUE if succceed, else False;
//
DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetAnnotRect(FPDF_LINK linkAnnot, FS_RECTF* rect);
// Function: FPDFLink_CountQuadPoints
-// Get the count of quadrilateral points to the link annotation.
+// Get the count of quadrilateral points to the link annotation.
// Parameters:
-// linkAnnot[in] - Handle to the link annotation.
+// linkAnnot[in] - Handle to the link annotation.
// Return value:
-// The count of quadrilateral points.
+// The count of quadrilateral points.
//
DLLEXPORT int STDCALL FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot);
@@ -214,56 +214,56 @@ DLLEXPORT int STDCALL FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot);
#define _FS_DEF_STRUCTURE_QUADPOINTSF_
typedef struct _FS_QUADPOINTSF
{
- FS_FLOAT x1;
- FS_FLOAT y1;
- FS_FLOAT x2;
- FS_FLOAT y2;
- FS_FLOAT x3;
- FS_FLOAT y3;
- FS_FLOAT x4;
- FS_FLOAT y4;
+ FS_FLOAT x1;
+ FS_FLOAT y1;
+ FS_FLOAT x2;
+ FS_FLOAT y2;
+ FS_FLOAT x3;
+ FS_FLOAT y3;
+ FS_FLOAT x4;
+ FS_FLOAT y4;
} FS_QUADPOINTSF;
#endif /* _FS_DEF_STRUCTURE_QUADPOINTSF_ */
// Function: FPDFLink_GetQuadPoints
-// Get the quadrilateral points for the specified index in the link annotation.
+// Get the quadrilateral points for the specified index in the link annotation.
// Parameters:
-// linkAnnot[in] - Handle to the link annotation.
-// quadIndex[in] - The specified quad points index.
-// quadPoints[out] - Receive the quadrilateral points.
+// linkAnnot[in] - Handle to the link annotation.
+// quadIndex[in] - The specified quad points index.
+// quadPoints[out] - Receive the quadrilateral points.
// Return value:
-// True if succeed, else False.
+// True if succeed, else False.
//
DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot, int quadIndex, FS_QUADPOINTSF* quadPoints);
// Function: FPDF_GetMetaText
-// Get a text from meta data of the document. Result is encoded in UTF-16LE.
+// Get a text from meta data of the document. Result is encoded in UTF-16LE.
// Parameters:
-// doc - Handle to a document
-// tag - The tag for the meta data. Currently, It can be "Title", "Author",
-// "Subject", "Keywords", "Creator", "Producer", "CreationDate", or "ModDate".
-// For detailed explanation of these tags and their respective values,
-// please refer to PDF Reference 1.6, section 10.2.1, "Document Information Dictionary".
-// buffer - A buffer for output the title. Can be NULL.
-// buflen - The length of the buffer, number of bytes. Can be 0.
+// doc - Handle to a document
+// tag - The tag for the meta data. Currently, It can be "Title", "Author",
+// "Subject", "Keywords", "Creator", "Producer", "CreationDate", or "ModDate".
+// For detailed explanation of these tags and their respective values,
+// please refer to PDF Reference 1.6, section 10.2.1, "Document Information Dictionary".
+// buffer - A buffer for output the title. Can be NULL.
+// buflen - The length of the buffer, number of bytes. Can be 0.
// Return value:
-// Number of bytes the title consumes, including trailing zeros.
+// Number of bytes the title consumes, including trailing zeros.
// Comments:
-// No matter on what platform, the title is always output in UTF-16LE encoding, which means the buffer
-// can be regarded as an array of WORD (on Intel and compatible CPUs), each WORD represent the Unicode of
-// a character (some special Unicode may take 2 WORDs). The string is followed by two bytes of zero
-// indicating end of the string.
+// No matter on what platform, the title is always output in UTF-16LE encoding, which means the buffer
+// can be regarded as an array of WORD (on Intel and compatible CPUs), each WORD represent the Unicode of
+// a character (some special Unicode may take 2 WORDs). The string is followed by two bytes of zero
+// indicating end of the string.
//
-// The return value always indicated number of bytes required for the buffer, even when there is
-// no buffer specified, or the buffer size is less then required. In this case, the buffer will not
-// be modified.
+// The return value always indicated number of bytes required for the buffer, even when there is
+// no buffer specified, or the buffer size is less then required. In this case, the buffer will not
+// be modified.
//
DLLEXPORT unsigned long STDCALL FPDF_GetMetaText(FPDF_DOCUMENT doc, FPDF_BYTESTRING tag,
- void* buffer, unsigned long buflen);
+ void* buffer, unsigned long buflen);
#ifdef __cplusplus
-};
+}
#endif
-#endif // _FPDFDOC_H_
+#endif // PUBLIC_FPDF_DOC_H_
diff --git a/public/fpdf_edit.h b/public/fpdf_edit.h
index 18b816843a..d97fbdb5cb 100644
--- a/public/fpdf_edit.h
+++ b/public/fpdf_edit.h
@@ -1,18 +1,18 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef _FPDFEDIT_H_
-#define _FPDFEDIT_H_
+#ifndef PUBLIC_FPDF_EDIT_H_
+#define PUBLIC_FPDF_EDIT_H_
#include "fpdfview.h"
// Define all types used in the SDK. Note they can be simply regarded as opaque pointers
// or long integer numbers.
-#define FPDF_ARGB(a,r,g,b) ((((FX_DWORD)(((FX_BYTE)(b)|((FX_WORD)((FX_BYTE)(g))<<8))|(((FX_DWORD)(FX_BYTE)(r))<<16)))) | (((FX_DWORD)(FX_BYTE)(a))<<24))
+#define FPDF_ARGB(a,r,g,b) ((((FX_DWORD)(((FX_BYTE)(b)|((FX_WORD)((FX_BYTE)(g))<<8))|(((FX_DWORD)(FX_BYTE)(r))<<16)))) | (((FX_DWORD)(FX_BYTE)(a))<<24))
#define FPDF_GetBValue(argb) ((FX_BYTE)(argb))
#define FPDF_GetGValue(argb) ((FX_BYTE)(((FX_WORD)(argb)) >> 8))
#define FPDF_GetRValue(argb) ((FX_BYTE)((argb)>>16))
@@ -29,11 +29,11 @@ extern "C" {
//////////////////////////////////////////////////////////////////////
// Function: FPDF_CreateNewDocument
-// Create a new PDF document.
-// Parameters:
-// None.
+// Create a new PDF document.
+// Parameters:
+// None.
// Return value:
-// A handle to a document. If failed, NULL is returned.
+// A handle to a document. If failed, NULL is returned.
DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_CreateNewDocument();
//////////////////////////////////////////////////////////////////////
@@ -43,94 +43,94 @@ DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_CreateNewDocument();
//////////////////////////////////////////////////////////////////////
// Function: FPDFPage_New
-// Construct an empty page.
-// Parameters:
-// document - Handle to document. Returned by FPDF_LoadDocument and FPDF_CreateNewDocument.
-// page_index - The index of a page.
-// width - The page width.
-// height - The page height.
+// Construct an empty page.
+// Parameters:
+// document - Handle to document. Returned by FPDF_LoadDocument and FPDF_CreateNewDocument.
+// page_index - The index of a page.
+// width - The page width.
+// height - The page height.
// Return value:
-// The handle to the page.
+// The handle to the page.
// Comments:
-// Loaded page can be deleted by FPDFPage_Delete.
+// Loaded page can be deleted by FPDFPage_Delete.
DLLEXPORT FPDF_PAGE STDCALL FPDFPage_New(FPDF_DOCUMENT document, int page_index, double width, double height);
// Function: FPDFPage_Delete
-// Delete a PDF page.
-// Parameters:
-// document - Handle to document. Returned by FPDF_LoadDocument and FPDF_CreateNewDocument.
-// page_index - The index of a page.
+// Delete a PDF page.
+// Parameters:
+// document - Handle to document. Returned by FPDF_LoadDocument and FPDF_CreateNewDocument.
+// page_index - The index of a page.
// Return value:
-// None.
+// None.
DLLEXPORT void STDCALL FPDFPage_Delete(FPDF_DOCUMENT document, int page_index);
// Function: FPDFPage_GetRotation
-// Get the page rotation. One of following values will be returned: 0(0), 1(90), 2(180), 3(270).
-// Parameters:
-// page - Handle to a page. Returned by FPDFPage_New or FPDF_LoadPage.
+// Get the page rotation. One of following values will be returned: 0(0), 1(90), 2(180), 3(270).
+// Parameters:
+// page - Handle to a page. Returned by FPDFPage_New or FPDF_LoadPage.
// Return value:
-// The PDF page rotation.
+// The PDF page rotation.
// Comment:
-// The PDF page rotation is rotated clockwise.
+// The PDF page rotation is rotated clockwise.
DLLEXPORT int STDCALL FPDFPage_GetRotation(FPDF_PAGE page);
// Function: FPDFPage_SetRotation
-// Set page rotation. One of following values will be set: 0(0), 1(90), 2(180), 3(270).
-// Parameters:
-// page - Handle to a page. Returned by FPDFPage_New or FPDF_LoadPage.
-// rotate - The value of the PDF page rotation.
+// Set page rotation. One of following values will be set: 0(0), 1(90), 2(180), 3(270).
+// Parameters:
+// page - Handle to a page. Returned by FPDFPage_New or FPDF_LoadPage.
+// rotate - The value of the PDF page rotation.
// Return value:
-// None.
+// None.
// Comment:
-// The PDF page rotation is rotated clockwise.
-//
+// The PDF page rotation is rotated clockwise.
+//
DLLEXPORT void STDCALL FPDFPage_SetRotation(FPDF_PAGE page, int rotate);
// Function: FPDFPage_InsertObject
-// Insert an object to the page. The page object is automatically freed.
-// Parameters:
-// page - Handle to a page. Returned by FPDFPage_New or FPDF_LoadPage.
-// page_obj - Handle to a page object. Returned by FPDFPageObj_NewTextObj,FPDFPageObj_NewTextObjEx and
-// FPDFPageObj_NewPathObj.
+// Insert an object to the page. The page object is automatically freed.
+// Parameters:
+// page - Handle to a page. Returned by FPDFPage_New or FPDF_LoadPage.
+// page_obj - Handle to a page object. Returned by FPDFPageObj_NewTextObj,FPDFPageObj_NewTextObjEx and
+// FPDFPageObj_NewPathObj.
// Return value:
-// None.
+// None.
DLLEXPORT void STDCALL FPDFPage_InsertObject(FPDF_PAGE page, FPDF_PAGEOBJECT page_obj);
// Function: FPDFPage_CountObject
-// Get number of page objects inside the page.
-// Parameters:
-// page - Handle to a page. Returned by FPDFPage_New or FPDF_LoadPage.
+// Get number of page objects inside the page.
+// Parameters:
+// page - Handle to a page. Returned by FPDFPage_New or FPDF_LoadPage.
// Return value:
-// The number of the page object.
+// The number of the page object.
DLLEXPORT int STDCALL FPDFPage_CountObject(FPDF_PAGE page);
// Function: FPDFPage_GetObject
-// Get page object by index.
-// Parameters:
-// page - Handle to a page. Returned by FPDFPage_New or FPDF_LoadPage.
-// index - The index of a page object.
+// Get page object by index.
+// Parameters:
+// page - Handle to a page. Returned by FPDFPage_New or FPDF_LoadPage.
+// index - The index of a page object.
// Return value:
-// The handle of the page object. Null for failed.
+// The handle of the page object. Null for failed.
DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPage_GetObject(FPDF_PAGE page, int index);
// Function: FPDFPage_HasTransparency
-// Check that whether the content of specified PDF page contains transparency.
-// Parameters:
-// page - Handle to a page. Returned by FPDFPage_New or FPDF_LoadPage.
+// Check that whether the content of specified PDF page contains transparency.
+// Parameters:
+// page - Handle to a page. Returned by FPDFPage_New or FPDF_LoadPage.
// Return value:
-// TRUE means that the PDF page does contains transparency.
-// Otherwise, returns FALSE.
+// TRUE means that the PDF page does contains transparency.
+// Otherwise, returns FALSE.
DLLEXPORT FPDF_BOOL STDCALL FPDFPage_HasTransparency(FPDF_PAGE page);
// Function: FPDFPage_GenerateContent
-// Generate PDF Page content.
-// Parameters:
-// page - Handle to a page. Returned by FPDFPage_New or FPDF_LoadPage.
+// Generate PDF Page content.
+// Parameters:
+// page - Handle to a page. Returned by FPDFPage_New or FPDF_LoadPage.
// Return value:
-// True if successful, false otherwise.
+// True if successful, false otherwise.
// Comment:
-// Before you save the page to a file, or reload the page, you must call the FPDFPage_GenerateContent function.
-// Or the changed information will be lost.
+// Before you save the page to a file, or reload the page, you must call the FPDFPage_GenerateContent function.
+// Or the changed information will be lost.
DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GenerateContent(FPDF_PAGE page);
//////////////////////////////////////////////////////////////////////
@@ -140,50 +140,50 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GenerateContent(FPDF_PAGE page);
//////////////////////////////////////////////////////////////////////
// Function: FPDFPageObj_HasTransparency
-// Check that whether the specified PDF page object contains transparency.
-// Parameters:
-// pageObject - Handle to a page object.
+// Check that whether the specified PDF page object contains transparency.
+// Parameters:
+// pageObject - Handle to a page object.
// Return value:
-// TRUE means that the PDF page object does contains transparency.
-// Otherwise, returns FALSE.
+// TRUE means that the PDF page object does contains transparency.
+// Otherwise, returns FALSE.
DLLEXPORT FPDF_BOOL STDCALL FPDFPageObj_HasTransparency(FPDF_PAGEOBJECT pageObject);
// Function: FPDFPageObj_Transform
-// Transform (scale, rotate, shear, move) page object.
-// Parameters:
-// page_object - Handle to a page object. Returned by FPDFPageObj_NewImageObj.
-// a - The coefficient "a" of the matrix.
-// b - The coefficient "b" of the matrix.
-// c - The coefficient "c" of the matrix.
-// d - The coefficient "d" of the matrix.
-// e - The coefficient "e" of the matrix.
-// f - The coefficient "f" of the matrix.
+// Transform (scale, rotate, shear, move) page object.
+// Parameters:
+// page_object - Handle to a page object. Returned by FPDFPageObj_NewImageObj.
+// a - The coefficient "a" of the matrix.
+// b - The coefficient "b" of the matrix.
+// c - The coefficient "c" of the matrix.
+// d - The coefficient "d" of the matrix.
+// e - The coefficient "e" of the matrix.
+// f - The coefficient "f" of the matrix.
// Return value:
-// None.
+// None.
DLLEXPORT void STDCALL FPDFPageObj_Transform(FPDF_PAGEOBJECT page_object,
- double a, double b, double c, double d, double e, double f);
+ double a, double b, double c, double d, double e, double f);
// Function: FPDFPage_TransformAnnots
-// Transform (scale, rotate, shear, move) all annots in a page.
-// Parameters:
-// page - Handle to a page.
-// a - The coefficient "a" of the matrix.
-// b - The coefficient "b" of the matrix.
-// c - The coefficient "c" of the matrix.
-// d - The coefficient "d" of the matrix.
-// e - The coefficient "e" of the matrix.
-// f - The coefficient "f" of the matrix.
+// Transform (scale, rotate, shear, move) all annots in a page.
+// Parameters:
+// page - Handle to a page.
+// a - The coefficient "a" of the matrix.
+// b - The coefficient "b" of the matrix.
+// c - The coefficient "c" of the matrix.
+// d - The coefficient "d" of the matrix.
+// e - The coefficient "e" of the matrix.
+// f - The coefficient "f" of the matrix.
// Return value:
-// None.
+// None.
DLLEXPORT void STDCALL FPDFPage_TransformAnnots(FPDF_PAGE page,
- double a, double b, double c, double d, double e, double f);
+ double a, double b, double c, double d, double e, double f);
// The page object constants.
-#define FPDF_PAGEOBJ_TEXT 1
-#define FPDF_PAGEOBJ_PATH 2
-#define FPDF_PAGEOBJ_IMAGE 3
-#define FPDF_PAGEOBJ_SHADING 4
-#define FPDF_PAGEOBJ_FORM 5
+#define FPDF_PAGEOBJ_TEXT 1
+#define FPDF_PAGEOBJ_PATH 2
+#define FPDF_PAGEOBJ_IMAGE 3
+#define FPDF_PAGEOBJ_SHADING 4
+#define FPDF_PAGEOBJ_FORM 5
//////////////////////////////////////////////////////////////////////
//
@@ -192,56 +192,57 @@ DLLEXPORT void STDCALL FPDFPage_TransformAnnots(FPDF_PAGE page,
//////////////////////////////////////////////////////////////////////
// Function: FPDFPageObj_NewImgeObj
-// Create a new Image Object.
+// Create a new Image Object.
// Parameters:
-// document - Handle to document. Returned by FPDF_LoadDocument or FPDF_CreateNewDocument function.
+// document - Handle to document. Returned by FPDF_LoadDocument or FPDF_CreateNewDocument function.
// Return Value:
-// Handle of image object.
+// Handle of image object.
DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_NewImgeObj(FPDF_DOCUMENT document);
// Function: FPDFImageObj_LoadJpegFile
-// Load Image from a JPEG image file and then set it to an image object.
-// Parameters:
-// pages - Pointers to the start of all loaded pages, could be NULL.
-// nCount - Number of pages, could be 0.
-// image_object - Handle of image object returned by FPDFPageObj_NewImgeObj.
-// fileAccess - The custom file access handler, which specifies the JPEG image file.
-// Return Value:
-// TRUE if successful, FALSE otherwise.
-// Note:
-// The image object might already has an associated image, which is shared and cached by the loaded pages, In this case, we need to clear the cache of image for all the loaded pages.
-// Pass pages and count to this API to clear the image cache.
+// Load Image from a JPEG image file and then set it to an image object.
+// Parameters:
+// pages - Pointers to the start of all loaded pages, could be NULL.
+// nCount - Number of pages, could be 0.
+// image_object - Handle of image object returned by FPDFPageObj_NewImgeObj.
+// fileAccess - The custom file access handler, which specifies the JPEG image file.
+// Return Value:
+// TRUE if successful, FALSE otherwise.
+// Note:
+// The image object might already has an associated image, which is shared and cached by the loaded pages, In this case, we need to clear the cache of image for all the loaded pages.
+// Pass pages and count to this API to clear the image cache.
DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages, int nCount,FPDF_PAGEOBJECT image_object, FPDF_FILEACCESS* fileAccess);
// Function: FPDFImageObj_SetMatrix
-// Set the matrix of an image object.
-// Parameters:
-// image_object - Handle of image object returned by FPDFPageObj_NewImgeObj.
-// a - The coefficient "a" of the matrix.
-// b - The coefficient "b" of the matrix.
-// c - The coefficient "c" of the matrix.
-// d - The coefficient "d" of the matrix.
-// e - The coefficient "e" of the matrix.
-// f - The coefficient "f" of the matrix.
+// Set the matrix of an image object.
+// Parameters:
+// image_object - Handle of image object returned by FPDFPageObj_NewImgeObj.
+// a - The coefficient "a" of the matrix.
+// b - The coefficient "b" of the matrix.
+// c - The coefficient "c" of the matrix.
+// d - The coefficient "d" of the matrix.
+// e - The coefficient "e" of the matrix.
+// f - The coefficient "f" of the matrix.
// Return value:
-// TRUE if successful, FALSE otherwise.
+// TRUE if successful, FALSE otherwise.
DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetMatrix(FPDF_PAGEOBJECT image_object,
- double a, double b, double c, double d, double e, double f);
+ double a, double b, double c, double d, double e, double f);
// Function: FPDFImageObj_SetBitmap
-// Set the bitmap to an image object.
+// Set the bitmap to an image object.
// Parameters:
-// pages - Pointer's to the start of all loaded pages.
-// nCount - Number of pages.
-// image_object - Handle of image object returned by FPDFPageObj_NewImgeObj.
-// bitmap - The handle of the bitmap which you want to set it to the image object.
+// pages - Pointer's to the start of all loaded pages.
+// nCount - Number of pages.
+// image_object - Handle of image object returned by FPDFPageObj_NewImgeObj.
+// bitmap - The handle of the bitmap which you want to set it to the image object.
// Return value:
-// TRUE if successful, FALSE otherwise.
+// TRUE if successful, FALSE otherwise.
DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetBitmap(FPDF_PAGE* pages,int nCount,FPDF_PAGEOBJECT image_object, FPDF_BITMAP bitmap);
#ifdef __cplusplus
}
#endif
-#endif // _FPDFEDIT_H_
+
+#endif // PUBLIC_FPDF_EDIT_H_
diff --git a/public/fpdf_ext.h b/public/fpdf_ext.h
index a67ac2eacf..8016d2ebc4 100644
--- a/public/fpdf_ext.h
+++ b/public/fpdf_ext.h
@@ -1,108 +1,106 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef _FPDF_EXT_H_
-#define _FPDF_EXT_H_
+#ifndef PUBLIC_FPDF_EXT_H_
+#define PUBLIC_FPDF_EXT_H_
-#ifndef _FPDFVIEW_H_
#include "fpdfview.h"
-#endif
#ifdef __cplusplus
extern "C" {
#endif
//flags for type of unsupport object.
-#define FPDF_UNSP_DOC_XFAFORM 1
-#define FPDF_UNSP_DOC_PORTABLECOLLECTION 2
-#define FPDF_UNSP_DOC_ATTACHMENT 3
-#define FPDF_UNSP_DOC_SECURITY 4
-#define FPDF_UNSP_DOC_SHAREDREVIEW 5
-#define FPDF_UNSP_DOC_SHAREDFORM_ACROBAT 6
-#define FPDF_UNSP_DOC_SHAREDFORM_FILESYSTEM 7
-#define FPDF_UNSP_DOC_SHAREDFORM_EMAIL 8
-#define FPDF_UNSP_ANNOT_3DANNOT 11
-#define FPDF_UNSP_ANNOT_MOVIE 12
-#define FPDF_UNSP_ANNOT_SOUND 13
-#define FPDF_UNSP_ANNOT_SCREEN_MEDIA 14
-#define FPDF_UNSP_ANNOT_SCREEN_RICHMEDIA 15
-#define FPDF_UNSP_ANNOT_ATTACHMENT 16
-#define FPDF_UNSP_ANNOT_SIG 17
-
-typedef struct _UNSUPPORT_INFO
+#define FPDF_UNSP_DOC_XFAFORM 1
+#define FPDF_UNSP_DOC_PORTABLECOLLECTION 2
+#define FPDF_UNSP_DOC_ATTACHMENT 3
+#define FPDF_UNSP_DOC_SECURITY 4
+#define FPDF_UNSP_DOC_SHAREDREVIEW 5
+#define FPDF_UNSP_DOC_SHAREDFORM_ACROBAT 6
+#define FPDF_UNSP_DOC_SHAREDFORM_FILESYSTEM 7
+#define FPDF_UNSP_DOC_SHAREDFORM_EMAIL 8
+#define FPDF_UNSP_ANNOT_3DANNOT 11
+#define FPDF_UNSP_ANNOT_MOVIE 12
+#define FPDF_UNSP_ANNOT_SOUND 13
+#define FPDF_UNSP_ANNOT_SCREEN_MEDIA 14
+#define FPDF_UNSP_ANNOT_SCREEN_RICHMEDIA 15
+#define FPDF_UNSP_ANNOT_ATTACHMENT 16
+#define FPDF_UNSP_ANNOT_SIG 17
+
+typedef struct _UNSUPPORT_INFO
{
- /**
- * Version number of the interface. Currently must be 1.
- **/
- int version;
-
- /**
- * Method: FSDK_UnSupport_Handler
- * UnSupport Object process handling function.
- * Interface Version:
- * 1
- * Implementation Required:
- * Yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * nType - The type of unsupportObject
- * Return value:
- * None.
- * */
-
- void(*FSDK_UnSupport_Handler)(struct _UNSUPPORT_INFO* pThis, int nType);
+ /**
+ * Version number of the interface. Currently must be 1.
+ **/
+ int version;
+
+ /**
+ * Method: FSDK_UnSupport_Handler
+ * UnSupport Object process handling function.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * Yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * nType - The type of unsupportObject
+ * Return value:
+ * None.
+ * */
+
+ void(*FSDK_UnSupport_Handler)(struct _UNSUPPORT_INFO* pThis, int nType);
} UNSUPPORT_INFO;
-
/**
* Function: FSDK_SetUnSpObjProcessHandler
- * Setup A UnSupport Object process handler for foxit sdk.
+ * Setup A UnSupport Object process handler for foxit sdk.
* Parameters:
- * unsp_info - Pointer to a UNSUPPORT_INFO structure.
+ * unsp_info - Pointer to a UNSUPPORT_INFO structure.
* Return Value:
- * TRUE means successful. FALSE means fails.
+ * TRUE means successful. FALSE means fails.
**/
DLLEXPORT FPDF_BOOL STDCALL FSDK_SetUnSpObjProcessHandler(UNSUPPORT_INFO* unsp_info);
-//flags for page mode.
+//flags for page mode.
//Unknown value
-#define PAGEMODE_UNKNOWN -1
+#define PAGEMODE_UNKNOWN -1
//Neither document outline nor thumbnail images visible
-#define PAGEMODE_USENONE 0
+#define PAGEMODE_USENONE 0
//Document outline visible
-#define PAGEMODE_USEOUTLINES 1
+#define PAGEMODE_USEOUTLINES 1
//Thumbnial images visible
-#define PAGEMODE_USETHUMBS 2
+#define PAGEMODE_USETHUMBS 2
//Full-screen mode, with no menu bar, window controls, or any other window visible
-#define PAGEMODE_FULLSCREEN 3
+#define PAGEMODE_FULLSCREEN 3
//Optional content group panel visible
-#define PAGEMODE_USEOC 4
+#define PAGEMODE_USEOC 4
//Attachments panel visible
-#define PAGEMODE_USEATTACHMENTS 5
+#define PAGEMODE_USEATTACHMENTS 5
/**
* Function: FPDFDoc_GetPageMode
- * Get the document's PageMode(How the document should be displayed when opened)
+ * Get the document's PageMode(How the document should be displayed when opened)
* Parameters:
- * doc - Handle to document. Returned by FPDF_LoadDocument function.
+ * doc - Handle to document. Returned by FPDF_LoadDocument function.
* Return Value:
- * The flags for page mode.
+ * The flags for page mode.
**/
DLLEXPORT int FPDFDoc_GetPageMode(FPDF_DOCUMENT document);
#ifdef __cplusplus
-};
-#endif
+}
#endif
+
+#endif // PUBLIC_FPDF_EXT_H_
diff --git a/public/fpdf_flatten.h b/public/fpdf_flatten.h
index 2e9e5092f9..0c8322e697 100644
--- a/public/fpdf_flatten.h
+++ b/public/fpdf_flatten.h
@@ -1,42 +1,42 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef _FPDF_FLATTEN_H_
-#define _FPDF_FLATTEN_H_
-
+#ifndef PUBLIC_FPDF_FLATTEN_H_
+#define PUBLIC_FPDF_FLATTEN_H_
+
#include "fpdfview.h"
-#define FLATTEN_FAIL 0 // Flatten operation failed.
-#define FLATTEN_SUCCESS 1 // Flatten operation succeed.
-#define FLATTEN_NOTINGTODO 2 // There is nothing can be flatten.
-
+#define FLATTEN_FAIL 0 // Flatten operation failed.
+#define FLATTEN_SUCCESS 1 // Flatten operation succeed.
+#define FLATTEN_NOTINGTODO 2 // There is nothing can be flatten.
+
#ifdef __cplusplus
extern "C" {
#endif
#define FLAT_NORMALDISPLAY 0
-#define FLAT_PRINT 1
- //Function: FPDFPage_Flatten
-
- // Flat a pdf page,annotations or form fields will become part of the page contents.
- //Parameters:
-
- // page - Handle to the page. Returned by FPDF_LoadPage function.
- // nFlag - the flag for the use of flatten result. Zero for normal display, 1 for print.
- //Return value:
- // The result flag of the function, See flags above ( FLATTEN_FAIL, FLATTEN_SUCCESS, FLATTEN_NOTINGTODO ).
- //
- // Comments: Current version all fails return zero. If necessary we will assign different value
- // to indicate different fail reason.
- //
- DLLEXPORT int STDCALL FPDFPage_Flatten( FPDF_PAGE page, int nFlag);
-
-
+#define FLAT_PRINT 1
+ //Function: FPDFPage_Flatten
+
+ // Flat a pdf page,annotations or form fields will become part of the page contents.
+ //Parameters:
+
+ // page - Handle to the page. Returned by FPDF_LoadPage function.
+ // nFlag - the flag for the use of flatten result. Zero for normal display, 1 for print.
+ //Return value:
+ // The result flag of the function, See flags above ( FLATTEN_FAIL, FLATTEN_SUCCESS, FLATTEN_NOTINGTODO ).
+ //
+ // Comments: Current version all fails return zero. If necessary we will assign different value
+ // to indicate different fail reason.
+ //
+ DLLEXPORT int STDCALL FPDFPage_Flatten( FPDF_PAGE page, int nFlag);
+
+
#ifdef __cplusplus
-};
+}
#endif
-#endif //_FPDF_FLATTEN_H_
+#endif // PUBLIC_FPDF_FLATTEN_H_
diff --git a/public/fpdf_formfill.h b/public/fpdf_formfill.h
index 9819359892..a1b9ec2a77 100644
--- a/public/fpdf_formfill.h
+++ b/public/fpdf_formfill.h
@@ -1,12 +1,12 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#ifndef PUBLIC_FPDF_FORMFILL_H_
+#define PUBLIC_FPDF_FORMFILL_H_
-#ifndef _FPDFORMFILL_H
-#define _FPDFORMFILL_H
#include "fpdfview.h"
typedef void* FPDF_FORMHANDLE;
@@ -20,515 +20,515 @@ typedef struct _IPDF_JsPlatform
{
/**
* Version number of the interface. Currently must be 1.
- **/
- int version;
-
- /**
- * Method: app_alert
- * pop up a dialog to show warning or hint.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * Msg - A string containing the message to be displayed.
- * Title - The title of the dialog.
- * Type - The stype of button group.
- * 0-OK(default);
- * 1-OK,Cancel;
- * 2-Yes,NO;
- * 3-Yes, NO, Cancel.
- * nIcon - The Icon type.
- * 0-Error(default);
- * 1-Warning;
- * 2-Question;
- * 3-Status.
- * Return Value:
- * The return value could be the folowing type:
- * 1-OK;
- * 2-Cancel;
- * 3-NO;
- * 4-Yes;
- */
- int (*app_alert)(struct _IPDF_JsPlatform* pThis, FPDF_WIDESTRING Msg, FPDF_WIDESTRING Title, int Type, int Icon);
-
- /**
- * Method: app_beep
- * Causes the system to play a sound.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * nType - The sound type.
- * 0 - Error
- * 1 - Warning
- * 2 - Question
- * 3 - Status
- * 4 - Default (default value)
- * Return Value:
- * None
- */
- void (*app_beep)(struct _IPDF_JsPlatform* pThis, int nType);
-
- /**
- * Method: app_response
- * Displays a dialog box containing a question and an entry field for the user to reply to the question.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * Question - The question to be posed to the user.
- * Title - The title of the dialog box.
- * Default - A default value for the answer to the question. If not specified, no default value is presented.
- * cLabel - A short string to appear in front of and on the same line as the edit text field.
- * bPassword - If true, indicates that the user's response should show as asterisks (*) or bullets (?) to mask the response, which might be sensitive information. The default is false.
- * response - A string buffer allocated by SDK, to receive the user's response.
- * length - The length of the buffer, number of bytes. Currently, It's always be 2048.
- * Return Value:
- * Number of bytes the complete user input would actually require, not including trailing zeros, regardless of the value of the length
- * parameter or the presence of the response buffer.
- * Comments:
- * No matter on what platform, the response buffer should be always written using UTF-16LE encoding. If a response buffer is
- * present and the size of the user input exceeds the capacity of the buffer as specified by the length parameter, only the
- * first "length" bytes of the user input are to be written to the buffer.
- */
- int (*app_response)(struct _IPDF_JsPlatform* pThis, FPDF_WIDESTRING Question, FPDF_WIDESTRING Title, FPDF_WIDESTRING Default, FPDF_WIDESTRING cLabel, FPDF_BOOL bPassword, void* response, int length);
-
- /*
- * Method: Doc_getFilePath
- * Get the file path of the current document.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * filePath - The string buffer to receive the file path. Can be NULL.
- * length - The length of the buffer, number of bytes. Can be 0.
- * Return Value:
- * Number of bytes the filePath consumes, including trailing zeros.
- * Comments:
- * The filePath should be always input in local encoding.
- *
- * The return value always indicated number of bytes required for the buffer, even when there is
- * no buffer specified, or the buffer size is less then required. In this case, the buffer will not
- * be modified.
- */
- int (*Doc_getFilePath)(struct _IPDF_JsPlatform* pThis, void* filePath, int length);
-
-
- /*
- * Method: Doc_mail
- * Mails the data buffer as an attachment to all recipients, with or without user interaction.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * mailData - Pointer to the data buffer to be sent.Can be NULL.
- * length - The size,in bytes, of the buffer pointed by mailData parameter.Can be 0.
- * bUI - If true, the rest of the parameters are used in a compose-new-message window that is displayed to the user. If false, the cTo parameter is required and all others are optional.
- * To - A semicolon-delimited list of recipients for the message.
- * Subject - The subject of the message. The length limit is 64 KB.
- * CC - A semicolon-delimited list of CC recipients for the message.
- * BCC - A semicolon-delimited list of BCC recipients for the message.
- * Msg - The content of the message. The length limit is 64 KB.
- * Return Value:
- * None.
- * Comments:
- * If the parameter mailData is NULL or length is 0, the current document will be mailed as an attachment to all recipients.
- */
- void (*Doc_mail)(struct _IPDF_JsPlatform* pThis,void* mailData, int length,FPDF_BOOL bUI, FPDF_WIDESTRING To, FPDF_WIDESTRING Subject, FPDF_WIDESTRING CC, FPDF_WIDESTRING BCC, FPDF_WIDESTRING Msg);
-
-
- /*
- * Method: Doc_print
- * Prints all or a specific number of pages of the document.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * bUI - If true, will cause a UI to be presented to the user to obtain printing information and confirm the action.
- * nStart - A 0-based index that defines the start of an inclusive range of pages.
- * nEnd - A 0-based index that defines the end of an inclusive page range.
- * bSilent - If true, suppresses the cancel dialog box while the document is printing. The default is false.
- * bShrinkToFit - If true, the page is shrunk (if necessary) to fit within the imageable area of the printed page.
- * bPrintAsImage - If true, print pages as an image.
- * bReverse - If true, print from nEnd to nStart.
- * bAnnotations - If true (the default), annotations are printed.
- */
- void (*Doc_print)(struct _IPDF_JsPlatform* pThis, FPDF_BOOL bUI, int nStart, int nEnd, FPDF_BOOL bSilent ,FPDF_BOOL bShrinkToFit,FPDF_BOOL bPrintAsImage ,FPDF_BOOL bReverse ,FPDF_BOOL bAnnotations);
-
- /*
- * Method: Doc_submitForm
- * Send the form data to a specified URL.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * formData - Pointer to the data buffer to be sent.
- * length - The size,in bytes, of the buffer pointed by formData parameter.
- * URL - The URL to send to.
- * Return Value:
- * None.
- *
- */
- void (*Doc_submitForm)(struct _IPDF_JsPlatform* pThis,void* formData, int length, FPDF_WIDESTRING URL);
-
- /*
- * Method: Doc_gotoPage
- * Jump to a specified page.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * nPageNum - The specified page number, zero for the first page.
- * Return Value:
- * None.
- *
- */
- void (*Doc_gotoPage)(struct _IPDF_JsPlatform* pThis, int nPageNum);
- /*
- * Method: Field_browse
- * Show a file selection dialog, and return the selected file path.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * filePath - Pointer to the data buffer to receive the file path.Can be NULL.
- * length - The length of the buffer, number of bytes. Can be 0.
- * Return Value:
- * Number of bytes the filePath consumes, including trailing zeros.
- * Comments:
- * The filePath shoule be always input in local encoding.
- */
- int (*Field_browse)(struct _IPDF_JsPlatform* pThis,void* filePath, int length);
-
- /**
- * pointer to FPDF_FORMFILLINFO interface.
- **/
- void* m_pFormfillinfo;
+ **/
+ int version;
+
+ /**
+ * Method: app_alert
+ * pop up a dialog to show warning or hint.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * Msg - A string containing the message to be displayed.
+ * Title - The title of the dialog.
+ * Type - The stype of button group.
+ * 0-OK(default);
+ * 1-OK,Cancel;
+ * 2-Yes,NO;
+ * 3-Yes, NO, Cancel.
+ * nIcon - The Icon type.
+ * 0-Error(default);
+ * 1-Warning;
+ * 2-Question;
+ * 3-Status.
+ * Return Value:
+ * The return value could be the folowing type:
+ * 1-OK;
+ * 2-Cancel;
+ * 3-NO;
+ * 4-Yes;
+ */
+ int (*app_alert)(struct _IPDF_JsPlatform* pThis, FPDF_WIDESTRING Msg, FPDF_WIDESTRING Title, int Type, int Icon);
+
+ /**
+ * Method: app_beep
+ * Causes the system to play a sound.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * nType - The sound type.
+ * 0 - Error
+ * 1 - Warning
+ * 2 - Question
+ * 3 - Status
+ * 4 - Default (default value)
+ * Return Value:
+ * None
+ */
+ void (*app_beep)(struct _IPDF_JsPlatform* pThis, int nType);
+
+ /**
+ * Method: app_response
+ * Displays a dialog box containing a question and an entry field for the user to reply to the question.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * Question - The question to be posed to the user.
+ * Title - The title of the dialog box.
+ * Default - A default value for the answer to the question. If not specified, no default value is presented.
+ * cLabel - A short string to appear in front of and on the same line as the edit text field.
+ * bPassword - If true, indicates that the user's response should show as asterisks (*) or bullets (?) to mask the response, which might be sensitive information. The default is false.
+ * response - A string buffer allocated by SDK, to receive the user's response.
+ * length - The length of the buffer, number of bytes. Currently, It's always be 2048.
+ * Return Value:
+ * Number of bytes the complete user input would actually require, not including trailing zeros, regardless of the value of the length
+ * parameter or the presence of the response buffer.
+ * Comments:
+ * No matter on what platform, the response buffer should be always written using UTF-16LE encoding. If a response buffer is
+ * present and the size of the user input exceeds the capacity of the buffer as specified by the length parameter, only the
+ * first "length" bytes of the user input are to be written to the buffer.
+ */
+ int (*app_response)(struct _IPDF_JsPlatform* pThis, FPDF_WIDESTRING Question, FPDF_WIDESTRING Title, FPDF_WIDESTRING Default, FPDF_WIDESTRING cLabel, FPDF_BOOL bPassword, void* response, int length);
+
+ /*
+ * Method: Doc_getFilePath
+ * Get the file path of the current document.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * filePath - The string buffer to receive the file path. Can be NULL.
+ * length - The length of the buffer, number of bytes. Can be 0.
+ * Return Value:
+ * Number of bytes the filePath consumes, including trailing zeros.
+ * Comments:
+ * The filePath should be always input in local encoding.
+ *
+ * The return value always indicated number of bytes required for the buffer, even when there is
+ * no buffer specified, or the buffer size is less then required. In this case, the buffer will not
+ * be modified.
+ */
+ int (*Doc_getFilePath)(struct _IPDF_JsPlatform* pThis, void* filePath, int length);
+
+
+ /*
+ * Method: Doc_mail
+ * Mails the data buffer as an attachment to all recipients, with or without user interaction.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * mailData - Pointer to the data buffer to be sent.Can be NULL.
+ * length - The size,in bytes, of the buffer pointed by mailData parameter.Can be 0.
+ * bUI - If true, the rest of the parameters are used in a compose-new-message window that is displayed to the user. If false, the cTo parameter is required and all others are optional.
+ * To - A semicolon-delimited list of recipients for the message.
+ * Subject - The subject of the message. The length limit is 64 KB.
+ * CC - A semicolon-delimited list of CC recipients for the message.
+ * BCC - A semicolon-delimited list of BCC recipients for the message.
+ * Msg - The content of the message. The length limit is 64 KB.
+ * Return Value:
+ * None.
+ * Comments:
+ * If the parameter mailData is NULL or length is 0, the current document will be mailed as an attachment to all recipients.
+ */
+ void (*Doc_mail)(struct _IPDF_JsPlatform* pThis,void* mailData, int length,FPDF_BOOL bUI, FPDF_WIDESTRING To, FPDF_WIDESTRING Subject, FPDF_WIDESTRING CC, FPDF_WIDESTRING BCC, FPDF_WIDESTRING Msg);
+
+
+ /*
+ * Method: Doc_print
+ * Prints all or a specific number of pages of the document.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * bUI - If true, will cause a UI to be presented to the user to obtain printing information and confirm the action.
+ * nStart - A 0-based index that defines the start of an inclusive range of pages.
+ * nEnd - A 0-based index that defines the end of an inclusive page range.
+ * bSilent - If true, suppresses the cancel dialog box while the document is printing. The default is false.
+ * bShrinkToFit - If true, the page is shrunk (if necessary) to fit within the imageable area of the printed page.
+ * bPrintAsImage - If true, print pages as an image.
+ * bReverse - If true, print from nEnd to nStart.
+ * bAnnotations - If true (the default), annotations are printed.
+ */
+ void (*Doc_print)(struct _IPDF_JsPlatform* pThis, FPDF_BOOL bUI, int nStart, int nEnd, FPDF_BOOL bSilent ,FPDF_BOOL bShrinkToFit,FPDF_BOOL bPrintAsImage ,FPDF_BOOL bReverse ,FPDF_BOOL bAnnotations);
+
+ /*
+ * Method: Doc_submitForm
+ * Send the form data to a specified URL.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * formData - Pointer to the data buffer to be sent.
+ * length - The size,in bytes, of the buffer pointed by formData parameter.
+ * URL - The URL to send to.
+ * Return Value:
+ * None.
+ *
+ */
+ void (*Doc_submitForm)(struct _IPDF_JsPlatform* pThis,void* formData, int length, FPDF_WIDESTRING URL);
+
+ /*
+ * Method: Doc_gotoPage
+ * Jump to a specified page.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * nPageNum - The specified page number, zero for the first page.
+ * Return Value:
+ * None.
+ *
+ */
+ void (*Doc_gotoPage)(struct _IPDF_JsPlatform* pThis, int nPageNum);
+ /*
+ * Method: Field_browse
+ * Show a file selection dialog, and return the selected file path.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * filePath - Pointer to the data buffer to receive the file path.Can be NULL.
+ * length - The length of the buffer, number of bytes. Can be 0.
+ * Return Value:
+ * Number of bytes the filePath consumes, including trailing zeros.
+ * Comments:
+ * The filePath shoule be always input in local encoding.
+ */
+ int (*Field_browse)(struct _IPDF_JsPlatform* pThis,void* filePath, int length);
+
+ /**
+ * pointer to FPDF_FORMFILLINFO interface.
+ **/
+ void* m_pFormfillinfo;
} IPDF_JSPLATFORM;
// Flags for Cursor type
-#define FXCT_ARROW 0
-#define FXCT_NESW 1
-#define FXCT_NWSE 2
-#define FXCT_VBEAM 3
-#define FXCT_HBEAM 4
-#define FXCT_HAND 5
+#define FXCT_ARROW 0
+#define FXCT_NESW 1
+#define FXCT_NWSE 2
+#define FXCT_VBEAM 3
+#define FXCT_HBEAM 4
+#define FXCT_HAND 5
/**
* Declares of a pointer type to the callback function for the FFI_SetTimer method.
* Parameters:
- * idEvent - Identifier of the timer.
+ * idEvent - Identifier of the timer.
* Return value:
- * None.
- **/
-typedef void (*TimerCallback)(int idEvent);
+ * None.
+ **/
+typedef void (*TimerCallback)(int idEvent);
/**
* Declares of a struct type to the local system time.
**/
-typedef struct _FPDF_SYSTEMTIME
+typedef struct _FPDF_SYSTEMTIME
{
- unsigned short wYear; /* years since 1900 */
- unsigned short wMonth; /* months since January - [0,11] */
- unsigned short wDayOfWeek; /* days since Sunday - [0,6] */
- unsigned short wDay; /* day of the month - [1,31] */
- unsigned short wHour; /* hours since midnight - [0,23] */
- unsigned short wMinute; /* minutes after the hour - [0,59] */
- unsigned short wSecond; /* seconds after the minute - [0,59] */
- unsigned short wMilliseconds; /* milliseconds after the second - [0,999] */
+ unsigned short wYear; /* years since 1900 */
+ unsigned short wMonth; /* months since January - [0,11] */
+ unsigned short wDayOfWeek; /* days since Sunday - [0,6] */
+ unsigned short wDay; /* day of the month - [1,31] */
+ unsigned short wHour; /* hours since midnight - [0,23] */
+ unsigned short wMinute; /* minutes after the hour - [0,59] */
+ unsigned short wSecond; /* seconds after the minute - [0,59] */
+ unsigned short wMilliseconds; /* milliseconds after the second - [0,999] */
}FPDF_SYSTEMTIME;
typedef struct _FPDF_FORMFILLINFO
{
- /**
- * Version number of the interface. Currently must be 1.
- **/
- int version;
-
- /**
- * Method: Release
- * Give implementation a chance to release any data after the interface is no longer used
- * Interface Version:
- * 1
- * Implementation Required:
- * No
- * Comments:
- * Called by Foxit SDK during the final cleanup process.
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * Return Value:
- * None
- */
-
- void (*Release)(struct _FPDF_FORMFILLINFO* pThis);
-
- /**
- * Method: FFI_Invalidate
- * Invalidate the client area within the specified rectangle.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * page - Handle to the page. Returned by FPDF_LoadPage function.
- * left - Left position of the client area in PDF page coordinate.
- * top - Top position of the client area in PDF page coordinate.
- * right - Right position of the client area in PDF page coordinate.
- * bottom - Bottom position of the client area in PDF page coordinate.
- * Return Value:
- * None.
- *
- *comments:
- * All positions are measured in PDF "user space".
- * Implementation should call FPDF_RenderPageBitmap() function for repainting a specified page area.
- */
- void (*FFI_Invalidate)(struct _FPDF_FORMFILLINFO* pThis,FPDF_PAGE page, double left, double top, double right, double bottom);
-
- /**
- * Method: FFI_OutputSelectedRect
- * When user is taking the mouse to select texts on a form field, this callback function will keep
- * returning the selected areas to the implementation.
- *
- * Interface Version:
- * 1
- * Implementation Required:
- * No
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * page - Handle to the page. Returned by FPDF_LoadPage function.
- * left - Left position of the client area in PDF page coordinate.
- * top - Top position of the client area in PDF page coordinate.
- * right - Right position of the client area in PDF page coordinate.
- * bottom - Bottom position of the client area in PDF page coordinate.
- * Return Value:
- * None.
- *
- * comments:
- * This CALLBACK function is useful for implementing special text selection effect. Implementation should
- * first records the returned rectangles, then draw them one by one at the painting period, last,remove all
- * the recorded rectangles when finish painting.
- */
- void (*FFI_OutputSelectedRect)(struct _FPDF_FORMFILLINFO* pThis,FPDF_PAGE page, double left, double top, double right, double bottom);
-
- /**
- * Method: FFI_SetCursor
- * Set the Cursor shape.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * nCursorType - Cursor type. see Flags for Cursor type for the details.
- * Return value:
- * None.
- * */
- void (*FFI_SetCursor)(struct _FPDF_FORMFILLINFO* pThis, int nCursorType);
-
- /**
- * Method: FFI_SetTimer
- * This method installs a system timer. A time-out value is specified,
- * and every time a time-out occurs, the system passes a message to
- * the TimerProc callback function.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * uElapse - Specifies the time-out value, in milliseconds.
- * lpTimerFunc - A pointer to the callback function-TimerCallback.
- * Return value:
- * The timer identifier of the new timer if the function is successful.
- * An application passes this value to the FFI_KillTimer method to kill
- * the timer. Nonzero if it is successful; otherwise, it is zero.
- * */
- int (*FFI_SetTimer)(struct _FPDF_FORMFILLINFO* pThis, int uElapse, TimerCallback lpTimerFunc);
-
- /**
- * Method: FFI_KillTimer
- * This method kills the timer event identified by nIDEvent, set by an earlier call to FFI_SetTimer.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * nTimerID - The timer ID return by FFI_SetTimer function.
- * Return value:
- * None.
- * */
- void (*FFI_KillTimer)(struct _FPDF_FORMFILLINFO* pThis, int nTimerID);
-
-
- /**
- * Method: FFI_GetLocalTime
- * This method receives the current local time on the system.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * Return value:
- * None.
- * */
- FPDF_SYSTEMTIME (*FFI_GetLocalTime)(struct _FPDF_FORMFILLINFO* pThis);
-
- /**
- * Method: FFI_OnChange
- * This method will be invoked to notify implementation when the value of any FormField on the document had been changed.
- * Interface Version:
- * 1
- * Implementation Required:
- * no
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * Return value:
- * None.
- * */
- void (*FFI_OnChange)(struct _FPDF_FORMFILLINFO* pThis);
-
- /**
- * Method: FFI_GetPage
- * This method receives the page pointer associated with a specified page index.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * document - Handle to document. Returned by FPDF_LoadDocument function.
- * nPageIndex - Index number of the page. 0 for the first page.
- * Return value:
- * Handle to the page. Returned by FPDF_LoadPage function.
- * Comments:
- * In some cases, the document-level JavaScript action may refer to a page which hadn't been loaded yet.
- * To successfully run the javascript action, implementation need to load the page for SDK.
- * */
- FPDF_PAGE (*FFI_GetPage)(struct _FPDF_FORMFILLINFO* pThis, FPDF_DOCUMENT document, int nPageIndex);
-
- /**
- * Method: FFI_GetCurrentPage
- * This method receives the current page pointer.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * document - Handle to document. Returned by FPDF_LoadDocument function.
- * Return value:
- * Handle to the page. Returned by FPDF_LoadPage function.
- * */
- FPDF_PAGE (*FFI_GetCurrentPage)(struct _FPDF_FORMFILLINFO* pThis, FPDF_DOCUMENT document);
-
- /**
- * Method: FFI_GetRotation
- * This method receives currently rotation of the page view.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * page - Handle to page. Returned by FPDF_LoadPage function.
- * Return value:
- * The page rotation. Should be 0(0 degree),1(90 degree),2(180 degree),3(270 degree), in a clockwise direction.
- * */
- int (*FFI_GetRotation)(struct _FPDF_FORMFILLINFO* pThis, FPDF_PAGE page);
-
- /**
- * Method: FFI_ExecuteNamedAction
- * This method will execute an named action.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * namedAction - A byte string which indicates the named action, terminated by 0.
- * Return value:
- * None.
- * Comments:
- * See the named actions description of <<PDF Reference, version 1.7>> for more details.
- * */
- void (*FFI_ExecuteNamedAction)(struct _FPDF_FORMFILLINFO* pThis, FPDF_BYTESTRING namedAction);
- /**
- * @brief This method will be called when a text field is getting or losing a focus.
- *
- * @param[in] pThis Pointer to the interface structure itself.
- * @param[in] value The string value of the form field, in UTF-16LE format.
- * @param[in] valueLen The length of the string value, number of characters (not bytes).
- * @param[in] is_focus True if the form field is getting a focus, False for losing a focus.
- *
- * @return None.
- *
- * @note Currently,only support text field and combobox field.
- * */
- void (*FFI_SetTextFieldFocus)(struct _FPDF_FORMFILLINFO* pThis, FPDF_WIDESTRING value, FPDF_DWORD valueLen, FPDF_BOOL is_focus);
-
-
- /**
- * Method: FFI_DoURIAction
- * This action resolves to a uniform resource identifier.
- * Interface Version:
- * 1
- * Implementation Required:
- * No
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * bsURI - A byte string which indicates the uniform resource identifier, terminated by 0.
- * Return value:
- * None.
- * Comments:
- * See the URI actions description of <<PDF Reference, version 1.7>> for more details.
- * */
- void (*FFI_DoURIAction)(struct _FPDF_FORMFILLINFO* pThis, FPDF_BYTESTRING bsURI);
-
- /**
- * Method: FFI_DoGoToAction
- * This action changes the view to a specified destination.
- * Interface Version:
- * 1
- * Implementation Required:
- * No
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * nPageIndex - The index of the PDF page.
- * zoomMode - The zoom mode for viewing page.See Macros "PDFZOOM_XXX" defined in "fpdfdoc.h".
- * fPosArray - The float array which carries the position info.
- * sizeofArray - The size of float array.
- * Return value:
- * None.
- * Comments:
- * See the Destinations description of <<PDF Reference, version 1.7>> in 8.2.1 for more details.
- **/
- void (*FFI_DoGoToAction)(struct _FPDF_FORMFILLINFO* pThis, int nPageIndex, int zoomMode, float* fPosArray, int sizeofArray);
- /**
- * pointer to IPDF_JSPLATFORM interface
- **/
- IPDF_JSPLATFORM* m_pJsPlatform;
+ /**
+ * Version number of the interface. Currently must be 1.
+ **/
+ int version;
+
+ /**
+ * Method: Release
+ * Give implementation a chance to release any data after the interface is no longer used
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * No
+ * Comments:
+ * Called by Foxit SDK during the final cleanup process.
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * Return Value:
+ * None
+ */
+
+ void (*Release)(struct _FPDF_FORMFILLINFO* pThis);
+
+ /**
+ * Method: FFI_Invalidate
+ * Invalidate the client area within the specified rectangle.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * page - Handle to the page. Returned by FPDF_LoadPage function.
+ * left - Left position of the client area in PDF page coordinate.
+ * top - Top position of the client area in PDF page coordinate.
+ * right - Right position of the client area in PDF page coordinate.
+ * bottom - Bottom position of the client area in PDF page coordinate.
+ * Return Value:
+ * None.
+ *
+ *comments:
+ * All positions are measured in PDF "user space".
+ * Implementation should call FPDF_RenderPageBitmap() function for repainting a specified page area.
+ */
+ void (*FFI_Invalidate)(struct _FPDF_FORMFILLINFO* pThis,FPDF_PAGE page, double left, double top, double right, double bottom);
+
+ /**
+ * Method: FFI_OutputSelectedRect
+ * When user is taking the mouse to select texts on a form field, this callback function will keep
+ * returning the selected areas to the implementation.
+ *
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * No
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * page - Handle to the page. Returned by FPDF_LoadPage function.
+ * left - Left position of the client area in PDF page coordinate.
+ * top - Top position of the client area in PDF page coordinate.
+ * right - Right position of the client area in PDF page coordinate.
+ * bottom - Bottom position of the client area in PDF page coordinate.
+ * Return Value:
+ * None.
+ *
+ * comments:
+ * This CALLBACK function is useful for implementing special text selection effect. Implementation should
+ * first records the returned rectangles, then draw them one by one at the painting period, last,remove all
+ * the recorded rectangles when finish painting.
+ */
+ void (*FFI_OutputSelectedRect)(struct _FPDF_FORMFILLINFO* pThis,FPDF_PAGE page, double left, double top, double right, double bottom);
+
+ /**
+ * Method: FFI_SetCursor
+ * Set the Cursor shape.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * nCursorType - Cursor type. see Flags for Cursor type for the details.
+ * Return value:
+ * None.
+ * */
+ void (*FFI_SetCursor)(struct _FPDF_FORMFILLINFO* pThis, int nCursorType);
+
+ /**
+ * Method: FFI_SetTimer
+ * This method installs a system timer. A time-out value is specified,
+ * and every time a time-out occurs, the system passes a message to
+ * the TimerProc callback function.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * uElapse - Specifies the time-out value, in milliseconds.
+ * lpTimerFunc - A pointer to the callback function-TimerCallback.
+ * Return value:
+ * The timer identifier of the new timer if the function is successful.
+ * An application passes this value to the FFI_KillTimer method to kill
+ * the timer. Nonzero if it is successful; otherwise, it is zero.
+ * */
+ int (*FFI_SetTimer)(struct _FPDF_FORMFILLINFO* pThis, int uElapse, TimerCallback lpTimerFunc);
+
+ /**
+ * Method: FFI_KillTimer
+ * This method kills the timer event identified by nIDEvent, set by an earlier call to FFI_SetTimer.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * nTimerID - The timer ID return by FFI_SetTimer function.
+ * Return value:
+ * None.
+ * */
+ void (*FFI_KillTimer)(struct _FPDF_FORMFILLINFO* pThis, int nTimerID);
+
+
+ /**
+ * Method: FFI_GetLocalTime
+ * This method receives the current local time on the system.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * Return value:
+ * None.
+ * */
+ FPDF_SYSTEMTIME (*FFI_GetLocalTime)(struct _FPDF_FORMFILLINFO* pThis);
+
+ /**
+ * Method: FFI_OnChange
+ * This method will be invoked to notify implementation when the value of any FormField on the document had been changed.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * no
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * Return value:
+ * None.
+ * */
+ void (*FFI_OnChange)(struct _FPDF_FORMFILLINFO* pThis);
+
+ /**
+ * Method: FFI_GetPage
+ * This method receives the page pointer associated with a specified page index.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * document - Handle to document. Returned by FPDF_LoadDocument function.
+ * nPageIndex - Index number of the page. 0 for the first page.
+ * Return value:
+ * Handle to the page. Returned by FPDF_LoadPage function.
+ * Comments:
+ * In some cases, the document-level JavaScript action may refer to a page which hadn't been loaded yet.
+ * To successfully run the javascript action, implementation need to load the page for SDK.
+ * */
+ FPDF_PAGE (*FFI_GetPage)(struct _FPDF_FORMFILLINFO* pThis, FPDF_DOCUMENT document, int nPageIndex);
+
+ /**
+ * Method: FFI_GetCurrentPage
+ * This method receives the current page pointer.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * document - Handle to document. Returned by FPDF_LoadDocument function.
+ * Return value:
+ * Handle to the page. Returned by FPDF_LoadPage function.
+ * */
+ FPDF_PAGE (*FFI_GetCurrentPage)(struct _FPDF_FORMFILLINFO* pThis, FPDF_DOCUMENT document);
+
+ /**
+ * Method: FFI_GetRotation
+ * This method receives currently rotation of the page view.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * page - Handle to page. Returned by FPDF_LoadPage function.
+ * Return value:
+ * The page rotation. Should be 0(0 degree),1(90 degree),2(180 degree),3(270 degree), in a clockwise direction.
+ * */
+ int (*FFI_GetRotation)(struct _FPDF_FORMFILLINFO* pThis, FPDF_PAGE page);
+
+ /**
+ * Method: FFI_ExecuteNamedAction
+ * This method will execute an named action.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * namedAction - A byte string which indicates the named action, terminated by 0.
+ * Return value:
+ * None.
+ * Comments:
+ * See the named actions description of <<PDF Reference, version 1.7>> for more details.
+ * */
+ void (*FFI_ExecuteNamedAction)(struct _FPDF_FORMFILLINFO* pThis, FPDF_BYTESTRING namedAction);
+ /**
+ * @brief This method will be called when a text field is getting or losing a focus.
+ *
+ * @param[in] pThis Pointer to the interface structure itself.
+ * @param[in] value The string value of the form field, in UTF-16LE format.
+ * @param[in] valueLen The length of the string value, number of characters (not bytes).
+ * @param[in] is_focus True if the form field is getting a focus, False for losing a focus.
+ *
+ * @return None.
+ *
+ * @note Currently,only support text field and combobox field.
+ * */
+ void (*FFI_SetTextFieldFocus)(struct _FPDF_FORMFILLINFO* pThis, FPDF_WIDESTRING value, FPDF_DWORD valueLen, FPDF_BOOL is_focus);
+
+
+ /**
+ * Method: FFI_DoURIAction
+ * This action resolves to a uniform resource identifier.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * No
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * bsURI - A byte string which indicates the uniform resource identifier, terminated by 0.
+ * Return value:
+ * None.
+ * Comments:
+ * See the URI actions description of <<PDF Reference, version 1.7>> for more details.
+ * */
+ void (*FFI_DoURIAction)(struct _FPDF_FORMFILLINFO* pThis, FPDF_BYTESTRING bsURI);
+
+ /**
+ * Method: FFI_DoGoToAction
+ * This action changes the view to a specified destination.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * No
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * nPageIndex - The index of the PDF page.
+ * zoomMode - The zoom mode for viewing page.See Macros "PDFZOOM_XXX" defined in "fpdfdoc.h".
+ * fPosArray - The float array which carries the position info.
+ * sizeofArray - The size of float array.
+ * Return value:
+ * None.
+ * Comments:
+ * See the Destinations description of <<PDF Reference, version 1.7>> in 8.2.1 for more details.
+ **/
+ void (*FFI_DoGoToAction)(struct _FPDF_FORMFILLINFO* pThis, int nPageIndex, int zoomMode, float* fPosArray, int sizeofArray);
+ /**
+ * pointer to IPDF_JSPLATFORM interface
+ **/
+ IPDF_JSPLATFORM* m_pJsPlatform;
} FPDF_FORMFILLINFO;
@@ -536,302 +536,300 @@ typedef struct _FPDF_FORMFILLINFO
/**
* Function: FPDFDOC_InitFormFillEnvironment
- * Init form fill environment.
+ * Init form fill environment.
* Comments:
- * This function should be called before any form fill operation.
+ * This function should be called before any form fill operation.
* Parameters:
- * document - Handle to document. Returned by FPDF_LoadDocument function.
- * pFormFillInfo - Pointer to a FPDF_FORMFILLINFO structure.
+ * document - Handle to document. Returned by FPDF_LoadDocument function.
+ * pFormFillInfo - Pointer to a FPDF_FORMFILLINFO structure.
* Return Value:
- * Return handler to the form fill module. NULL means fails.
+ * Return handler to the form fill module. NULL means fails.
**/
DLLEXPORT FPDF_FORMHANDLE STDCALL FPDFDOC_InitFormFillEnvironment(FPDF_DOCUMENT document, FPDF_FORMFILLINFO* formInfo);
/**
* Function: FPDFDOC_ExitFormFillEnvironment
- * Exit form fill environment.
+ * Exit form fill environment.
* Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
* Return Value:
- * NULL.
+ * NULL.
**/
DLLEXPORT void STDCALL FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle);
/**
* 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 method FPDFDOC_InitFormFillEnvironment had been invoked.
+ * This method is required for implementing all the form related functions. Should be invoked after user
+ * successfully loaded a PDF page, and method FPDFDOC_InitFormFillEnvironment had been invoked.
* Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
* Return Value:
- * NONE.
+ * NONE.
**/
DLLEXPORT void STDCALL FORM_OnAfterLoadPage(FPDF_PAGE page, FPDF_FORMHANDLE hHandle);
/**
* Function: FORM_OnBeforeClosePage
- * This method is required for implementing all the form related functions. Should be invoked before user
- * close the PDF page.
+ * This method is required for implementing all the form related functions. Should be invoked before user
+ * close the PDF page.
* Parameters:
- * page - Handle to the page. Returned by FPDF_LoadPage function.
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
+ * page - Handle to the page. Returned by FPDF_LoadPage function.
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
* Return Value:
- * NONE.
+ * NONE.
**/
DLLEXPORT void STDCALL FORM_OnBeforeClosePage(FPDF_PAGE page, FPDF_FORMHANDLE hHandle);
/**
* Function: FORM_DoDocumentJSAction
-* This method is required for performing Document-level JavaScript action. It should be invoked after the PDF document
-* had been loaded.
+* This method is required for performing Document-level JavaScript action. It should be invoked after the PDF document
+* had been loaded.
* Parameters:
-* hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
+* hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
* Return Value:
-* NONE
+* 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.
+* If there is Document-level JavaScript action embedded in the document, this method will execute the javascript action;
+* otherwise, the method will do nothing.
**/
DLLEXPORT void STDCALL FORM_DoDocumentJSAction(FPDF_FORMHANDLE hHandle);
/**
* Function: FORM_DoDocumentOpenAction
-* This method is required for performing open-action when the document is opened.
+* This method is required for performing open-action when the document is opened.
* Parameters:
-* hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
+* hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
* Return Value:
-* NONE
+* NONE
* Comments:
-* This method will do nothing if there is no open-actions embedded in the document.
+* This method will do nothing if there is no open-actions embedded in the document.
**/
DLLEXPORT void STDCALL FORM_DoDocumentOpenAction(FPDF_FORMHANDLE hHandle);
// additional actions type of document.
-#define FPDFDOC_AACTION_WC 0x10 //WC, before closing document, JavaScript action.
-#define FPDFDOC_AACTION_WS 0x11 //WS, before saving document, JavaScript action.
-#define FPDFDOC_AACTION_DS 0x12 //DS, after saving document, JavaScript action.
-#define FPDFDOC_AACTION_WP 0x13 //WP, before printing document, JavaScript action.
-#define FPDFDOC_AACTION_DP 0x14 //DP, after printing document, JavaScript action.
+#define FPDFDOC_AACTION_WC 0x10 //WC, before closing document, JavaScript action.
+#define FPDFDOC_AACTION_WS 0x11 //WS, before saving document, JavaScript action.
+#define FPDFDOC_AACTION_DS 0x12 //DS, after saving document, JavaScript action.
+#define FPDFDOC_AACTION_WP 0x13 //WP, before printing document, JavaScript action.
+#define FPDFDOC_AACTION_DP 0x14 //DP, after printing document, JavaScript action.
/**
* Function: FORM_DoDocumentAAction
-* This method is required for performing the document's additional-action.
+* 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.
+* hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
+* aaType - The type of the additional-actions which defined above.
* Return Value:
-* NONE
+* NONE
* Comments:
-* This method will do nothing if there is no document additional-action corresponding to the specified aaType.
+* This method will do nothing if there is no document additional-action corresponding to the specified aaType.
**/
DLLEXPORT void STDCALL FORM_DoDocumentAAction(FPDF_FORMHANDLE hHandle, int aaType);
// Additional-action types of page object
-#define FPDFPAGE_AACTION_OPEN 0 // /O -- An action to be performed when the page is opened
-#define FPDFPAGE_AACTION_CLOSE 1 // /C -- An action to be performed when the page is closed
+#define FPDFPAGE_AACTION_OPEN 0 // /O -- An action to be performed when the page is opened
+#define FPDFPAGE_AACTION_CLOSE 1 // /C -- An action to be performed when the page is closed
/**
* Function: FORM_DoPageAAction
-* This method is required for performing the page object's additional-action when opened or closed.
+* This method is required for performing the page object's additional-action when opened or closed.
* Parameters:
-* page - Handle to the page. Returned by FPDF_LoadPage function.
-* hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
-* aaType - The type of the page object's additional-actions which defined above.
+* page - Handle to the page. Returned by FPDF_LoadPage function.
+* hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
+* aaType - The type of the page object's additional-actions which defined above.
* Return Value:
-* NONE
+* NONE
* Comments:
-* This method will do nothing if no additional-action corresponding to the specified aaType exists.
+* This method will do nothing if no additional-action corresponding to the specified aaType exists.
**/
DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, FPDF_FORMHANDLE hHandle, int aaType);
/**
* Function: FORM_OnMouseMove
- * You can call this member function when the mouse cursor moves.
+ * You can call this member function when the mouse cursor moves.
* Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
- * page - Handle to the page. Returned by FPDF_LoadPage function.
- * 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.
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
+ * page - Handle to the page. Returned by FPDF_LoadPage function.
+ * 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.
+ * TRUE indicates success; otherwise false.
**/
DLLEXPORT FPDF_BOOL STDCALL FORM_OnMouseMove(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int modifier, double page_x, double page_y);
/**
* Function: FORM_OnLButtonDown
- * You can call this member function when the user presses the left mouse button.
+ * You can call this member function when the user presses the left mouse button.
* Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
- * page - Handle to the page. Returned by FPDF_LoadPage function.
- * 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.
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
+ * page - Handle to the page. Returned by FPDF_LoadPage function.
+ * 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.
+ * TRUE indicates success; otherwise false.
**/
DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonDown(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int modifier, double page_x, double page_y);
/**
* Function: FORM_OnLButtonUp
- * You can call this member function when the user releases the left mouse button.
+ * You can call this member function when the user releases the left mouse button.
* Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
- * page - Handle to the page. Returned by FPDF_LoadPage function.
- * 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.
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
+ * page - Handle to the page. Returned by FPDF_LoadPage function.
+ * 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.
+ * TRUE indicates success; otherwise false.
**/
DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonUp(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int modifier, double page_x, double page_y);
/**
* Function: FORM_OnKeyDown
- * You can call this member function when a nonsystem key is pressed.
+ * You can call this member function when a nonsystem key is pressed.
* Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
- * page - Handle to the page. Returned by FPDF_LoadPage function.
- * nKeyCode - Indicates whether various virtual keys are down.
- * modifier - Contains the scan code, key-transition code, previous key state, and context code.
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
+ * page - Handle to the page. Returned by FPDF_LoadPage function.
+ * nKeyCode - Indicates whether various virtual keys are down.
+ * modifier - Contains the scan code, key-transition code, previous key state, and context code.
* Return Value:
- * TRUE indicates success; otherwise false.
+ * TRUE indicates success; otherwise false.
**/
DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyDown(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int nKeyCode, int modifier);
/**
* Function: FORM_OnKeyUp
- * You can call this member function when a nonsystem key is released.
+ * You can call this member function when a nonsystem key is released.
* Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
- * page - Handle to the page. Returned by FPDF_LoadPage function.
- * nKeyCode - The virtual-key code of the given key.
- * modifier - Contains the scan code, key-transition code, previous key state, and context code.
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
+ * page - Handle to the page. Returned by FPDF_LoadPage function.
+ * nKeyCode - The virtual-key code of the given key.
+ * modifier - Contains the scan code, key-transition code, previous key state, and context code.
* Return Value:
- * TRUE indicates success; otherwise false.
+ * TRUE indicates success; otherwise false.
**/
DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyUp(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int nKeyCode, int modifier);
/**
* Function: FORM_OnChar
- * You can call this member function when a keystroke translates to a nonsystem character.
+ * You can call this member function when a keystroke translates to a nonsystem character.
* Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
- * page - Handle to the page. Returned by FPDF_LoadPage function.
- * nChar - The character code value of the key.
- * modifier - Contains the scan code, key-transition code, previous key state, and context code.
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
+ * page - Handle to the page. Returned by FPDF_LoadPage function.
+ * nChar - The character code value of the key.
+ * modifier - Contains the scan code, key-transition code, previous key state, and context code.
* Return Value:
- * TRUE indicates success; otherwise false.
+ * TRUE indicates success; otherwise false.
**/
DLLEXPORT FPDF_BOOL STDCALL FORM_OnChar(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int nChar, int modifier);
/**
* Function: FORM_ForceToKillFocus.
- * You can call this member function to force to kill the focus of the form field which got focus.
- * It would kill the focus on the form field, save the value of form field if it's changed by user.
+ * You can call this member function to force to kill the focus of the form field which got focus.
+ * It would kill the focus on the form field, save the value of form field if it's changed by user.
* Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
* Return Value:
- * TRUE indicates success; otherwise false.
+ * TRUE indicates success; otherwise false.
**/
DLLEXPORT FPDF_BOOL STDCALL FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle);
// Field Types
-#define FPDF_FORMFIELD_UNKNOWN 0 // Unknown.
-#define FPDF_FORMFIELD_PUSHBUTTON 1 // push button type.
-#define FPDF_FORMFIELD_CHECKBOX 2 // check box type.
-#define FPDF_FORMFIELD_RADIOBUTTON 3 // radio button type.
-#define FPDF_FORMFIELD_COMBOBOX 4 // combo box type.
-#define FPDF_FORMFIELD_LISTBOX 5 // list box type.
-#define FPDF_FORMFIELD_TEXTFIELD 6 // text field type.
+#define FPDF_FORMFIELD_UNKNOWN 0 // Unknown.
+#define FPDF_FORMFIELD_PUSHBUTTON 1 // push button type.
+#define FPDF_FORMFIELD_CHECKBOX 2 // check box type.
+#define FPDF_FORMFIELD_RADIOBUTTON 3 // radio button type.
+#define FPDF_FORMFIELD_COMBOBOX 4 // combo box type.
+#define FPDF_FORMFIELD_LISTBOX 5 // list box type.
+#define FPDF_FORMFIELD_TEXTFIELD 6 // text field type.
/**
* Function: FPDPage_HasFormFieldAtPoint
- * Check the form filed position by point.
+ * Check the form filed position by point.
* Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
- * page - Handle to the page. Returned by FPDF_LoadPage function.
- * page_x - X position in PDF "user space".
- * page_y - Y position in PDF "user space".
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
+ * page - Handle to the page. Returned by FPDF_LoadPage function.
+ * page_x - X position in PDF "user space".
+ * page_y - Y position in PDF "user space".
* Return Value:
- * Return the type of the formfiled; -1 indicates no fields.
+ * Return the type of the formfiled; -1 indicates no fields.
**/
DLLEXPORT int STDCALL FPDPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle,FPDF_PAGE page,double page_x, double page_y);
/**
* Function: FPDF_SetFormFieldHighlightColor
- * Set the highlight color of specified or all the form fields in the document.
+ * Set the highlight color of specified or all the form fields in the document.
* Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
- * doc - Handle to the document. Returned by FPDF_LoadDocument function.
- * 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.
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
+ * doc - Handle to the document. Returned by FPDF_LoadDocument function.
+ * 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.
+ * NONE.
* Comments:
- * When the parameter fieldType is set to zero, 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.
+ * When the parameter fieldType is set to zero, 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.
**/
DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightColor(FPDF_FORMHANDLE hHandle, int fieldType, unsigned long color);
/**
* Function: FPDF_SetFormFieldHighlightAlpha
- * Set the transparency of the form field highlight color in the document.
+ * Set the transparency of the form field highlight color in the document.
* Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
- * doc - Handle to the document. Returned by FPDF_LoadDocument function.
- * alpha - The transparency of the form field highlight color. between 0-255.
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
+ * doc - Handle to the document. Returned by FPDF_LoadDocument function.
+ * alpha - The transparency of the form field highlight color. between 0-255.
* Return Value:
- * NONE.
+ * NONE.
**/
DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightAlpha(FPDF_FORMHANDLE hHandle, unsigned char alpha);
/**
* Function: FPDF_RemoveFormFieldHighlight
- * Remove the form field highlight color in the document.
+ * Remove the form field highlight color in the document.
* Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
* Return Value:
- * NONE.
+ * NONE.
* Comments:
- * Please refresh the client window to remove the highlight immediately if necessary.
+ * Please refresh the client window to remove the highlight immediately if necessary.
**/
DLLEXPORT void STDCALL FPDF_RemoveFormFieldHighlight(FPDF_FORMHANDLE hHandle);
/**
* Function: FPDF_FFLDraw
-* Render FormFeilds on a page to a device independent bitmap.
+* Render FormFeilds on a page to a device independent bitmap.
* Parameters:
-* hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
-* 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. Returned by FPDF_LoadPage function.
-* start_x - Left pixel position of the display area in the device coordinate.
-* start_y - Top pixel position of the display area in the device 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 above.
+* hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
+* 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. Returned by FPDF_LoadPage function.
+* start_x - Left pixel position of the display area in the device coordinate.
+* start_y - Top pixel position of the display area in the device 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 above.
* Return Value:
-* None.
-* Comments:
-* This method is designed to only render annotations and FormFields on the page.
-* Without FPDF_ANNOT specified for flags, Rendering functions such as FPDF_RenderPageBitmap or FPDF_RenderPageBitmap_Start will only render page contents(without annotations) to a bitmap.
-* In order to implement the FormFill functions,Implementation should call this method after rendering functions finish rendering the page contents.
+* None.
+* Comments:
+* This method is designed to only render annotations and FormFields on the page.
+* Without FPDF_ANNOT specified for flags, Rendering functions such as FPDF_RenderPageBitmap or FPDF_RenderPageBitmap_Start will only render page contents(without annotations) to a bitmap.
+* In order to implement the FormFill functions,Implementation should call this method after rendering functions finish rendering the page contents.
**/
-DLLEXPORT void STDCALL 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);
-
+DLLEXPORT void STDCALL 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);
#ifdef __cplusplus
-};
+}
#endif
-#endif //_FPDFORMFILL_H
-
+#endif // PUBLIC_FPDF_FORMFILL_H_
diff --git a/public/fpdf_fwlevent.h b/public/fpdf_fwlevent.h
index f27499a1c6..fa4f144fcc 100644
--- a/public/fpdf_fwlevent.h
+++ b/public/fpdf_fwlevent.h
@@ -1,11 +1,11 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef _FWL_EVENT_H
-#define _FWL_EVENT_H
+#ifndef PUBLIC_FPDF_FWLEVENT_H_
+#define PUBLIC_FPDF_FWLEVENT_H_
#include "fpdfview.h"
@@ -13,90 +13,90 @@
extern "C" {
#endif
-typedef int FPDF_INT32;
+typedef int FPDF_INT32;
typedef unsigned int FPDF_UINT32;
-typedef float FPDF_FLOAT;
+typedef float FPDF_FLOAT;
//event type
typedef enum
{
- FWL_EVENTTYPE_Mouse = 0 ,
- FWL_EVENTTYPE_MouseWheel,
- FWL_EVENTTYPE_Key ,
+ FWL_EVENTTYPE_Mouse = 0 ,
+ FWL_EVENTTYPE_MouseWheel,
+ FWL_EVENTTYPE_Key ,
} FWL_EVENTTYPE;
//key flag
typedef enum
-{
- FWL_EVENTFLAG_ShiftKey = 1 << 0,
- FWL_EVENTFLAG_ControlKey = 1 << 1,
- FWL_EVENTFLAG_AltKey = 1 << 2,
- FWL_EVENTFLAG_MetaKey = 1 << 3,
- FWL_EVENTFLAG_KeyPad = 1 << 4,
- FWL_EVENTFLAG_AutoRepeat = 1 << 5,
- FWL_EVENTFLAG_LeftButtonDown = 1 << 6,
- FWL_EVENTFLAG_MiddleButtonDown = 1 << 7,
- FWL_EVENTFLAG_RightButtonDown = 1 << 8,
-} FWL_EVENTFLAG;
+{
+ FWL_EVENTFLAG_ShiftKey = 1 << 0,
+ FWL_EVENTFLAG_ControlKey = 1 << 1,
+ FWL_EVENTFLAG_AltKey = 1 << 2,
+ FWL_EVENTFLAG_MetaKey = 1 << 3,
+ FWL_EVENTFLAG_KeyPad = 1 << 4,
+ FWL_EVENTFLAG_AutoRepeat = 1 << 5,
+ FWL_EVENTFLAG_LeftButtonDown = 1 << 6,
+ FWL_EVENTFLAG_MiddleButtonDown = 1 << 7,
+ FWL_EVENTFLAG_RightButtonDown = 1 << 8,
+} FWL_EVENTFLAG;
// Mouse message command
typedef enum
{
- FWL_EVENTMOUSECMD_LButtonDown = 1 ,
- FWL_EVENTMOUSECMD_LButtonUp ,
- FWL_EVENTMOUSECMD_LButtonDblClk ,
- FWL_EVENTMOUSECMD_RButtonDown ,
- FWL_EVENTMOUSECMD_RButtonUp ,
- FWL_EVENTMOUSECMD_RButtonDblClk ,
- FWL_EVENTMOUSECMD_MButtonDown ,
- FWL_EVENTMOUSECMD_MButtonUp ,
- FWL_EVENTMOUSECMD_MButtonDblClk ,
- FWL_EVENTMOUSECMD_MouseMove ,
- FWL_EVENTMOUSECMD_MouseEnter ,
- FWL_EVENTMOUSECMD_MouseHover ,
- FWL_EVENTMOUSECMD_MouseLeave ,
+ FWL_EVENTMOUSECMD_LButtonDown = 1,
+ FWL_EVENTMOUSECMD_LButtonUp,
+ FWL_EVENTMOUSECMD_LButtonDblClk,
+ FWL_EVENTMOUSECMD_RButtonDown,
+ FWL_EVENTMOUSECMD_RButtonUp,
+ FWL_EVENTMOUSECMD_RButtonDblClk,
+ FWL_EVENTMOUSECMD_MButtonDown,
+ FWL_EVENTMOUSECMD_MButtonUp,
+ FWL_EVENTMOUSECMD_MButtonDblClk,
+ FWL_EVENTMOUSECMD_MouseMove,
+ FWL_EVENTMOUSECMD_MouseEnter,
+ FWL_EVENTMOUSECMD_MouseHover,
+ FWL_EVENTMOUSECMD_MouseLeave,
} FWL_EVENT_MOUSECMD;
//mouse event
-struct FWL_EVENT_MOUSE
+struct FWL_EVENT_MOUSE
{
- FPDF_UINT32 command;
- FPDF_DWORD flag;
- FPDF_FLOAT x;
- FPDF_FLOAT y;
+ FPDF_UINT32 command;
+ FPDF_DWORD flag;
+ FPDF_FLOAT x;
+ FPDF_FLOAT y;
};
//mouse wheel
-struct FWL_EVENT_MOUSEWHEEL
-{
- FPDF_DWORD flag;
- FPDF_FLOAT x;
- FPDF_FLOAT y;
- FPDF_FLOAT deltaX;
- FPDF_FLOAT deltaY;
+struct FWL_EVENT_MOUSEWHEEL
+{
+ FPDF_DWORD flag;
+ FPDF_FLOAT x;
+ FPDF_FLOAT y;
+ FPDF_FLOAT deltaX;
+ FPDF_FLOAT deltaY;
};
//virtual keycode
-typedef enum
+typedef enum
{
- FWL_VKEY_Back = 0x08,
- FWL_VKEY_Tab = 0x09,
- FWL_VKEY_Clear = 0x0C,
- FWL_VKEY_Return = 0x0D,
- FWL_VKEY_Shift = 0x10,
- FWL_VKEY_Control = 0x11,
- FWL_VKEY_Menu = 0x12,
- FWL_VKEY_Pause = 0x13,
- FWL_VKEY_Capital = 0x14,
- FWL_VKEY_Kana = 0x15,
- FWL_VKEY_Hangul = 0x15,
- FWL_VKEY_Junja = 0x17,
- FWL_VKEY_Final = 0x18,
- FWL_VKEY_Hanja = 0x19,
- FWL_VKEY_Kanji = 0x19,
- FWL_VKEY_Escape = 0x1B,
- FWL_VKEY_Convert = 0x1C,
+ FWL_VKEY_Back = 0x08,
+ FWL_VKEY_Tab = 0x09,
+ FWL_VKEY_Clear = 0x0C,
+ FWL_VKEY_Return = 0x0D,
+ FWL_VKEY_Shift = 0x10,
+ FWL_VKEY_Control = 0x11,
+ FWL_VKEY_Menu = 0x12,
+ FWL_VKEY_Pause = 0x13,
+ FWL_VKEY_Capital = 0x14,
+ FWL_VKEY_Kana = 0x15,
+ FWL_VKEY_Hangul = 0x15,
+ FWL_VKEY_Junja = 0x17,
+ FWL_VKEY_Final = 0x18,
+ FWL_VKEY_Hanja = 0x19,
+ FWL_VKEY_Kanji = 0x19,
+ FWL_VKEY_Escape = 0x1B,
+ FWL_VKEY_Convert = 0x1C,
FWL_VKEY_NonConvert = 0x1D,
- FWL_VKEY_Accept = 0x1E,
+ FWL_VKEY_Accept = 0x1E,
FWL_VKEY_ModeChange = 0x1F,
FWL_VKEY_Space = 0x20,
FWL_VKEY_Prior = 0x21,
@@ -251,44 +251,42 @@ typedef enum
//key event command
typedef enum
{
- FWL_EVENTKEYCMD_KeyDown = 1 ,
- FWL_EVENTKEYCMD_KeyUp ,
- FWL_EVENTKEYCMD_Char ,
+ FWL_EVENTKEYCMD_KeyDown = 1,
+ FWL_EVENTKEYCMD_KeyUp,
+ FWL_EVENTKEYCMD_Char,
} FWL_EVENTKEYCMD;
//key event
struct FWL_EVENT_KEY
{
- FPDF_UINT32 command;
- FPDF_DWORD flag;
- union
- {
- //Virtual key code.
- FPDF_UINT32 vkcode;
- //Character code.
- FPDF_DWORD charcode;
- }code;
+ FPDF_UINT32 command;
+ FPDF_DWORD flag;
+ union
+ {
+ //Virtual key code.
+ FPDF_UINT32 vkcode;
+ //Character code.
+ FPDF_DWORD charcode;
+ }code;
};
//event type
-struct FWL_EVENT
+struct FWL_EVENT
{
- //structure size.
- FPDF_UINT32 size;
- //FWL_EVENTTYPE.
+ //structure size.
+ FPDF_UINT32 size;
+ //FWL_EVENTTYPE.
FPDF_UINT32 type;
- union
- {
- struct FWL_EVENT_MOUSE mouse;
- struct FWL_EVENT_MOUSEWHEEL wheel;
- struct FWL_EVENT_KEY key;
- }s;
-};
+ union
+ {
+ struct FWL_EVENT_MOUSE mouse;
+ struct FWL_EVENT_MOUSEWHEEL wheel;
+ struct FWL_EVENT_KEY key;
+ }s;
+};
#ifdef __cplusplus
}
#endif
-#endif //_FWL_EVENT_H
-
-
+#endif // PUBLIC_FPDF_FWLEVENT_H_
diff --git a/public/fpdf_ppo.h b/public/fpdf_ppo.h
index 3e7e5c9a5e..2e033f14d3 100644
--- a/public/fpdf_ppo.h
+++ b/public/fpdf_ppo.h
@@ -1,11 +1,11 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef _FPDFPPO_H_
-#define _FPDFPPO_H_
+#ifndef PUBLIC_FPDF_PPO_H_
+#define PUBLIC_FPDF_PPO_H_
#include "fpdfview.h"
@@ -14,30 +14,29 @@ extern "C" {
#endif
// Function: FPDF_ImportPages
-// Import some pages to a PDF document.
-// Parameters:
-// dest_doc - The destination document which add the pages.
-// src_doc - A document to be imported.
-// pagerange - A page range string, Such as "1,3,5-7".
-// If this parameter is NULL, it would import all pages in src_doc.
-// index - The page index wanted to insert from.
+// Import some pages to a PDF document.
+// Parameters:
+// dest_doc - The destination document which add the pages.
+// src_doc - A document to be imported.
+// pagerange - A page range string, Such as "1,3,5-7".
+// If this parameter is NULL, it would import all pages in src_doc.
+// index - The page index wanted to insert from.
// Return value:
-// TRUE for succeed, FALSE for Failed.
+// TRUE for succeed, FALSE for Failed.
DLLEXPORT FPDF_BOOL STDCALL FPDF_ImportPages(FPDF_DOCUMENT dest_doc,FPDF_DOCUMENT src_doc, FPDF_BYTESTRING pagerange, int index);
// Function: FPDF_CopyViewerPreferences
-// Copy the viewer preferences from one PDF document to another.#endif
-// Parameters:
-// dest_doc - Handle to document to write the viewer preferences to.
-// src_doc - Handle to document with the viewer preferences.
+// Copy the viewer preferences from one PDF document to another.#endif
+// Parameters:
+// dest_doc - Handle to document to write the viewer preferences to.
+// src_doc - Handle to document with the viewer preferences.
// Return value:
-// TRUE for success, FALSE for failure.
+// TRUE for success, FALSE for failure.
DLLEXPORT FPDF_BOOL STDCALL FPDF_CopyViewerPreferences(FPDF_DOCUMENT dest_doc, FPDF_DOCUMENT src_doc);
#ifdef __cplusplus
-};
+}
#endif
-#endif //_FPDFPPO_H_
-
+#endif // PUBLIC_FPDF_PPO_H_
diff --git a/public/fpdf_progressive.h b/public/fpdf_progressive.h
index 029264eae2..058f54b157 100644
--- a/public/fpdf_progressive.h
+++ b/public/fpdf_progressive.h
@@ -1,19 +1,19 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef _FPDF_PROGRESSIVE_H_
-#define _FPDF_PROGRESSIVE_H_
+#ifndef PUBLIC_FPDF_PROGRESSIVE_H_
+#define PUBLIC_FPDF_PROGRESSIVE_H_
#include "fpdfview.h"
//Flags for progressive process status.
-#define FPDF_RENDER_READER 0
-#define FPDF_RENDER_TOBECOUNTINUED 1
-#define FPDF_RENDER_DONE 2
-#define FPDF_RENDER_FAILED 3
+#define FPDF_RENDER_READER 0
+#define FPDF_RENDER_TOBECOUNTINUED 1
+#define FPDF_RENDER_DONE 2
+#define FPDF_RENDER_FAILED 3
#ifdef __cplusplus
@@ -24,71 +24,71 @@ extern "C" {
//IFPDF_RENDERINFO interface.
typedef struct _IFSDK_PAUSE
{
- /**
- * Version number of the interface. Currently must be 1.
- **/
- int version;
+ /**
+ * Version number of the interface. Currently must be 1.
+ **/
+ int version;
+
+ /*
+ * Method: NeedToPauseNow
+ * Check if we need to pause a progressive process now.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * Return Value:
+ * Non-zero for pause now, 0 for continue.
+ *
+ */
+ FPDF_BOOL (*NeedToPauseNow) (struct _IFSDK_PAUSE* pThis);
- /*
- * Method: NeedToPauseNow
- * Check if we need to pause a progressive process now.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * Return Value:
- * Non-zero for pause now, 0 for continue.
- *
- */
- FPDF_BOOL (*NeedToPauseNow) (struct _IFSDK_PAUSE* pThis);
-
- //A user defined data pointer, used by user's application. Can be NULL.
- void* user;
+ //A user defined data pointer, used by user's application. Can be NULL.
+ void* user;
} IFSDK_PAUSE;
// 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 function.
-// page - Handle to the page. 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 above.
-// pause - The IFSDK_PAUSE interface.A callback mechanism allowing the page rendering process
+// 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 function.
+// page - Handle to the page. 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 above.
+// 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.
+// Rendering Status. See flags for progressive process status for the details.
//
DLLEXPORT int STDCALL 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,IFSDK_PAUSE * pause);
+ int size_y, int rotate, int flags,IFSDK_PAUSE * pause);
// Function: FPDF_RenderPage_Continue
-// Continue rendering a PDF page.
-// Parameters:
-// page - Handle to the page. Returned by FPDF_LoadPage function.
-// 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.
+// Continue rendering a PDF page.
+// Parameters:
+// page - Handle to the page. Returned by FPDF_LoadPage function.
+// 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.
+// The rendering status. See flags for progressive process status for the details.
DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page,IFSDK_PAUSE * pause);
// 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. Returned by FPDF_LoadPage function.
+// Release the resource allocate during page rendering. Need to be called after finishing rendering or
+// cancel the rendering.
+// Parameters:
+// page - Handle to the page. Returned by FPDF_LoadPage function.
// Return value:
-// NULL
+// NULL
DLLEXPORT void STDCALL FPDF_RenderPage_Close(FPDF_PAGE page);
#ifdef __cplusplus
}
#endif
-#endif //_FPDF_PROGRESSIVE_H_
+#endif // PUBLIC_FPDF_PROGRESSIVE_H_
diff --git a/public/fpdf_save.h b/public/fpdf_save.h
index 28b169b0df..aa326032ca 100644
--- a/public/fpdf_save.h
+++ b/public/fpdf_save.h
@@ -1,11 +1,11 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef _FPDFSAVE_H_
-#define _FPDFSAVE_H_
+#ifndef PUBLIC_FPDF_SAVE_H_
+#define PUBLIC_FPDF_SAVE_H_
#include "fpdfview.h"
@@ -17,66 +17,65 @@ extern "C" {
// Structure for custom file write
typedef struct FPDF_FILEWRITE_ {
- //
- //Version number of the interface. Currently must be 1.
- //
- int version;
+ //
+ //Version number of the interface. Currently must be 1.
+ //
+ int version;
- //
- // Method: WriteBlock
- // Output a block of data in your custom way.
- // Interface Version:
- // 1
- // Implementation Required:
- // Yes
- // Comments:
- // Called by function FPDF_SaveDocument
- // Parameters:
- // pThis - Pointer to the structure itself
- // pData - Pointer to a buffer to output
- // size - The size of the buffer.
- // Return value:
- // Should be non-zero if successful, zero for error.
- //
- int (*WriteBlock)(struct FPDF_FILEWRITE_* pThis, const void* pData, unsigned long size);
+ //
+ // Method: WriteBlock
+ // Output a block of data in your custom way.
+ // Interface Version:
+ // 1
+ // Implementation Required:
+ // Yes
+ // Comments:
+ // Called by function FPDF_SaveDocument
+ // Parameters:
+ // pThis - Pointer to the structure itself
+ // pData - Pointer to a buffer to output
+ // size - The size of the buffer.
+ // Return value:
+ // Should be non-zero if successful, zero for error.
+ //
+ int (*WriteBlock)(struct FPDF_FILEWRITE_* pThis, const void* pData, unsigned long size);
} FPDF_FILEWRITE;
-
/** @brief Incremental. */
-#define FPDF_INCREMENTAL 1
+#define FPDF_INCREMENTAL 1
/** @brief No Incremental. */
-#define FPDF_NO_INCREMENTAL 2
+#define FPDF_NO_INCREMENTAL 2
/** @brief Remove security. */
-#define FPDF_REMOVE_SECURITY 3
+#define FPDF_REMOVE_SECURITY 3
// Function: FPDF_SaveAsCopy
-// Saves the copy of specified document in custom way.
-// Parameters:
-// document - Handle to document. Returned by FPDF_LoadDocument and FPDF_CreateNewDocument.
-// pFileWrite - A pointer to a custom file write structure.
-// flags - The creating flags.
+// Saves the copy of specified document in custom way.
+// Parameters:
+// document - Handle to document. Returned by FPDF_LoadDocument and FPDF_CreateNewDocument.
+// pFileWrite - A pointer to a custom file write structure.
+// flags - The creating flags.
// Return value:
-// TRUE for succeed, FALSE for failed.
+// TRUE for succeed, FALSE for failed.
//
-DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveAsCopy( FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,
- FPDF_DWORD flags );
+DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveAsCopy( FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,
+ FPDF_DWORD flags );
// Function: FPDF_SaveWithVersion
-// Same as function ::FPDF_SaveAsCopy, except the file version of the saved document could be specified by user.
-// Parameters:
-// document - Handle to document.
-// pFileWrite - A pointer to a custom file write structure.
-// flags - The creating flags.
-// fileVersion - The PDF file version. File version: 14 for 1.4, 15 for 1.5, ...
+// Same as function ::FPDF_SaveAsCopy, except the file version of the saved document could be specified by user.
+// Parameters:
+// document - Handle to document.
+// pFileWrite - A pointer to a custom file write structure.
+// flags - The creating flags.
+// fileVersion - The PDF file version. File version: 14 for 1.4, 15 for 1.5, ...
// Return value:
-// TRUE if succeed, FALSE if failed.
+// TRUE if succeed, FALSE if failed.
//
DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion(FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,
- FPDF_DWORD flags, int fileVersion);
+ FPDF_DWORD flags, int fileVersion);
#ifdef __cplusplus
-};
+}
#endif
-#endif //_FPDFSAVE_H_
+#endif // PUBLIC_FPDF_SAVE_H_
diff --git a/public/fpdf_searchex.h b/public/fpdf_searchex.h
index d70dddc984..1d43eab8cf 100644
--- a/public/fpdf_searchex.h
+++ b/public/fpdf_searchex.h
@@ -1,33 +1,29 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef _FPDF_SEARCH_EX_H
-#define _FPDF_SEARCH_EX_H
-
-#ifndef _FPDFVIEW_H_
+#ifndef PUBLIC_FPDF_SEARCHEX_H_
+#define PUBLIC_FPDF_SEARCHEX_H_
+
#include "fpdfview.h"
-#endif
#ifdef __cplusplus
extern "C" {
#endif
// Function: FPDFText_GetCharIndexFromTextIndex
-// Get the actually char index in text_page's internal char list.
+// Get the actually char index in text_page's internal char list.
// Parameters:
-// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
-// nTextIndex - The index of the text in the string get from FPDFText_GetText.
-// Return value:
-// The index of the character in internal charlist. -1 for error.
+// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
+// nTextIndex - The index of the text in the string get from FPDFText_GetText.
+// Return value:
+// The index of the character in internal charlist. -1 for error.
DLLEXPORT int STDCALL FPDFText_GetCharIndexFromTextIndex(FPDF_TEXTPAGE text_page, int nTextIndex);
#ifdef __cplusplus
-};
-#endif
-
-
+}
#endif
+#endif // PUBLIC_FPDF_SEARCHEX_H_
diff --git a/public/fpdf_sysfontinfo.h b/public/fpdf_sysfontinfo.h
index 275ca84d55..dbadb89afe 100644
--- a/public/fpdf_sysfontinfo.h
+++ b/public/fpdf_sysfontinfo.h
@@ -1,194 +1,194 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef _FPDF_SYSFONTINFO_H
-#define _FPDF_SYSFONTINFO_H
+#ifndef PUBLIC_FPDF_SYSFONTINFO_H_
+#define PUBLIC_FPDF_SYSFONTINFO_H_
#include "fpdfview.h"
/* Character sets for the font */
-#define FXFONT_ANSI_CHARSET 0
-#define FXFONT_DEFAULT_CHARSET 1
-#define FXFONT_SYMBOL_CHARSET 2
-#define FXFONT_SHIFTJIS_CHARSET 128
-#define FXFONT_HANGEUL_CHARSET 129
-#define FXFONT_GB2312_CHARSET 134
-#define FXFONT_CHINESEBIG5_CHARSET 136
+#define FXFONT_ANSI_CHARSET 0
+#define FXFONT_DEFAULT_CHARSET 1
+#define FXFONT_SYMBOL_CHARSET 2
+#define FXFONT_SHIFTJIS_CHARSET 128
+#define FXFONT_HANGEUL_CHARSET 129
+#define FXFONT_GB2312_CHARSET 134
+#define FXFONT_CHINESEBIG5_CHARSET 136
/* Font pitch and family flags */
-#define FXFONT_FF_FIXEDPITCH 1
-#define FXFONT_FF_ROMAN (1<<4)
-#define FXFONT_FF_SCRIPT (4<<4)
+#define FXFONT_FF_FIXEDPITCH 1
+#define FXFONT_FF_ROMAN (1<<4)
+#define FXFONT_FF_SCRIPT (4<<4)
/* Typical weight values */
-#define FXFONT_FW_NORMAL 400
-#define FXFONT_FW_BOLD 700
+#define FXFONT_FW_NORMAL 400
+#define FXFONT_FW_BOLD 700
// Exported Functions
#ifdef __cplusplus
extern "C" {
#endif
-/**
+/**
* Interface: FPDF_SYSFONTINFO
- * Interface for getting system font information and font mapping
+ * Interface for getting system font information and font mapping
*/
typedef struct _FPDF_SYSFONTINFO {
- /**
- * Version number of the interface. Currently must be 1.
- **/
- int version;
+ /**
+ * Version number of the interface. Currently must be 1.
+ **/
+ int version;
+
+ /**
+ * Method: Release
+ * Give implementation a chance to release any data after the interface is no longer used
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * No
+ * Comments:
+ * Called by Foxit SDK during the final cleanup process.
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * Return Value:
+ * None
+ */
+ void (*Release)(struct _FPDF_SYSFONTINFO* pThis);
+
+ /**
+ * Method: EnumFonts
+ * Enumerate all fonts installed on the system
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * No
+ * Comments:
+ * Implementation should call FPDF_AddIntalledFont() function for each font found.
+ * Only TrueType/OpenType and Type1 fonts are accepted by Foxit SDK.
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * pMapper - An opaque pointer to internal font mapper, used when calling FPDF_AddInstalledFont
+ * Return Value:
+ * None
+ */
+ void (*EnumFonts)(struct _FPDF_SYSFONTINFO* pThis, void* pMapper);
- /**
- * Method: Release
- * Give implementation a chance to release any data after the interface is no longer used
- * Interface Version:
- * 1
- * Implementation Required:
- * No
- * Comments:
- * Called by Foxit SDK during the final cleanup process.
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * Return Value:
- * None
- */
- void (*Release)(struct _FPDF_SYSFONTINFO* pThis);
-
- /**
- * Method: EnumFonts
- * Enumerate all fonts installed on the system
- * Interface Version:
- * 1
- * Implementation Required:
- * No
- * Comments:
- * Implementation should call FPDF_AddIntalledFont() function for each font found.
- * Only TrueType/OpenType and Type1 fonts are accepted by Foxit SDK.
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * pMapper - An opaque pointer to internal font mapper, used when calling FPDF_AddInstalledFont
- * Return Value:
- * None
- */
- void (*EnumFonts)(struct _FPDF_SYSFONTINFO* pThis, void* pMapper);
+ /**
+ * Method: MapFont
+ * Use the system font mapper to get a font handle from requested parameters
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * Yes only if GetFont method is not implemented.
+ * Comments:
+ * If the system supports native font mapper (like Windows), implementation can implement this method to get a font handle.
+ * Otherwise, Foxit SDK will do the mapping and then call GetFont method.
+ * Only TrueType/OpenType and Type1 fonts are accepted by Foxit SDK.
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * weight - Weight of the requested font. 400 is normal and 700 is bold.
+ * bItalic - Italic option of the requested font, TRUE or FALSE.
+ * charset - Character set identifier for the requested font. See above defined constants.
+ * pitch_family - A combination of flags. See above defined constants.
+ * face - Typeface name. Currently use system local encoding only.
+ * bExact - Pointer to an boolean value receiving the indicator whether mapper found the exact match.
+ * If mapper is not sure whether it's exact match, ignore this paramter.
+ * Return Value:
+ * An opaque pointer for font handle, or NULL if system mapping is not supported.
+ **/
+ void* (*MapFont)(struct _FPDF_SYSFONTINFO* pThis, int weight, int bItalic, int charset, int pitch_family,
+ const char* face, int* bExact);
- /**
- * Method: MapFont
- * Use the system font mapper to get a font handle from requested parameters
- * Interface Version:
- * 1
- * Implementation Required:
- * Yes only if GetFont method is not implemented.
- * Comments:
- * If the system supports native font mapper (like Windows), implementation can implement this method to get a font handle.
- * Otherwise, Foxit SDK will do the mapping and then call GetFont method.
- * Only TrueType/OpenType and Type1 fonts are accepted by Foxit SDK.
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * weight - Weight of the requested font. 400 is normal and 700 is bold.
- * bItalic - Italic option of the requested font, TRUE or FALSE.
- * charset - Character set identifier for the requested font. See above defined constants.
- * pitch_family - A combination of flags. See above defined constants.
- * face - Typeface name. Currently use system local encoding only.
- * bExact - Pointer to an boolean value receiving the indicator whether mapper found the exact match.
- * If mapper is not sure whether it's exact match, ignore this paramter.
- * Return Value:
- * An opaque pointer for font handle, or NULL if system mapping is not supported.
- **/
- void* (*MapFont)(struct _FPDF_SYSFONTINFO* pThis, int weight, int bItalic, int charset, int pitch_family,
- const char* face, int* bExact);
+ /**
+ * Method: GetFont
+ * Get a handle to a particular font by its internal ID
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * Yes only if MapFont method is not implemented.
+ * Comments:
+ * If the system mapping not supported, Foxit SDK will do the font mapping and use this method to get a font handle.
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * face - Typeface name. Currently use system local encoding only.
+ * Return Value:
+ * An opaque pointer for font handle.
+ **/
+ void* (*GetFont)(struct _FPDF_SYSFONTINFO* pThis, const char* face);
- /**
- * Method: GetFont
- * Get a handle to a particular font by its internal ID
- * Interface Version:
- * 1
- * Implementation Required:
- * Yes only if MapFont method is not implemented.
- * Comments:
- * If the system mapping not supported, Foxit SDK will do the font mapping and use this method to get a font handle.
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * face - Typeface name. Currently use system local encoding only.
- * Return Value:
- * An opaque pointer for font handle.
- **/
- void* (*GetFont)(struct _FPDF_SYSFONTINFO* pThis, const char* face);
+ /**
+ * Method: GetFontData
+ * Get font data from a font
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * Yes
+ * Comments:
+ * Can read either full font file, or a particular TrueType/OpenType table
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * hFont - Font handle returned by MapFont or GetFont method
+ * table - TrueType/OpenType table identifier (refer to TrueType specification).
+ * 0 for the whole font file.
+ * buffer - The buffer receiving the font data. Can be NULL if not provided
+ * buf_size - Buffer size, can be zero if not provided
+ * Return Value:
+ * Number of bytes needed, if buffer not provided or not large enough,
+ * or number of bytes written into buffer otherwise.
+ **/
+ unsigned long (*GetFontData)(struct _FPDF_SYSFONTINFO* pThis, void* hFont,
+ unsigned int table, unsigned char* buffer, unsigned long buf_size);
- /**
- * Method: GetFontData
- * Get font data from a font
- * Interface Version:
- * 1
- * Implementation Required:
- * Yes
- * Comments:
- * Can read either full font file, or a particular TrueType/OpenType table
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * hFont - Font handle returned by MapFont or GetFont method
- * table - TrueType/OpenType table identifier (refer to TrueType specification).
- * 0 for the whole font file.
- * buffer - The buffer receiving the font data. Can be NULL if not provided
- * buf_size - Buffer size, can be zero if not provided
- * Return Value:
- * Number of bytes needed, if buffer not provided or not large enough,
- * or number of bytes written into buffer otherwise.
- **/
- unsigned long (*GetFontData)(struct _FPDF_SYSFONTINFO* pThis, void* hFont,
- unsigned int table, unsigned char* buffer, unsigned long buf_size);
+ /**
+ * Method: GetFaceName
+ * Get face name from a font handle
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * No
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * hFont - Font handle returned by MapFont or GetFont method
+ * buffer - The buffer receiving the face name. Can be NULL if not provided
+ * buf_size - Buffer size, can be zero if not provided
+ * Return Value:
+ * Number of bytes needed, if buffer not provided or not large enough,
+ * or number of bytes written into buffer otherwise.
+ **/
+ unsigned long (*GetFaceName)(struct _FPDF_SYSFONTINFO* pThis, void* hFont, char* buffer, unsigned long buf_size);
- /**
- * Method: GetFaceName
- * Get face name from a font handle
- * Interface Version:
- * 1
- * Implementation Required:
- * No
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * hFont - Font handle returned by MapFont or GetFont method
- * buffer - The buffer receiving the face name. Can be NULL if not provided
- * buf_size - Buffer size, can be zero if not provided
- * Return Value:
- * Number of bytes needed, if buffer not provided or not large enough,
- * or number of bytes written into buffer otherwise.
- **/
- unsigned long (*GetFaceName)(struct _FPDF_SYSFONTINFO* pThis, void* hFont, char* buffer, unsigned long buf_size);
-
- /**
- * Method: GetFontCharset
- * Get character set information for a font handle
- * Interface Version:
- * 1
- * Implementation Required:
- * No
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * hFont - Font handle returned by MapFont or GetFont method
- * Return Value:
- * Character set identifier. See defined constants above.
- **/
- int (*GetFontCharset)(struct _FPDF_SYSFONTINFO* pThis, void* hFont);
+ /**
+ * Method: GetFontCharset
+ * Get character set information for a font handle
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * No
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * hFont - Font handle returned by MapFont or GetFont method
+ * Return Value:
+ * Character set identifier. See defined constants above.
+ **/
+ int (*GetFontCharset)(struct _FPDF_SYSFONTINFO* pThis, void* hFont);
- /**
- * Method: DeleteFont
- * Delete a font handle
- * Interface Version:
- * 1
- * Implementation Required:
- * Yes
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * hFont - Font handle returned by MapFont or GetFont method
- * Return Value:
- * None
- **/
- void (*DeleteFont)(struct _FPDF_SYSFONTINFO* pThis, void* hFont);
+ /**
+ * Method: DeleteFont
+ * Delete a font handle
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * Yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * hFont - Font handle returned by MapFont or GetFont method
+ * Return Value:
+ * None
+ **/
+ void (*DeleteFont)(struct _FPDF_SYSFONTINFO* pThis, void* hFont);
} FPDF_SYSFONTINFO;
/**
@@ -215,48 +215,48 @@ DLLEXPORT const FPDF_CharsetFontMap* STDCALL FPDF_GetDefaultTTFMap();
/**
* Function: FPDF_AddInstalledFont
- * Add a system font to the list in Foxit SDK.
+ * Add a system font to the list in Foxit SDK.
* Comments:
- * This function is only called during the system font list building process.
+ * 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.
+ * mapper - Opaque pointer to Foxit font mapper
+ * face - The font face name
+ * charset - Font character set. See above defined constants.
* Return Value:
- * None.
+ * None.
**/
DLLEXPORT void STDCALL FPDF_AddInstalledFont(void* mapper, const char* face, int charset);
/**
* Function: FPDF_SetSystemFontInfo
- * Set the system font info interface into Foxit SDK
+ * Set the system font info interface into Foxit SDK
* Comments:
- * Platform support implementation should implement required methods of FFDF_SYSFONTINFO interface,
- * then call this function during SDK initialization process.
+ * Platform support implementation should implement required methods of FFDF_SYSFONTINFO interface,
+ * then call this function during SDK initialization process.
* Parameters:
- * pFontInfo - Pointer to a FPDF_SYSFONTINFO structure
+ * pFontInfo - Pointer to a FPDF_SYSFONTINFO structure
* Return Value:
- * None
+ * None
**/
DLLEXPORT void STDCALL FPDF_SetSystemFontInfo(FPDF_SYSFONTINFO* pFontInfo);
/**
* Function: FPDF_GetDefaultSystemFontInfo
- * Get default system font info interface for current platform
+ * Get default system font info interface for current platform
* Comments:
- * For some platforms Foxit SDK implement a default version of system font info interface.
- * The default implementation can be used in FPDF_SetSystemFontInfo function.
+ * For some platforms Foxit SDK implement a default version of system font info interface.
+ * The default implementation can be used in FPDF_SetSystemFontInfo function.
* Parameters:
- * None
+ * 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_FreeMemory to free the returned pointer.
+ * 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_FreeMemory to free the returned pointer.
**/
DLLEXPORT FPDF_SYSFONTINFO* STDCALL FPDF_GetDefaultSystemFontInfo();
#ifdef __cplusplus
-};
+}
#endif
-#endif // _FPDF_SYSFONTINFO_H
+#endif // PUBLIC_FPDF_SYSFONTINFO_H_
diff --git a/public/fpdf_text.h b/public/fpdf_text.h
index d37715f6b8..32f5c7c15b 100644
--- a/public/fpdf_text.h
+++ b/public/fpdf_text.h
@@ -1,11 +1,11 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef _FPDFTEXT_H_
-#define _FPDFTEXT_H_
+#ifndef PUBLIC_FPDF_TEXT_H_
+#define PUBLIC_FPDF_TEXT_H_
#include "fpdfview.h"
@@ -15,306 +15,306 @@ extern "C" {
#endif
// Function: FPDFText_LoadPage
-// Prepare information about all characters in a page.
+// Prepare information about all characters in a page.
// Parameters:
-// page - Handle to the page. Returned by FPDF_LoadPage function (in FPDFVIEW module).
+// 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.
+// 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.
+// Application must call FPDFText_ClosePage to release the text page information.
//
-DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page);
+DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page);
// Function: FPDFText_ClosePage
-// Release all resources allocated for a text page information structure.
+// 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.
+// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
// Return Value:
-// None.
+// None.
//
DLLEXPORT void STDCALL FPDFText_ClosePage(FPDF_TEXTPAGE text_page);
// Function: FPDFText_CountChars
-// Get number of characters in a page.
+// Get number of characters in a page.
// Parameters:
-// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
+// 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.
+// 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.
+// 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.
//
DLLEXPORT int STDCALL FPDFText_CountChars(FPDF_TEXTPAGE text_page);
// Function: FPDFText_GetUnicode
-// Get Unicode of a character in a page.
+// 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.
+// 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.
+// 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.
//
DLLEXPORT unsigned int STDCALL FPDFText_GetUnicode(FPDF_TEXTPAGE text_page, int index);
// Function: FPDFText_GetFontSize
-// Get the font size of a particular character.
+// 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.
+// 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").
+// 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").
//
DLLEXPORT double STDCALL FPDFText_GetFontSize(FPDF_TEXTPAGE text_page, int index);
// Function: FPDFText_GetCharBox
-// Get bounding box of a particular character.
+// 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.
+// 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:
-// None.
+// None.
// Comments:
-// All positions are measured in PDF "user space".
+// All positions are measured in PDF "user space".
//
DLLEXPORT void STDCALL FPDFText_GetCharBox(FPDF_TEXTPAGE text_page, int index, double* left,
- double* right, double* bottom, double* top);
+ double* right, double* bottom, double* top);
// Function: FPDFText_GetCharIndexAtPos
-// Get the index of a character at or nearby a certain position on the page.
+// 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 unit.
-// yTolerance - A y-axis tolerance value for character hit detection, in point unit.
+// 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 unit.
+// yTolerance - A y-axis tolerance value for character hit detection, in point unit.
// 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.
+// 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.
//
DLLEXPORT int STDCALL FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page,
- double x, double y, double xTorelance, double yTolerance);
+ double x, double y, double xTorelance, double yTolerance);
// Function: FPDFText_GetText
-// Extract unicode text string from the page.
+// 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 characters to be extracted.
-// result - A buffer (allocated by application) receiving the extracted unicodes.
-// The size of the buffer must be able to hold the number of characters plus a terminator.
+// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
+// start_index - Index for the start characters.
+// count - Number of characters to be extracted.
+// result - A buffer (allocated by application) receiving the extracted unicodes.
+// The size of the buffer must be able to hold the number of characters plus a terminator.
// Return Value:
-// Number of characters written into the result buffer, including the trailing terminator.
+// Number of characters written into the result buffer, including the trailing terminator.
// Comments:
-// This function ignores characters without unicode information.
+// This function ignores characters without unicode information.
//
DLLEXPORT int STDCALL FPDFText_GetText(FPDF_TEXTPAGE text_page, int start_index, int count, unsigned short* result);
// Function: FPDFText_CountRects
-// Count number of rectangular areas occupied by a segment of texts.
+// Count number of rectangular areas occupied by a segment of texts.
// 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 characters.
+// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
+// start_index - Index for the start characters.
+// count - Number of characters.
// Return value:
-// Number of rectangles. Zero for error.
+// Number of rectangles. Zero for error.
// 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 or something.
-// FPDFTEXT will automatically merge small character boxes into bigger one if those characters
-// are on the same line and use same font settings.
+// 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 or something.
+// FPDFTEXT will automatically merge small character boxes into bigger one if those characters
+// are on the same line and use same font settings.
//
DLLEXPORT int STDCALL FPDFText_CountRects(FPDF_TEXTPAGE text_page, int start_index, int count);
// Function: FPDFText_GetRect
-// Get a rectangular area from the result generated by FPDFText_CountRects.
+// 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.
+// 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:
-// None.
+// None.
//
DLLEXPORT void STDCALL FPDFText_GetRect(FPDF_TEXTPAGE text_page, int rect_index, double* left, double* top,
- double* right, double* bottom);
+ double* right, double* bottom);
// Function: FPDFText_GetBoundedText
-// Extract unicode text within a rectangular boundary on the page.
+// 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 - A unicode buffer.
-// buflen - Number of characters (not bytes) for the buffer, excluding an additional terminator.
+// 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 - A unicode buffer.
+// buflen - Number of characters (not bytes) for the buffer, excluding an additional terminator.
// Return Value:
-// If buffer is NULL or buflen is zero, return number of characters (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 characters copied into the buffer, including the terminating NUL
-// when space for it is available.
+// If buffer is NULL or buflen is zero, return number of characters (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 characters 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.
+// If the buffer is too small, as much text as will fit is copied into it.
//
DLLEXPORT int STDCALL FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page,double left, double top,
- double right, double bottom,unsigned short* buffer,int buflen);
+ double right, double bottom,unsigned short* buffer,int buflen);
// Flags used by FPDFText_FindStart function.
-#define FPDF_MATCHCASE 0x00000001 //If not set, it will not match case by default.
-#define FPDF_MATCHWHOLEWORD 0x00000002 //If not set, it will not match the whole word by default.
+#define FPDF_MATCHCASE 0x00000001 //If not set, it will not match case by default.
+#define FPDF_MATCHWHOLEWORD 0x00000002 //If not set, it will not match the whole word by default.
// Function: FPDFText_FindStart
-// Start a search.
+// 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.
+// 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.
+// A handle for the search context. FPDFText_FindClose must be called to release this handle.
//
DLLEXPORT FPDF_SCHHANDLE STDCALL FPDFText_FindStart(FPDF_TEXTPAGE text_page, FPDF_WIDESTRING findwhat,
- unsigned long flags, int start_index);
+ unsigned long flags, int start_index);
// Function: FPDFText_FindNext
-// Search in the direction from page start to end.
+// Search in the direction from page start to end.
// Parameters:
-// handle - A search context handle returned by FPDFText_FindStart.
+// handle - A search context handle returned by FPDFText_FindStart.
// Return Value:
-// Whether a match is found.
+// Whether a match is found.
//
DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindNext(FPDF_SCHHANDLE handle);
// Function: FPDFText_FindPrev
-// Search in the direction from page end to start.
+// Search in the direction from page end to start.
// Parameters:
-// handle - A search context handle returned by FPDFText_FindStart.
+// handle - A search context handle returned by FPDFText_FindStart.
// Return Value:
-// Whether a match is found.
+// Whether a match is found.
//
DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindPrev(FPDF_SCHHANDLE handle);
// Function: FPDFText_GetSchResultIndex
-// Get the starting character index of the search result.
+// Get the starting character index of the search result.
// Parameters:
-// handle - A search context handle returned by FPDFText_FindStart.
+// handle - A search context handle returned by FPDFText_FindStart.
// Return Value:
-// Index for the starting character.
+// Index for the starting character.
//
DLLEXPORT int STDCALL FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle);
// Function: FPDFText_GetSchCount
-// Get the number of matched characters in the search result.
+// Get the number of matched characters in the search result.
// Parameters:
-// handle - A search context handle returned by FPDFText_FindStart.
+// handle - A search context handle returned by FPDFText_FindStart.
// Return Value:
-// Number of matched characters.
+// Number of matched characters.
//
DLLEXPORT int STDCALL FPDFText_GetSchCount(FPDF_SCHHANDLE handle);
// Function: FPDFText_FindClose
-// Release a search context.
+// Release a search context.
// Parameters:
-// handle - A search context handle returned by FPDFText_FindStart.
+// handle - A search context handle returned by FPDFText_FindStart.
// Return Value:
-// None.
+// None.
//
DLLEXPORT void STDCALL FPDFText_FindClose(FPDF_SCHHANDLE handle);
// Function: FPDFLink_LoadWebLinks
-// Prepare information about weblinks in a page.
+// Prepare information about weblinks in a page.
// Parameters:
-// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
+// 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.
-// NULL if something goes wrong.
+// A handle to the page's links information structure.
+// 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 "http://www.foxitsoftware.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.
+// 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 "http://www.foxitsoftware.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.
//
-// FPDFLink_CloseWebLinks must be called to release resources.
+// FPDFLink_CloseWebLinks must be called to release resources.
//
DLLEXPORT FPDF_PAGELINK STDCALL FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page);
// Function: FPDFLink_CountWebLinks
-// Count number of detected web links.
+// Count number of detected web links.
// Parameters:
-// link_page - Handle returned by FPDFLink_LoadWebLinks.
+// link_page - Handle returned by FPDFLink_LoadWebLinks.
// Return Value:
-// Number of detected web links.
+// Number of detected web links.
//
DLLEXPORT int STDCALL FPDFLink_CountWebLinks(FPDF_PAGELINK link_page);
// Function: FPDFLink_GetURL
-// Fetch the URL information for a detected web link.
+// 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.
-// buflen - Number of characters (not bytes) for the buffer, including an additional terminator.
+// link_page - Handle returned by FPDFLink_LoadWebLinks.
+// link_index - Zero-based index for the link.
+// buffer - A unicode buffer.
+// buflen - Number of characters (not bytes) for the buffer, including an additional terminator.
// Return Value:
-// If buffer is NULL or buflen is zero, return number of characters (not bytes and an additional terminator is also counted) needed,
-// otherwise, return number of characters copied into the buffer.
+// If buffer is NULL or buflen is zero, return number of characters (not bytes and an additional terminator is also counted) needed,
+// otherwise, return number of characters copied into the buffer.
//
DLLEXPORT int STDCALL FPDFLink_GetURL(FPDF_PAGELINK link_page, int link_index, unsigned short* buffer,int buflen);
// Function: FPDFLink_CountRects
-// Count number of rectangular areas for the link.
+// Count number of rectangular areas for the link.
// Parameters:
-// link_page - Handle returned by FPDFLink_LoadWebLinks.
-// link_index - Zero-based index for the link.
+// link_page - Handle returned by FPDFLink_LoadWebLinks.
+// link_index - Zero-based index for the link.
// Return Value:
-// Number of rectangular areas for the link.
+// Number of rectangular areas for the link.
//
DLLEXPORT int STDCALL FPDFLink_CountRects(FPDF_PAGELINK link_page, int link_index);
// Function: FPDFLink_GetRect
-// Fetch the boundaries of a rectangle for a link.
+// 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.
+// 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:
-// None.
+// None.
//
DLLEXPORT void STDCALL FPDFLink_GetRect(FPDF_PAGELINK link_page, int link_index, int rect_index,
- double* left, double* top,double* right, double* bottom);
+ double* left, double* top,double* right, double* bottom);
// Function: FPDFLink_CloseWebLinks
-// Release resources used by weblink feature.
+// Release resources used by weblink feature.
// Parameters:
-// link_page - Handle returned by FPDFLink_LoadWebLinks.
+// link_page - Handle returned by FPDFLink_LoadWebLinks.
// Return Value:
-// None.
+// None.
//
DLLEXPORT void STDCALL FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page);
#ifdef __cplusplus
-};
+}
#endif
-#endif//_FPDFTEXT_H_
+#endif // PUBLIC_FPDF_TEXT_H_
diff --git a/public/fpdf_transformpage.h b/public/fpdf_transformpage.h
index dcb56cb7d2..6278b9d0dd 100644
--- a/public/fpdf_transformpage.h
+++ b/public/fpdf_transformpage.h
@@ -1,15 +1,13 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef _TRANSFORMPAGE_H_
-#define _TRANSFORMPAGE_H_
+#ifndef PUBLIC_FPDF_TRANSFORMPAGE_H_
+#define PUBLIC_FPDF_TRANSFORMPAGE_H_
-#ifndef _FPDFVIEW_H_
#include "fpdfview.h"
-#endif
#ifdef __cplusplus
extern "C" {
@@ -17,45 +15,46 @@ extern "C" {
typedef void* FPDF_PAGEARCSAVER;
typedef void* FPDF_PAGEARCLOADER;
+
/**
-* Set "MediaBox" entry to the page dictionary.
-* @param[in] page - Handle to a page.
-* @param[in] left - The left of the rectangle.
-* @param[in] bottom - The bottom of the rectangle.
-* @param[in] right - The right of the rectangle.
-* @param[in] top - The top of the rectangle.
+* Set "MediaBox" entry to the page dictionary.
+* @param[in] page - Handle to a page.
+* @param[in] left - The left of the rectangle.
+* @param[in] bottom - The bottom of the rectangle.
+* @param[in] right - The right of the rectangle.
+* @param[in] top - The top of the rectangle.
* @retval None.
*/
DLLEXPORT void STDCALL FPDFPage_SetMediaBox(FPDF_PAGE page, float left, float bottom, float right, float top);
/**
-* Set "CropBox" entry to the page dictionary.
-* @param[in] page - Handle to a page.
-* @param[in] left - The left of the rectangle.
-* @param[in] bottom - The bottom of the rectangle.
-* @param[in] right - The right of the rectangle.
-* @param[in] top - The top of the rectangle.
+* Set "CropBox" entry to the page dictionary.
+* @param[in] page - Handle to a page.
+* @param[in] left - The left of the rectangle.
+* @param[in] bottom - The bottom of the rectangle.
+* @param[in] right - The right of the rectangle.
+* @param[in] top - The top of the rectangle.
* @retval None.
*/
DLLEXPORT void STDCALL FPDFPage_SetCropBox(FPDF_PAGE page, float left, float bottom, float right, float top);
-/** Get "MediaBox" entry from the page dictionary.
-* @param[in] page - Handle to a page.
-* @param[in] left - Pointer to a double value receiving the left of the rectangle.
-* @param[in] bottom - Pointer to a double value receiving the bottom of the rectangle.
-* @param[in] right - Pointer to a double value receiving the right of the rectangle.
-* @param[in] top - Pointer to a double value receiving the top of the rectangle.
+/** Get "MediaBox" entry from the page dictionary.
+* @param[in] page - Handle to a page.
+* @param[in] left - Pointer to a double value receiving the left of the rectangle.
+* @param[in] bottom - Pointer to a double value receiving the bottom of the rectangle.
+* @param[in] right - Pointer to a double value receiving the right of the rectangle.
+* @param[in] top - Pointer to a double value receiving the top of the rectangle.
* @retval True if success,else fail.
*/
DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetMediaBox(FPDF_PAGE page, float* left, float* bottom, float* right, float* top);
-/** Get "CropBox" entry from the page dictionary.
-* @param[in] page - Handle to a page.
-* @param[in] left - Pointer to a double value receiving the left of the rectangle.
-* @param[in] bottom - Pointer to a double value receiving the bottom of the rectangle.
-* @param[in] right - Pointer to a double value receiving the right of the rectangle.
-* @param[in] top - Pointer to a double value receiving the top of the rectangle.
+/** Get "CropBox" entry from the page dictionary.
+* @param[in] page - Handle to a page.
+* @param[in] left - Pointer to a double value receiving the left of the rectangle.
+* @param[in] bottom - Pointer to a double value receiving the bottom of the rectangle.
+* @param[in] right - Pointer to a double value receiving the right of the rectangle.
+* @param[in] top - Pointer to a double value receiving the top of the rectangle.
* @retval True if success,else fail.
*/
DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetCropBox(FPDF_PAGE page, float* left, float* bottom, float* right, float* top);
@@ -63,9 +62,9 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetCropBox(FPDF_PAGE page, float* left, flo
/**
* Transform the whole page with a specified matrix, then clip the page content region.
*
-* @param[in] page - A page handle.
-* @param[in] matrix - The transform matrix.
-* @param[in] clipRect - A rectangle page area to be clipped.
+* @param[in] page - A page handle.
+* @param[in] matrix - The transform matrix.
+* @param[in] clipRect - A rectangle page area to be clipped.
* @Note. This function will transform the whole page, and would take effect to all the objects in the page.
*/
DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX* matrix, FS_RECTF* clipRect);
@@ -73,23 +72,23 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX
/**
* Transform (scale, rotate, shear, move) the clip path of page object.
* @param[in] page_object - Handle to a page object. Returned by FPDFPageObj_NewImageObj.
-* @param[in] a - The coefficient "a" of the matrix.
-* @param[in] b - The coefficient "b" of the matrix.
-* @param[in] c - The coefficient "c" of the matrix.
-* @param[in] d - The coefficient "d" of the matrix.
-* @param[in] e - The coefficient "e" of the matrix.
-* @param[in] f - The coefficient "f" of the matrix.
+* @param[in] a - The coefficient "a" of the matrix.
+* @param[in] b - The coefficient "b" of the matrix.
+* @param[in] c - The coefficient "c" of the matrix.
+* @param[in] d - The coefficient "d" of the matrix.
+* @param[in] e - The coefficient "e" of the matrix.
+* @param[in] f - The coefficient "f" of the matrix.
* @retval None.
*/
DLLEXPORT void STDCALL FPDFPageObj_TransformClipPath(FPDF_PAGEOBJECT page_object,double a, double b, double c, double d, double e, double f);
/**
* Create a new clip path, with a rectangle inserted.
-*
-* @param[in] left - The left of the clip box.
+*
+* @param[in] left - The left of the clip box.
* @param[in] bottom - The bottom of the clip box.
-* @param[in] right - The right of the clip box.
-* @param[in] top - The top of the clip box.
+* @param[in] right - The right of the clip box.
+* @param[in] top - The top of the clip box.
* @retval a handle to the clip path.
*/
DLLEXPORT FPDF_CLIPPATH STDCALL FPDF_CreateClipPath(float left, float bottom, float right, float top);
@@ -106,10 +105,10 @@ DLLEXPORT void STDCALL FPDF_DestroyClipPath(FPDF_CLIPPATH clipPath);
/**
* Clip the page content, the page content that outside the clipping region become invisible.
*
-* @param[in] page - A page handle.
-* @param[in] clipPath - A handle to the clip path.
+* @param[in] page - A page handle.
+* @param[in] clipPath - A handle to the clip path.
* @Note. A clip path will be inserted before the page content stream or content array. In this way, the page content will be clipped
-* by this clip path.
+* by this clip path.
*/
DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page,FPDF_CLIPPATH clipPath);
@@ -117,5 +116,4 @@ DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page,FPDF_CLIPPATH clip
}
#endif
-#endif
-
+#endif // PUBLIC_FPDF_TRANSFORMPAGE_H_
diff --git a/public/fpdfview.h b/public/fpdfview.h
index 9794d5fd00..91787dfa23 100644
--- a/public/fpdfview.h
+++ b/public/fpdfview.h
@@ -1,49 +1,46 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
// NOTE: External docs refer to this file as "fpdfview.h", so do not rename
// despite lack of consitency with other public files.
-#ifndef _FPDFVIEW_H_
-#define _FPDFVIEW_H_
+#ifndef PUBLIC_FPDFVIEW_H_
+#define PUBLIC_FPDFVIEW_H_
#if defined(_WIN32) && !defined(__WINDOWS__)
#include <windows.h>
#endif
// Data types
-typedef void* FPDF_MODULEMGR;
+typedef void* FPDF_MODULEMGR;
// PDF types
-typedef void* FPDF_DOCUMENT;
-typedef void* FPDF_PAGE;
-typedef void* FPDF_PAGEOBJECT; // Page object(text, path, etc)
-typedef void* FPDF_PATH;
-typedef void* FPDF_CLIPPATH;
-typedef void* FPDF_BITMAP;
-typedef void* FPDF_FONT;
-
-typedef void* FPDF_TEXTPAGE;
-typedef void* FPDF_SCHHANDLE;
-typedef void* FPDF_PAGELINK;
-typedef void* FPDF_HMODULE;
-typedef void* FPDF_DOCSCHHANDLE;
-
-typedef void* FPDF_BOOKMARK;
-typedef void* FPDF_DEST;
-typedef void* FPDF_ACTION;
-typedef void* FPDF_LINK;
-typedef void* FPDF_PAGERANGE;
+typedef void* FPDF_DOCUMENT;
+typedef void* FPDF_PAGE;
+typedef void* FPDF_PAGEOBJECT; // Page object(text, path, etc)
+typedef void* FPDF_PATH;
+typedef void* FPDF_CLIPPATH;
+typedef void* FPDF_BITMAP;
+typedef void* FPDF_FONT;
+typedef void* FPDF_TEXTPAGE;
+typedef void* FPDF_SCHHANDLE;
+typedef void* FPDF_PAGELINK;
+typedef void* FPDF_HMODULE;
+typedef void* FPDF_DOCSCHHANDLE;
+typedef void* FPDF_BOOKMARK;
+typedef void* FPDF_DEST;
+typedef void* FPDF_ACTION;
+typedef void* FPDF_LINK;
+typedef void* FPDF_PAGERANGE;
// Basic data types
-typedef int FPDF_BOOL;
-typedef int FPDF_ERROR;
-typedef unsigned long FPDF_DWORD;
-
-typedef float FS_FLOAT;
+typedef int FPDF_BOOL;
+typedef int FPDF_ERROR;
+typedef unsigned long FPDF_DWORD;
+typedef float FS_FLOAT;
// Duplex types
typedef enum _FPDF_DUPLEXTYPE_ {
@@ -54,19 +51,19 @@ typedef enum _FPDF_DUPLEXTYPE_ {
} FPDF_DUPLEXTYPE;
// String types
-typedef unsigned short FPDF_WCHAR;
-typedef unsigned char const* FPDF_LPCBYTE;
+typedef unsigned short FPDF_WCHAR;
+typedef unsigned char const* FPDF_LPCBYTE;
// FPDFSDK may use three types of strings: byte string, wide string (UTF-16LE encoded), and platform dependent string
-typedef const char* FPDF_BYTESTRING;
+typedef const char* FPDF_BYTESTRING;
-typedef const unsigned short* FPDF_WIDESTRING; // Foxit PDF SDK always use UTF-16LE encoding wide string,
- // each character use 2 bytes (except surrogation), with low byte first.
+typedef const unsigned short* FPDF_WIDESTRING; // Foxit PDF SDK always use UTF-16LE encoding wide string,
+ // each character use 2 bytes (except surrogation), with low byte first.
// For Windows programmers: for most case it's OK to treat FPDF_WIDESTRING as Windows unicode string,
-// however, special care needs to be taken if you expect to process Unicode larger than 0xffff.
+// however, special care needs to be taken if you expect to process Unicode larger than 0xffff.
// For Linux/Unix programmers: most compiler/library environment uses 4 bytes for a Unicode character,
-// you have to convert between FPDF_WIDESTRING and system wide string by yourself.
+// you have to convert between FPDF_WIDESTRING and system wide string by yourself.
#ifdef _WIN32_WCE
typedef const unsigned short* FPDF_STRING;
@@ -79,12 +76,12 @@ typedef const char* FPDF_STRING;
/** @brief Matrix for transformation. */
typedef struct _FS_MATRIX_
{
- float a; /**< @brief Coefficient a.*/
- float b; /**< @brief Coefficient b.*/
- float c; /**< @brief Coefficient c.*/
- float d; /**< @brief Coefficient d.*/
- float e; /**< @brief Coefficient e.*/
- float f; /**< @brief Coefficient f.*/
+ float a; /**< @brief Coefficient a.*/
+ float b; /**< @brief Coefficient b.*/
+ float c; /**< @brief Coefficient c.*/
+ float d; /**< @brief Coefficient d.*/
+ float e; /**< @brief Coefficient e.*/
+ float f; /**< @brief Coefficient f.*/
} FS_MATRIX;
#endif
@@ -93,19 +90,19 @@ typedef struct _FS_MATRIX_
/** @brief Rectangle area(float) in device or page coordination system. */
typedef struct _FS_RECTF_
{
- /**@{*/
- /** @brief The x-coordinate of the left-top corner. */
- float left;
- /** @brief The y-coordinate of the left-top corner. */
- float top;
- /** @brief The x-coordinate of the right-bottom corner. */
- float right;
- /** @brief The y-coordinate of the right-bottom corner. */
- float bottom;
- /**@}*/
+ /**@{*/
+ /** @brief The x-coordinate of the left-top corner. */
+ float left;
+ /** @brief The y-coordinate of the left-top corner. */
+ float top;
+ /** @brief The x-coordinate of the right-bottom corner. */
+ float right;
+ /** @brief The y-coordinate of the right-bottom corner. */
+ float bottom;
+ /**@}*/
}* FS_LPRECTF, FS_RECTF;
/** @brief Const Pointer to ::FS_RECTF structure.*/
-typedef const FS_RECTF* FS_LPCRECTF;
+typedef const FS_RECTF* FS_LPCRECTF;
#endif
#if defined(_WIN32) && defined(FPDFSDK_EXPORTS)
@@ -126,525 +123,524 @@ extern "C" {
#endif
// Function: FPDF_InitLibrary
-// Initialize the FPDFSDK library
+// Initialize the FPDFSDK library
// Parameters:
-// None
+// None
// Return value:
-// None.
+// None.
// Comments:
-// You have to call this function before you can call any PDF processing functions.
+// You have to call this function before you can call any PDF processing functions.
DLLEXPORT void STDCALL FPDF_InitLibrary();
// Function: FPDF_DestroyLibary
-// Release all resources allocated by the FPDFSDK library.
+// Release all resources allocated by the FPDFSDK library.
// Parameters:
-// None.
+// None.
// Return value:
-// None.
+// None.
// Comments:
-// You can call this function to release all memory blocks allocated by the library.
-// After this function called, you should not call any PDF processing functions.
+// You can call this function to release all memory blocks allocated by the library.
+// After this function called, you should not call any PDF processing functions.
DLLEXPORT void STDCALL FPDF_DestroyLibrary();
//Policy for accessing the local machine time.
-#define FPDF_POLICY_MACHINETIME_ACCESS 0
+#define FPDF_POLICY_MACHINETIME_ACCESS 0
// 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 for enable, False for disable the policy.
+// Set the policy for the sandbox environment.
+// Parameters:
+// policy - The specified policy for setting, for example:FPDF_POLICY_MACHINETIME_ACCESS.
+// enable - True for enable, False for disable the policy.
// Return value:
-// None.
-DLLEXPORT void STDCALL FPDF_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enable);
+// None.
+DLLEXPORT void STDCALL FPDF_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enable);
/**
* Open and load a PDF document.
-* @param[in] file_path - Path to the PDF file (including extension).
-* @param[in] password - A string used as the password for PDF file.
-* If no password needed, empty or NULL can be used.
-* @note Loaded document can be closed by FPDF_CloseDocument.
-* If this function fails, you can use FPDF_GetLastError() to retrieve
-* the reason why it fails.
-* @retval A handle to the loaded document. If failed, NULL is returned.
+* @param[in] file_path - Path to the PDF file (including extension).
+* @param[in] password - A string used as the password for PDF file.
+* If no password needed, empty or NULL can be used.
+* @note Loaded document can be closed by FPDF_CloseDocument.
+* If this function fails, you can use FPDF_GetLastError() to retrieve
+* the reason why it fails.
+* @retval A handle to the loaded document. If failed, NULL is returned.
*/
-DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path,
- FPDF_BYTESTRING password);
+DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path,
+ FPDF_BYTESTRING password);
// 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 PDF file.
-// If no password needed, empty or NULL can be used.
-// Return value:
-// A handle to the loaded document. If failed, NULL is returned.
+// 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 PDF file.
+// If no password needed, empty or NULL can be used.
+// Return value:
+// A handle to the loaded document. If failed, NULL is returned.
// Comments:
-// The memory buffer must remain valid when the document is open.
-// Loaded document can be closed by FPDF_CloseDocument.
-// If this function fails, you can use FPDF_GetLastError() to retrieve
-// the reason why it fails.
+// The memory buffer must remain valid when the document is open.
+// Loaded document can be closed by FPDF_CloseDocument.
+// If this function fails, you can use FPDF_GetLastError() to retrieve
+// the reason why it fails.
//
-DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadMemDocument(const void* data_buf,
- int size, FPDF_BYTESTRING password);
+DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadMemDocument(const void* data_buf,
+ int size, FPDF_BYTESTRING password);
// Structure for custom file access.
typedef struct {
- // File length, in bytes.
- unsigned long m_FileLen;
-
- // A function pointer for getting a block of data from specific position.
- // Position is specified by byte offset from beginning of the file.
- // The position and size will never go out range of file length.
- // It may be possible for FPDFSDK to call this function multiple times for same position.
- // Return value: should be non-zero if successful, zero for error.
- int (*m_GetBlock)(void* param, unsigned long position, unsigned char* pBuf, unsigned long size);
-
- // A custom pointer for all implementation specific data.
- // This pointer will be used as the first parameter to m_GetBlock callback.
- void* m_Param;
+ // File length, in bytes.
+ unsigned long m_FileLen;
+
+ // A function pointer for getting a block of data from specific position.
+ // Position is specified by byte offset from beginning of the file.
+ // The position and size will never go out range of file length.
+ // It may be possible for FPDFSDK to call this function multiple times for same position.
+ // Return value: should be non-zero if successful, zero for error.
+ int (*m_GetBlock)(void* param, unsigned long position, unsigned char* pBuf, unsigned long size);
+
+ // A custom pointer for all implementation specific data.
+ // This pointer will be used as the first parameter to m_GetBlock callback.
+ void* m_Param;
} FPDF_FILEACCESS;
// Function: FPDF_LoadCustomDocument
-// Load PDF document from a custom access descriptor.
+// Load PDF document from a custom access descriptor.
// Parameters:
-// pFileAccess - A structure for access the file.
-// password - Optional password for decrypting the PDF file.
+// pFileAccess - A structure for access the file.
+// password - Optional password for decrypting the PDF file.
// Return value:
-// A handle to the loaded document. If failed, NULL is returned.
+// A handle to the loaded document. If failed, NULL is returned.
// Comments:
-// The application should maintain the file resources being valid until the PDF document close.
-// Loaded document can be closed by FPDF_CloseDocument.
-DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadCustomDocument(FPDF_FILEACCESS* pFileAccess,
- FPDF_BYTESTRING password);
+// The application should maintain the file resources being valid until the PDF document close.
+// Loaded document can be closed by FPDF_CloseDocument.
+DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadCustomDocument(FPDF_FILEACCESS* pFileAccess,
+ FPDF_BYTESTRING password);
// Function: FPDF_GetFileVersion
-// Get the file version of the specific PDF document.
+// Get the file version of the specific PDF document.
// Parameters:
-// doc - Handle to document.
-// fileVersion - The PDF file version. File version: 14 for 1.4, 15 for 1.5, ...
+// doc - Handle to document.
+// fileVersion - The PDF file version. File version: 14 for 1.4, 15 for 1.5, ...
// Return value:
-// TRUE if this call succeed, If failed, FALSE is returned.
+// TRUE if this call succeed, If failed, FALSE is returned.
// Comments:
-// If the document is created by function ::FPDF_CreateNewDocument, then this function would always fail.
+// If the document is created by function ::FPDF_CreateNewDocument, then this function would always fail.
DLLEXPORT FPDF_BOOL STDCALL FPDF_GetFileVersion(FPDF_DOCUMENT doc, int* fileVersion);
-#define FPDF_ERR_SUCCESS 0 // No error.
-#define FPDF_ERR_UNKNOWN 1 // Unknown error.
-#define FPDF_ERR_FILE 2 // File not found or could not be opened.
-#define FPDF_ERR_FORMAT 3 // File not in PDF format or corrupted.
-#define FPDF_ERR_PASSWORD 4 // Password required or incorrect password.
-#define FPDF_ERR_SECURITY 5 // Unsupported security scheme.
-#define FPDF_ERR_PAGE 6 // Page not found or content error.
+#define FPDF_ERR_SUCCESS 0 // No error.
+#define FPDF_ERR_UNKNOWN 1 // Unknown error.
+#define FPDF_ERR_FILE 2 // File not found or could not be opened.
+#define FPDF_ERR_FORMAT 3 // File not in PDF format or corrupted.
+#define FPDF_ERR_PASSWORD 4 // Password required or incorrect password.
+#define FPDF_ERR_SECURITY 5 // Unsupported security scheme.
+#define FPDF_ERR_PAGE 6 // Page not found or content error.
// Function: FPDF_GetLastError
-// Get last error code when an SDK function failed.
-// Parameters:
-// None.
+// Get last error code when an SDK function failed.
+// Parameters:
+// None.
// Return value:
-// A 32-bit integer indicating error codes (defined above).
+// A 32-bit integer indicating error codes (defined above).
// Comments:
-// If the previous SDK call succeeded, the return value of this function
-// is not defined.
+// If the previous SDK call succeeded, the return value of this function
+// is not defined.
//
-DLLEXPORT unsigned long STDCALL FPDF_GetLastError();
+DLLEXPORT unsigned long STDCALL FPDF_GetLastError();
// Function: FPDF_GetDocPermission
-// Get file permission flags of the document.
-// Parameters:
-// document - Handle to document. Returned by FPDF_LoadDocument function.
+// Get file permission flags of the document.
+// Parameters:
+// document - Handle to document. Returned by FPDF_LoadDocument function.
// Return value:
-// A 32-bit integer indicating permission flags. Please refer to PDF Reference for
-// detailed description. If the document is not protected, 0xffffffff will be returned.
+// A 32-bit integer indicating permission flags. Please refer to PDF Reference for
+// detailed description. If the document is not protected, 0xffffffff will be returned.
//
-DLLEXPORT unsigned long STDCALL FPDF_GetDocPermissions(FPDF_DOCUMENT document);
+DLLEXPORT unsigned long STDCALL FPDF_GetDocPermissions(FPDF_DOCUMENT document);
// Function: FPDF_GetSecurityHandlerRevision
-// Get the revision for security handler.
+// Get the revision for security handler.
// Parameters:
-// document - Handle to document. Returned by FPDF_LoadDocument function.
+// document - Handle to document. Returned by FPDF_LoadDocument function.
// Return value:
-// The security handler revision number. Please refer to PDF Reference for
-// detailed description. If the document is not protected, -1 will be returned.
+// The security handler revision number. Please refer to PDF Reference for
+// detailed description. If the document is not protected, -1 will be returned.
//
DLLEXPORT int STDCALL FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document);
// Function: FPDF_GetPageCount
-// Get total number of pages in a document.
-// Parameters:
-// document - Handle to document. Returned by FPDF_LoadDocument function.
+// Get total number of pages in a document.
+// Parameters:
+// document - Handle to document. Returned by FPDF_LoadDocument function.
// Return value:
-// Total number of pages in the document.
+// Total number of pages in the document.
//
DLLEXPORT int STDCALL FPDF_GetPageCount(FPDF_DOCUMENT document);
// Function: FPDF_LoadPage
-// Load a page inside a document.
-// Parameters:
-// document - Handle to document. Returned by FPDF_LoadDocument function.
-// page_index - Index number of the page. 0 for the first page.
+// Load a page inside a document.
+// Parameters:
+// document - Handle to document. Returned by FPDF_LoadDocument function.
+// page_index - Index number of the page. 0 for the first page.
// Return value:
-// A handle to the loaded page. If failed, NULL is returned.
+// A handle to the loaded page. If failed, NULL is returned.
// Comments:
-// Loaded page can be rendered to devices using FPDF_RenderPage function.
-// Loaded page can be closed by FPDF_ClosePage.
+// Loaded page can be rendered to devices using FPDF_RenderPage function.
+// Loaded page can be closed by FPDF_ClosePage.
//
-DLLEXPORT FPDF_PAGE STDCALL FPDF_LoadPage(FPDF_DOCUMENT document, int page_index);
+DLLEXPORT FPDF_PAGE STDCALL FPDF_LoadPage(FPDF_DOCUMENT document, int page_index);
// Function: FPDF_GetPageWidth
-// Get page width.
+// Get page width.
// Parameters:
-// page - Handle to the page. Returned by FPDF_LoadPage function.
+// page - Handle to the page. Returned by FPDF_LoadPage function.
// Return value:
-// Page width (excluding non-displayable area) measured in points.
-// One point is 1/72 inch (around 0.3528 mm).
+// Page width (excluding non-displayable area) measured in points.
+// One point is 1/72 inch (around 0.3528 mm).
//
DLLEXPORT double STDCALL FPDF_GetPageWidth(FPDF_PAGE page);
// Function: FPDF_GetPageHeight
-// Get page height.
+// Get page height.
// Parameters:
-// page - Handle to the page. Returned by FPDF_LoadPage function.
+// page - Handle to the page. Returned by FPDF_LoadPage function.
// Return value:
-// Page height (excluding non-displayable area) measured in points.
-// One point is 1/72 inch (around 0.3528 mm)
+// Page height (excluding non-displayable area) measured in points.
+// One point is 1/72 inch (around 0.3528 mm)
//
DLLEXPORT double STDCALL FPDF_GetPageHeight(FPDF_PAGE page);
// Function: FPDF_GetPageSizeByIndex
-// Get the size of a page by index.
+// Get the size of a page by index.
// Parameters:
-// document - Handle to document. Returned by FPDF_LoadDocument function.
-// page_index - Page index, zero for the first page.
-// width - Pointer to a double value receiving the page width (in points).
-// height - Pointer to a double value receiving the page height (in points).
+// document - Handle to document. Returned by FPDF_LoadDocument function.
+// page_index - Page index, zero for the first page.
+// width - Pointer to a double value receiving the page width (in points).
+// height - Pointer to a double value receiving the page height (in points).
// Return value:
-// Non-zero for success. 0 for error (document or page not found).
+// Non-zero for success. 0 for error (document or page not found).
//
DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, int page_index, double* width, double* height);
// Page rendering flags. They can be combined with bit OR.
-#define FPDF_ANNOT 0x01 // Set if annotations are to be rendered.
-#define FPDF_LCD_TEXT 0x02 // Set if using text rendering optimized for LCD display.
-#define FPDF_NO_NATIVETEXT 0x04 // Don't use the native text output available on some platforms
-#define FPDF_GRAYSCALE 0x08 // Grayscale output.
-#define FPDF_DEBUG_INFO 0x80 // Set if you want to get some debug info.
- // Please discuss with Foxit first if you need to collect debug info.
-#define FPDF_NO_CATCH 0x100 // Set if you don't want to catch exception.
-#define FPDF_RENDER_LIMITEDIMAGECACHE 0x200 // Limit image cache size.
-#define FPDF_RENDER_FORCEHALFTONE 0x400 // Always use halftone for image stretching.
-#define FPDF_PRINTING 0x800 // Render for printing.
-#define FPDF_RENDER_NO_SMOOTHTEXT 0x1000 // Set to disable anti-aliasing on text.
-#define FPDF_RENDER_NO_SMOOTHIMAGE 0x2000 // Set to disable anti-aliasing on images.
-#define FPDF_RENDER_NO_SMOOTHPATH 0x4000 // Set to disable anti-aliasing on paths.
-#define FPDF_REVERSE_BYTE_ORDER 0x10 //set whether render in a reverse Byte order, this flag only
- //enable when render to a bitmap.
+#define FPDF_ANNOT 0x01 // Set if annotations are to be rendered.
+#define FPDF_LCD_TEXT 0x02 // Set if using text rendering optimized for LCD display.
+#define FPDF_NO_NATIVETEXT 0x04 // Don't use the native text output available on some platforms
+#define FPDF_GRAYSCALE 0x08 // Grayscale output.
+#define FPDF_DEBUG_INFO 0x80 // Set if you want to get some debug info.
+ // Please discuss with Foxit first if you need to collect debug info.
+#define FPDF_NO_CATCH 0x100 // Set if you don't want to catch exception.
+#define FPDF_RENDER_LIMITEDIMAGECACHE 0x200 // Limit image cache size.
+#define FPDF_RENDER_FORCEHALFTONE 0x400 // Always use halftone for image stretching.
+#define FPDF_PRINTING 0x800 // Render for printing.
+#define FPDF_RENDER_NO_SMOOTHTEXT 0x1000 // Set to disable anti-aliasing on text.
+#define FPDF_RENDER_NO_SMOOTHIMAGE 0x2000 // Set to disable anti-aliasing on images.
+#define FPDF_RENDER_NO_SMOOTHPATH 0x4000 // Set to disable anti-aliasing on paths.
+#define FPDF_REVERSE_BYTE_ORDER 0x10 //set whether render in a reverse Byte order, this flag only
+ //enable when render to a bitmap.
#ifdef _WIN32
// Function: FPDF_RenderPage
-// Render contents in a page to a device (screen, bitmap, or printer).
-// This function is only supported on Windows system.
-// Parameters:
-// dc - Handle to device context.
-// page - Handle to the page. Returned by FPDF_LoadPage function.
-// start_x - Left pixel position of the display area in the device coordinate.
-// start_y - Top pixel position of the display area in the device 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 above.
-// Return value:
-// None.
+// Render contents in a page to a device (screen, bitmap, or printer).
+// This function is only supported on Windows system.
+// Parameters:
+// dc - Handle to device context.
+// page - Handle to the page. Returned by FPDF_LoadPage function.
+// start_x - Left pixel position of the display area in the device coordinate.
+// start_y - Top pixel position of the display area in the device 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 above.
+// Return value:
+// None.
//
DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
- int rotate, int flags);
+ int rotate, int flags);
#endif
// Function: FPDF_RenderPageBitmap
-// Render contents in a page to a device independent bitmap
-// 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. 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 above.
-// Return value:
-// None.
+// Render contents in a page to a device independent bitmap
+// 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. 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 above.
+// Return value:
+// None.
//
-DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y,
- int size_x, int size_y, int rotate, int flags);
+DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y,
+ int size_x, int size_y, int rotate, int flags);
// Function: FPDF_ClosePage
-// Close a loaded PDF page.
-// Parameters:
-// page - Handle to the loaded page.
+// Close a loaded PDF page.
+// Parameters:
+// page - Handle to the loaded page.
// Return value:
-// None.
+// None.
//
DLLEXPORT void STDCALL FPDF_ClosePage(FPDF_PAGE page);
// Function: FPDF_CloseDocument
-// Close a loaded PDF document.
-// Parameters:
-// document - Handle to the loaded document.
+// Close a loaded PDF document.
+// Parameters:
+// document - Handle to the loaded document.
// Return value:
-// None.
+// None.
//
DLLEXPORT void STDCALL FPDF_CloseDocument(FPDF_DOCUMENT document);
// Function: FPDF_DeviceToPage
-// Convert the screen coordinate of a point to page coordinate.
-// Parameters:
-// page - Handle to the page. Returned by FPDF_LoadPage function.
-// start_x - Left pixel position of the display area in the device coordinate.
-// start_y - Top pixel position of the display area in the device 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).
-// device_x - X value in device coordinate, for the point to be converted.
-// device_y - Y value in device coordinate, for the point to be converted.
-// page_x - A Pointer to a double receiving the converted X value in page coordinate.
-// page_y - A Pointer to a double receiving the converted Y value in page coordinate.
-// Return value:
-// None.
+// Convert the screen coordinate of a point to page coordinate.
+// Parameters:
+// page - Handle to the page. Returned by FPDF_LoadPage function.
+// start_x - Left pixel position of the display area in the device coordinate.
+// start_y - Top pixel position of the display area in the device 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).
+// device_x - X value in device coordinate, for the point to be converted.
+// device_y - Y value in device coordinate, for the point to be converted.
+// page_x - A Pointer to a double receiving the converted X value in page coordinate.
+// page_y - A Pointer to a double receiving the converted Y value in page coordinate.
+// Return value:
+// None.
// Comments:
-// The page coordinate system has its origin at left-bottom corner of the page, with X axis goes along
-// the bottom side to the right, and Y axis goes along the left side upward. NOTE: this coordinate system
-// can be altered when you zoom, scroll, or rotate a page, however, a point on the page should always have
-// the same coordinate values in the page coordinate system.
+// The page coordinate system has its origin at left-bottom corner of the page, with X axis goes along
+// the bottom side to the right, and Y axis goes along the left side upward. NOTE: this coordinate system
+// can be altered when you zoom, scroll, or rotate a page, however, a point on the page should always have
+// the same coordinate values in the page coordinate system.
//
-// The device coordinate system is device dependent. For screen device, its origin is at left-top
-// corner of the window. However this origin can be altered by Windows coordinate transformation
-// utilities. You must make sure the start_x, start_y, size_x, size_y and rotate parameters have exactly
-// same values as you used in FPDF_RenderPage() function call.
+// The device coordinate system is device dependent. For screen device, its origin is at left-top
+// corner of the window. However this origin can be altered by Windows coordinate transformation
+// utilities. You must make sure the start_x, start_y, size_x, size_y and rotate parameters have exactly
+// same values as you used in FPDF_RenderPage() function call.
//
DLLEXPORT void STDCALL 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, double* page_x, double* page_y);
+ int rotate, int device_x, int device_y, double* page_x, double* page_y);
// Function: FPDF_PageToDevice
-// Convert the page coordinate of a point to screen coordinate.
-// Parameters:
-// page - Handle to the page. Returned by FPDF_LoadPage function.
-// start_x - Left pixel position of the display area in the device coordinate.
-// start_y - Top pixel position of the display area in the device 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).
-// page_x - X value in page coordinate, for the point to be converted.
-// page_y - Y value in page coordinate, for the point to be converted.
-// device_x - A pointer to an integer receiving the result X value in device coordinate.
-// device_y - A pointer to an integer receiving the result Y value in device coordinate.
-// Return value:
-// None.
+// Convert the page coordinate of a point to screen coordinate.
+// Parameters:
+// page - Handle to the page. Returned by FPDF_LoadPage function.
+// start_x - Left pixel position of the display area in the device coordinate.
+// start_y - Top pixel position of the display area in the device 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).
+// page_x - X value in page coordinate, for the point to be converted.
+// page_y - Y value in page coordinate, for the point to be converted.
+// device_x - A pointer to an integer receiving the result X value in device coordinate.
+// device_y - A pointer to an integer receiving the result Y value in device coordinate.
+// Return value:
+// None.
// Comments:
-// See comments of FPDF_DeviceToPage() function.
+// See comments of FPDF_DeviceToPage() function.
//
DLLEXPORT void STDCALL 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, int* device_x, int* device_y);
+ int rotate, double page_x, double page_y, int* device_x, int* device_y);
// Function: FPDFBitmap_Create
-// Create a Foxit Device Independent Bitmap (FXDIB).
+// Create a Foxit Device Independent Bitmap (FXDIB).
// Parameters:
-// width - Number of pixels in a horizontal line of the bitmap. Must be greater than 0.
-// height - Number of pixels in a vertical line of the bitmap. Must be greater than 0.
-// alpha - A flag indicating whether alpha channel is used. Non-zero for using alpha, zero for not using.
+// width - Number of pixels in a horizontal line of the bitmap. Must be greater than 0.
+// height - Number of pixels in a vertical line of the bitmap. Must be greater than 0.
+// alpha - A flag indicating whether alpha channel is used. Non-zero for using alpha, zero for not using.
// Return value:
-// The created bitmap handle, or NULL if parameter error or out of memory.
+// The created bitmap handle, or NULL if parameter error or out of memory.
// Comments:
-// An FXDIB always use 4 byte per pixel. The first byte of a pixel is always double word aligned.
-// Each pixel contains red (R), green (G), blue (B) and optionally alpha (A) values.
-// The byte order is BGRx (the last byte unused if no alpha channel) or BGRA.
-//
-// The pixels in a horizontal line (also called scan line) are stored side by side, with left most
-// pixel stored first (with lower memory address). Each scan line uses width*4 bytes.
+// An FXDIB always use 4 byte per pixel. The first byte of a pixel is always double word aligned.
+// Each pixel contains red (R), green (G), blue (B) and optionally alpha (A) values.
+// The byte order is BGRx (the last byte unused if no alpha channel) or BGRA.
+//
+// The pixels in a horizontal line (also called scan line) are stored side by side, with left most
+// pixel stored first (with lower memory address). Each scan line uses width*4 bytes.
//
-// Scan lines are stored one after another, with top most scan line stored first. There is no gap
-// between adjacent scan lines.
+// Scan lines are stored one after another, with top most scan line stored first. There is no gap
+// between adjacent scan lines.
//
-// This function allocates enough memory for holding all pixels in the bitmap, but it doesn't
-// initialize the buffer. Applications can use FPDFBitmap_FillRect to fill the bitmap using any color.
+// This function allocates enough memory for holding all pixels in the bitmap, but it doesn't
+// initialize the buffer. Applications can use FPDFBitmap_FillRect to fill the bitmap using any color.
DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_Create(int width, int height, int alpha);
// More DIB formats
-#define FPDFBitmap_Gray 1 // Gray scale bitmap, one byte per pixel.
-#define FPDFBitmap_BGR 2 // 3 bytes per pixel, byte order: blue, green, red.
-#define FPDFBitmap_BGRx 3 // 4 bytes per pixel, byte order: blue, green, red, unused.
-#define FPDFBitmap_BGRA 4 // 4 bytes per pixel, byte order: blue, green, red, alpha.
+#define FPDFBitmap_Gray 1 // Gray scale bitmap, one byte per pixel.
+#define FPDFBitmap_BGR 2 // 3 bytes per pixel, byte order: blue, green, red.
+#define FPDFBitmap_BGRx 3 // 4 bytes per pixel, byte order: blue, green, red, unused.
+#define FPDFBitmap_BGRA 4 // 4 bytes per pixel, byte order: blue, green, red, alpha.
// Function: FPDFBitmap_CreateEx
-// Create a Foxit Device Independent Bitmap (FXDIB)
+// Create a Foxit Device Independent Bitmap (FXDIB)
// Parameters:
-// width - Number of pixels in a horizontal line of the bitmap. Must be greater than 0.
-// height - Number of pixels in a vertical line of 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 first scan line, for external buffer
-// only. If this parameter is NULL, then the SDK will create its own buffer.
-// stride - Number of bytes for each scan line, for external buffer only..
-// Return value:
-// The created bitmap handle, or NULL if parameter error or out of memory.
+// width - Number of pixels in a horizontal line of the bitmap. Must be greater than 0.
+// height - Number of pixels in a vertical line of 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 first scan line, for external buffer
+// only. If this parameter is NULL, then the SDK will create its own buffer.
+// stride - Number of bytes for each scan line, for external buffer only..
+// Return value:
+// The created bitmap handle, or NULL if parameter error or out of memory.
// Comments:
-// Similar to FPDFBitmap_Create function, with more formats and external buffer supported.
-// Bitmap created by this function can be used in any place that a FPDF_BITMAP handle is
-// required.
+// Similar to FPDFBitmap_Create function, with more formats and external buffer supported.
+// Bitmap created by this function can be used in any place that a FPDF_BITMAP handle is
+// required.
//
-// If external scanline buffer is used, then the application should destroy the buffer
-// by itself. FPDFBitmap_Destroy function will not destroy the buffer.
+// If external scanline buffer is used, then the application should destroy the buffer
+// by itself. FPDFBitmap_Destroy function will not destroy the buffer.
//
DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_CreateEx(int width, int height, int format, void* first_scan, int stride);
// Function: FPDFBitmap_FillRect
-// Fill a rectangle area in an FXDIB.
+// Fill a rectangle area in an FXDIB.
// Parameters:
-// bitmap - The handle to the bitmap. Returned by FPDFBitmap_Create function.
-// left - The left side position. Starting from 0 at the left-most pixel.
-// top - The top side position. Starting from 0 at the top-most scan line.
-// width - Number of pixels to be filled in each scan line.
-// height - Number of scan lines to be filled.
-// color - A 32-bit value specifing the color, in 8888 ARGB format.
-// Return value:
-// None.
+// bitmap - The handle to the bitmap. Returned by FPDFBitmap_Create function.
+// left - The left side position. Starting from 0 at the left-most pixel.
+// top - The top side position. Starting from 0 at the top-most scan line.
+// width - Number of pixels to be filled in each scan line.
+// height - Number of scan lines to be filled.
+// color - A 32-bit value specifing the color, in 8888 ARGB format.
+// Return value:
+// None.
// Comments:
-// This function set the color and (optionally) alpha value in specified region of the bitmap.
-// NOTE: If alpha channel is used, this function does NOT composite the background with the source color,
-// instead the background will be replaced by the source color and alpha.
-// If alpha channel is not used, the "alpha" parameter is ignored.
+// This function set the color and (optionally) alpha value in specified region of the bitmap.
+// NOTE: If alpha channel is used, this function does NOT composite the background with the source color,
+// instead the background will be replaced by the source color and alpha.
+// If alpha channel is not used, the "alpha" parameter is ignored.
//
DLLEXPORT void STDCALL FPDFBitmap_FillRect(FPDF_BITMAP bitmap, int left, int top, int width, int height, FPDF_DWORD color);
// Function: FPDFBitmap_GetBuffer
-// Get data buffer of an FXDIB
+// Get data buffer of an FXDIB
// Parameters:
-// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
+// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
// Return value:
-// The pointer to the first byte of the bitmap buffer.
+// The pointer to the first byte of the bitmap buffer.
// Comments:
-// The stride may be more than width * number of bytes per pixel
-// Applications can use this function to get the bitmap buffer pointer, then manipulate any color
-// and/or alpha values for any pixels in the bitmap.
+// The stride may be more than width * number of bytes per pixel
+// Applications can use this function to get the bitmap buffer pointer, then manipulate any color
+// and/or alpha values for any pixels in the bitmap.
DLLEXPORT void* STDCALL FPDFBitmap_GetBuffer(FPDF_BITMAP bitmap);
// Function: FPDFBitmap_GetWidth
-// Get width of an FXDIB.
+// Get width of an FXDIB.
// Parameters:
-// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
+// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
// Return value:
-// The number of pixels in a horizontal line of the bitmap.
+// The number of pixels in a horizontal line of the bitmap.
DLLEXPORT int STDCALL FPDFBitmap_GetWidth(FPDF_BITMAP bitmap);
// Function: FPDFBitmap_GetHeight
-// Get height of an FXDIB.
+// Get height of an FXDIB.
// Parameters:
-// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
+// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
// Return value:
-// The number of pixels in a vertical line of the bitmap.
+// The number of pixels in a vertical line of the bitmap.
DLLEXPORT int STDCALL FPDFBitmap_GetHeight(FPDF_BITMAP bitmap);
// Function: FPDFBitmap_GetStride
-// Get number of bytes for each scan line in the bitmap buffer.
+// Get number of bytes for each scan line in the bitmap buffer.
// Parameters:
-// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
+// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
// Return value:
-// The number of bytes for each scan line in the bitmap buffer.
+// The number of bytes for each scan line in the bitmap buffer.
// Comments:
-// The stride may be more than width * number of bytes per pixel
+// The stride may be more than width * number of bytes per pixel
DLLEXPORT int STDCALL FPDFBitmap_GetStride(FPDF_BITMAP bitmap);
// Function: FPDFBitmap_Destroy
-// Destroy an FXDIB and release all related buffers.
+// Destroy an FXDIB and release all related buffers.
// Parameters:
-// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
+// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
// Return value:
-// None.
+// None.
// Comments:
-// This function will not destroy any external buffer.
+// This function will not destroy any external buffer.
//
DLLEXPORT void STDCALL FPDFBitmap_Destroy(FPDF_BITMAP bitmap);
// Function: FPDF_VIEWERREF_GetPrintScaling
-// Whether the PDF document prefers to be scaled or not.
-// Parameters:
-// document - Handle to the loaded document.
+// Whether the PDF document prefers to be scaled or not.
+// Parameters:
+// document - Handle to the loaded document.
// Return value:
-// None.
+// None.
//
DLLEXPORT FPDF_BOOL STDCALL FPDF_VIEWERREF_GetPrintScaling(FPDF_DOCUMENT document);
// Function: FPDF_VIEWERREF_GetNumCopies
-// Returns the number of copies to be printed.
+// Returns the number of copies to be printed.
// Parameters:
-// document - Handle to the loaded document.
+// document - Handle to the loaded document.
// Return value:
// The number of copies to be printed.
//
DLLEXPORT int STDCALL FPDF_VIEWERREF_GetNumCopies(FPDF_DOCUMENT document);
// Function: FPDF_VIEWERREF_GetPrintPageRange
-// Page numbers to initialize print dialog box when file is printed.
+// Page numbers to initialize print dialog box when file is printed.
// Parameters:
-// document - Handle to the loaded document.
+// document - Handle to the loaded document.
// Return value:
// The print page range to be used for printing.
//
DLLEXPORT FPDF_PAGERANGE STDCALL FPDF_VIEWERREF_GetPrintPageRange(FPDF_DOCUMENT document);
// Function: FPDF_VIEWERREF_GetDuplex
-// Returns the paper handling option to be used when printing from print dialog.
+// Returns the paper handling option to be used when printing from print dialog.
// Parameters:
-// document - Handle to the loaded document.
+// document - Handle to the loaded document.
// Return value:
// The paper handling option to be used when printing.
//
DLLEXPORT FPDF_DUPLEXTYPE STDCALL FPDF_VIEWERREF_GetDuplex(FPDF_DOCUMENT document);
// Function: FPDF_CountNamedDests
-// Get the count of named destinations in the PDF document.
+// Get the count of named destinations in the PDF document.
// Parameters:
-// document - Handle to a document
+// document - Handle to a document
// Return value:
-// The count of named destinations.
+// The count of named destinations.
DLLEXPORT FPDF_DWORD STDCALL FPDF_CountNamedDests(FPDF_DOCUMENT document);
// Function: FPDF_GetNamedDestByName
-// get a special dest handle by the index.
-// Parameters:
-// document - Handle to the loaded document.
-// name - The name of a special named dest.
+// get a special dest handle by the index.
+// Parameters:
+// document - Handle to the loaded document.
+// name - The name of a special named dest.
// Return value:
-// The handle of the dest.
+// The handle of the dest.
//
DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDestByName(FPDF_DOCUMENT document, FPDF_BYTESTRING name);
// Function: FPDF_GetNamedDest
-// Get the specified named destinations of the PDF document by index.
+// Get the specified named destinations of the PDF document by index.
// Parameters:
-// document - Handle to a document
-// index - The index of named destination.
-// buffer - The buffer to obtain 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.
+// document - Handle to a document
+// index - The index of named destination.
+// buffer - The buffer to obtain 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 of a named destination, or NULL if no named destination corresponding to |index|.
+// The destination handle of a named destination, or NULL if no named destination corresponding to |index|.
// Comments:
-// Call this function twice to get the name of the named destination:
-// 1) First time pass in |buffer| as NULL and get buflen.
-// 2) Second time pass in allocated |buffer| and buflen to retrieve |buffer|, which should be used as wchar_t*.
-// If buflen is not sufficiently large, it will be set to -1 upon return.
+// Call this function twice to get the name of the named destination:
+// 1) First time pass in |buffer| as NULL and get buflen.
+// 2) Second time pass in allocated |buffer| and buflen to retrieve |buffer|, which should be used as wchar_t*.
+// If buflen is not sufficiently large, it will be set to -1 upon return.
//
DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDest(FPDF_DOCUMENT document, int index, void* buffer, long* buflen);
-
#ifdef __cplusplus
-};
+}
#endif
-#endif // _FPDFVIEW_H_
+#endif // PUBLIC_FPDFVIEW_H_