OS X: Update bundled pdfium to r3729

This commit is contained in:
Felix Kauselmann 2019-03-09 16:56:30 +01:00
parent eeb303a5c1
commit 7ae8afffb1
23 changed files with 3672 additions and 1362 deletions

View File

@ -1,6 +1,6 @@
YACReader for macOS uses a precompiled single static library version of pdfium.
pdfium branch used for building: chromium/3071 (current beta)
pdfium branch used for building: chromium/3729
build parameters used (gn args):
@ -8,11 +8,13 @@ pdf_enable_xfa = false
pdf_enable_v8 = false
pdf_is_complete_lib = true
is_official_build = true
use_jumbo_build = true
is_debug = false
symbol_level = 0
Instructions on building pdfium can be found at https://pdfium.googlesource.com/pdfium
It is recommended to always use the branch the current stable version of chromium uses.
It is recommended to always use the branch the current stable version of Chromium uses.
To get the pdfium branch corresponding to Chromium stable, look at
http://omahaproxy.appspot.com and search for the true_branch variable associated with
the current stable dev channel of Chromium.

Binary file not shown.

View File

@ -1,8 +0,0 @@
include_rules = [
# public/ needs to be standalone. Explicitly disallow everything.
'-core',
'-fpdfsdk',
'-testing',
'-third_party',
'-v8',
]

View File

@ -5,7 +5,9 @@
#ifndef PUBLIC_CPP_FPDF_DELETERS_H_
#define PUBLIC_CPP_FPDF_DELETERS_H_
#include "public/fpdf_annot.h"
#include "public/fpdf_dataavail.h"
#include "public/fpdf_edit.h"
#include "public/fpdf_formfill.h"
#include "public/fpdf_structtree.h"
#include "public/fpdf_text.h"
@ -13,6 +15,10 @@
// Custom deleters for using FPDF_* types with std::unique_ptr<>.
struct FPDFAnnotationDeleter {
inline void operator()(FPDF_ANNOTATION annot) { FPDFPage_CloseAnnot(annot); }
};
struct FPDFAvailDeleter {
inline void operator()(FPDF_AVAIL avail) { FPDFAvail_Destroy(avail); }
};
@ -25,22 +31,42 @@ struct FPDFDocumentDeleter {
inline void operator()(FPDF_DOCUMENT doc) { FPDF_CloseDocument(doc); }
};
struct FPDFFontDeleter {
inline void operator()(FPDF_FONT font) { FPDFFont_Close(font); }
};
struct FPDFFormHandleDeleter {
inline void operator()(FPDF_FORMHANDLE form) {
FPDFDOC_ExitFormFillEnvironment(form);
}
};
struct FPDFTextPageDeleter {
inline void operator()(FPDF_TEXTPAGE text) { FPDFText_ClosePage(text); }
};
struct FPDFPageDeleter {
inline void operator()(FPDF_PAGE page) { FPDF_ClosePage(page); }
};
struct FPDFPageLinkDeleter {
inline void operator()(FPDF_PAGELINK pagelink) {
FPDFLink_CloseWebLinks(pagelink);
}
};
struct FPDFPageObjectDeleter {
inline void operator()(FPDF_PAGEOBJECT object) {
FPDFPageObj_Destroy(object);
}
};
struct FPDFStructTreeDeleter {
inline void operator()(FPDF_STRUCTTREE tree) { FPDF_StructTree_Close(tree); }
};
struct FPDFTextFindDeleter {
inline void operator()(FPDF_SCHHANDLE handle) { FPDFText_FindClose(handle); }
};
struct FPDFTextPageDeleter {
inline void operator()(FPDF_TEXTPAGE text) { FPDFText_ClosePage(text); }
};
#endif // PUBLIC_CPP_FPDF_DELETERS_H_

View File

@ -0,0 +1,66 @@
// Copyright 2018 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.
#ifndef PUBLIC_CPP_FPDF_SCOPERS_H_
#define PUBLIC_CPP_FPDF_SCOPERS_H_
#include <memory>
#include <type_traits>
#include "public/cpp/fpdf_deleters.h"
#include "public/fpdf_annot.h"
#include "public/fpdf_dataavail.h"
#include "public/fpdf_edit.h"
#include "public/fpdf_formfill.h"
#include "public/fpdf_structtree.h"
#include "public/fpdf_text.h"
#include "public/fpdfview.h"
// Versions of FPDF types that clean up the object at scope exit.
using ScopedFPDFAnnotation =
std::unique_ptr<std::remove_pointer<FPDF_ANNOTATION>::type,
FPDFAnnotationDeleter>;
using ScopedFPDFAvail =
std::unique_ptr<std::remove_pointer<FPDF_AVAIL>::type, FPDFAvailDeleter>;
using ScopedFPDFBitmap =
std::unique_ptr<std::remove_pointer<FPDF_BITMAP>::type, FPDFBitmapDeleter>;
using ScopedFPDFDocument =
std::unique_ptr<std::remove_pointer<FPDF_DOCUMENT>::type,
FPDFDocumentDeleter>;
using ScopedFPDFFont =
std::unique_ptr<std::remove_pointer<FPDF_FONT>::type, FPDFFontDeleter>;
using ScopedFPDFFormHandle =
std::unique_ptr<std::remove_pointer<FPDF_FORMHANDLE>::type,
FPDFFormHandleDeleter>;
using ScopedFPDFPage =
std::unique_ptr<std::remove_pointer<FPDF_PAGE>::type, FPDFPageDeleter>;
using ScopedFPDFPageLink =
std::unique_ptr<std::remove_pointer<FPDF_PAGELINK>::type,
FPDFPageLinkDeleter>;
using ScopedFPDFPageObject =
std::unique_ptr<std::remove_pointer<FPDF_PAGEOBJECT>::type,
FPDFPageObjectDeleter>;
using ScopedFPDFStructTree =
std::unique_ptr<std::remove_pointer<FPDF_STRUCTTREE>::type,
FPDFStructTreeDeleter>;
using ScopedFPDFTextFind =
std::unique_ptr<std::remove_pointer<FPDF_SCHHANDLE>::type,
FPDFTextFindDeleter>;
using ScopedFPDFTextPage =
std::unique_ptr<std::remove_pointer<FPDF_TEXTPAGE>::type,
FPDFTextPageDeleter>;
#endif // PUBLIC_CPP_FPDF_SCOPERS_H_

View File

@ -0,0 +1,597 @@
// Copyright 2017 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.
#ifndef PUBLIC_FPDF_ANNOT_H_
#define PUBLIC_FPDF_ANNOT_H_
#include <stddef.h>
// NOLINTNEXTLINE(build/include)
#include "fpdfview.h"
// NOLINTNEXTLINE(build/include)
#include "fpdf_doc.h"
// NOLINTNEXTLINE(build/include)
#include "fpdf_formfill.h"
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#define FPDF_ANNOT_UNKNOWN 0
#define FPDF_ANNOT_TEXT 1
#define FPDF_ANNOT_LINK 2
#define FPDF_ANNOT_FREETEXT 3
#define FPDF_ANNOT_LINE 4
#define FPDF_ANNOT_SQUARE 5
#define FPDF_ANNOT_CIRCLE 6
#define FPDF_ANNOT_POLYGON 7
#define FPDF_ANNOT_POLYLINE 8
#define FPDF_ANNOT_HIGHLIGHT 9
#define FPDF_ANNOT_UNDERLINE 10
#define FPDF_ANNOT_SQUIGGLY 11
#define FPDF_ANNOT_STRIKEOUT 12
#define FPDF_ANNOT_STAMP 13
#define FPDF_ANNOT_CARET 14
#define FPDF_ANNOT_INK 15
#define FPDF_ANNOT_POPUP 16
#define FPDF_ANNOT_FILEATTACHMENT 17
#define FPDF_ANNOT_SOUND 18
#define FPDF_ANNOT_MOVIE 19
#define FPDF_ANNOT_WIDGET 20
#define FPDF_ANNOT_SCREEN 21
#define FPDF_ANNOT_PRINTERMARK 22
#define FPDF_ANNOT_TRAPNET 23
#define FPDF_ANNOT_WATERMARK 24
#define FPDF_ANNOT_THREED 25
#define FPDF_ANNOT_RICHMEDIA 26
#define FPDF_ANNOT_XFAWIDGET 27
// Refer to PDF Reference (6th edition) table 8.16 for all annotation flags.
#define FPDF_ANNOT_FLAG_NONE 0
#define FPDF_ANNOT_FLAG_INVISIBLE (1 << 0)
#define FPDF_ANNOT_FLAG_HIDDEN (1 << 1)
#define FPDF_ANNOT_FLAG_PRINT (1 << 2)
#define FPDF_ANNOT_FLAG_NOZOOM (1 << 3)
#define FPDF_ANNOT_FLAG_NOROTATE (1 << 4)
#define FPDF_ANNOT_FLAG_NOVIEW (1 << 5)
#define FPDF_ANNOT_FLAG_READONLY (1 << 6)
#define FPDF_ANNOT_FLAG_LOCKED (1 << 7)
#define FPDF_ANNOT_FLAG_TOGGLENOVIEW (1 << 8)
#define FPDF_ANNOT_APPEARANCEMODE_NORMAL 0
#define FPDF_ANNOT_APPEARANCEMODE_ROLLOVER 1
#define FPDF_ANNOT_APPEARANCEMODE_DOWN 2
#define FPDF_ANNOT_APPEARANCEMODE_COUNT 3
#define FPDF_OBJECT_UNKNOWN 0
#define FPDF_OBJECT_BOOLEAN 1
#define FPDF_OBJECT_NUMBER 2
#define FPDF_OBJECT_STRING 3
#define FPDF_OBJECT_NAME 4
#define FPDF_OBJECT_ARRAY 5
#define FPDF_OBJECT_DICTIONARY 6
#define FPDF_OBJECT_STREAM 7
#define FPDF_OBJECT_NULLOBJ 8
#define FPDF_OBJECT_REFERENCE 9
// Refer to PDF Reference version 1.7 table 8.70 for field flags common to all
// interactive form field types.
#define FPDF_FORMFLAG_NONE 0
#define FPDF_FORMFLAG_READONLY (1 << 0)
#define FPDF_FORMFLAG_REQUIRED (1 << 1)
#define FPDF_FORMFLAG_NOEXPORT (1 << 2)
// Refer to PDF Reference version 1.7 table 8.77 for field flags specific to
// interactive form text fields.
#define FPDF_FORMFLAG_TEXT_MULTILINE (1 << 12)
// Refer to PDF Reference version 1.7 table 8.79 for field flags specific to
// interactive form choice fields.
#define FPDF_FORMFLAG_CHOICE_COMBO (1 << 17)
#define FPDF_FORMFLAG_CHOICE_EDIT (1 << 18)
typedef enum FPDFANNOT_COLORTYPE {
FPDFANNOT_COLORTYPE_Color = 0,
FPDFANNOT_COLORTYPE_InteriorColor
} FPDFANNOT_COLORTYPE;
// Experimental API.
// Check if an annotation subtype is currently supported for creation.
// Currently supported subtypes: circle, highlight, ink, popup, square,
// squiggly, stamp, strikeout, text, and underline.
//
// subtype - the subtype to be checked.
//
// Returns true if this subtype supported.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFAnnot_IsSupportedSubtype(FPDF_ANNOTATION_SUBTYPE subtype);
// Experimental API.
// Create an annotation in |page| of the subtype |subtype|. If the specified
// subtype is illegal or unsupported, then a new annotation will not be created.
// Must call FPDFPage_CloseAnnot() when the annotation returned by this
// function is no longer needed.
//
// page - handle to a page.
// subtype - the subtype of the new annotation.
//
// Returns a handle to the new annotation object, or NULL on failure.
FPDF_EXPORT FPDF_ANNOTATION FPDF_CALLCONV
FPDFPage_CreateAnnot(FPDF_PAGE page, FPDF_ANNOTATION_SUBTYPE subtype);
// Experimental API.
// Get the number of annotations in |page|.
//
// page - handle to a page.
//
// Returns the number of annotations in |page|.
FPDF_EXPORT int FPDF_CALLCONV FPDFPage_GetAnnotCount(FPDF_PAGE page);
// Experimental API.
// Get annotation in |page| at |index|. Must call FPDFPage_CloseAnnot() when the
// annotation returned by this function is no longer needed.
//
// page - handle to a page.
// index - the index of the annotation.
//
// Returns a handle to the annotation object, or NULL on failure.
FPDF_EXPORT FPDF_ANNOTATION FPDF_CALLCONV FPDFPage_GetAnnot(FPDF_PAGE page,
int index);
// Experimental API.
// Get the index of |annot| in |page|. This is the opposite of
// FPDFPage_GetAnnot().
//
// page - handle to the page that the annotation is on.
// annot - handle to an annotation.
//
// Returns the index of |annot|, or -1 on failure.
FPDF_EXPORT int FPDF_CALLCONV FPDFPage_GetAnnotIndex(FPDF_PAGE page,
FPDF_ANNOTATION annot);
// Experimental API.
// Close an annotation. Must be called when the annotation returned by
// FPDFPage_CreateAnnot() or FPDFPage_GetAnnot() is no longer needed. This
// function does not remove the annotation from the document.
//
// annot - handle to an annotation.
FPDF_EXPORT void FPDF_CALLCONV FPDFPage_CloseAnnot(FPDF_ANNOTATION annot);
// Experimental API.
// Remove the annotation in |page| at |index|.
//
// page - handle to a page.
// index - the index of the annotation.
//
// Returns true if successful.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_RemoveAnnot(FPDF_PAGE page,
int index);
// Experimental API.
// Get the subtype of an annotation.
//
// annot - handle to an annotation.
//
// Returns the annotation subtype.
FPDF_EXPORT FPDF_ANNOTATION_SUBTYPE FPDF_CALLCONV
FPDFAnnot_GetSubtype(FPDF_ANNOTATION annot);
// Experimental API.
// Check if an annotation subtype is currently supported for object extraction,
// update, and removal.
// Currently supported subtypes: ink and stamp.
//
// subtype - the subtype to be checked.
//
// Returns true if this subtype supported.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFAnnot_IsObjectSupportedSubtype(FPDF_ANNOTATION_SUBTYPE subtype);
// Experimental API.
// Update |obj| in |annot|. |obj| must be in |annot| already and must have
// been retrieved by FPDFAnnot_GetObject(). Currently, only ink and stamp
// annotations are supported by this API. Also note that only path, image, and
// text objects have APIs for modification; see FPDFPath_*(), FPDFText_*(), and
// FPDFImageObj_*().
//
// annot - handle to an annotation.
// obj - handle to the object that |annot| needs to update.
//
// Return true if successful.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFAnnot_UpdateObject(FPDF_ANNOTATION annot, FPDF_PAGEOBJECT obj);
// Experimental API.
// Add |obj| to |annot|. |obj| must have been created by
// FPDFPageObj_CreateNew{Path|Rect}() or FPDFPageObj_New{Text|Image}Obj(), and
// will be owned by |annot|. Note that an |obj| cannot belong to more than one
// |annot|. Currently, only ink and stamp annotations are supported by this API.
// Also note that only path, image, and text objects have APIs for creation.
//
// annot - handle to an annotation.
// obj - handle to the object that is to be added to |annot|.
//
// Return true if successful.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFAnnot_AppendObject(FPDF_ANNOTATION annot, FPDF_PAGEOBJECT obj);
// Experimental API.
// Get the total number of objects in |annot|, including path objects, text
// objects, external objects, image objects, and shading objects.
//
// annot - handle to an annotation.
//
// Returns the number of objects in |annot|.
FPDF_EXPORT int FPDF_CALLCONV FPDFAnnot_GetObjectCount(FPDF_ANNOTATION annot);
// Experimental API.
// Get the object in |annot| at |index|.
//
// annot - handle to an annotation.
// index - the index of the object.
//
// Return a handle to the object, or NULL on failure.
FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV
FPDFAnnot_GetObject(FPDF_ANNOTATION annot, int index);
// Experimental API.
// Remove the object in |annot| at |index|.
//
// annot - handle to an annotation.
// index - the index of the object to be removed.
//
// Return true if successful.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFAnnot_RemoveObject(FPDF_ANNOTATION annot, int index);
// Experimental API.
// Set the color of an annotation. Fails when called on annotations with
// appearance streams already defined; instead use
// FPDFPath_Set{Stroke|Fill}Color().
//
// annot - handle to an annotation.
// type - type of the color to be set.
// R, G, B - buffer to hold the RGB value of the color. Ranges from 0 to 255.
// A - buffer to hold the opacity. Ranges from 0 to 255.
//
// Returns true if successful.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetColor(FPDF_ANNOTATION annot,
FPDFANNOT_COLORTYPE type,
unsigned int R,
unsigned int G,
unsigned int B,
unsigned int A);
// Experimental API.
// Get the color of an annotation. If no color is specified, default to yellow
// for highlight annotation, black for all else. Fails when called on
// annotations with appearance streams already defined; instead use
// FPDFPath_Get{Stroke|Fill}Color().
//
// annot - handle to an annotation.
// type - type of the color requested.
// R, G, B - buffer to hold the RGB value of the color. Ranges from 0 to 255.
// A - buffer to hold the opacity. Ranges from 0 to 255.
//
// Returns true if successful.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_GetColor(FPDF_ANNOTATION annot,
FPDFANNOT_COLORTYPE type,
unsigned int* R,
unsigned int* G,
unsigned int* B,
unsigned int* A);
// Experimental API.
// Check if the annotation is of a type that has attachment points
// (i.e. quadpoints). Quadpoints are the vertices of the rectangle that
// encompasses the texts affected by the annotation. They provide the
// coordinates in the page where the annotation is attached. Only text markup
// annotations (i.e. highlight, strikeout, squiggly, and underline) and link
// annotations have quadpoints.
//
// annot - handle to an annotation.
//
// Returns true if the annotation is of a type that has quadpoints, false
// otherwise.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFAnnot_HasAttachmentPoints(FPDF_ANNOTATION annot);
// Experimental API.
// Replace the attachment points (i.e. quadpoints) set of an annotation at
// |quad_index|. This index needs to be within the result of
// FPDFAnnot_CountAttachmentPoints().
// If the annotation's appearance stream is defined and this annotation is of a
// type with quadpoints, then update the bounding box too if the new quadpoints
// define a bigger one.
//
// annot - handle to an annotation.
// quad_index - index of the set of quadpoints.
// quad_points - the quadpoints to be set.
//
// Returns true if successful.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFAnnot_SetAttachmentPoints(FPDF_ANNOTATION annot,
size_t quad_index,
const FS_QUADPOINTSF* quad_points);
// Experimental API.
// Append to the list of attachment points (i.e. quadpoints) of an annotation.
// If the annotation's appearance stream is defined and this annotation is of a
// type with quadpoints, then update the bounding box too if the new quadpoints
// define a bigger one.
//
// annot - handle to an annotation.
// quad_points - the quadpoints to be set.
//
// Returns true if successful.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFAnnot_AppendAttachmentPoints(FPDF_ANNOTATION annot,
const FS_QUADPOINTSF* quad_points);
// Experimental API.
// Get the number of sets of quadpoints of an annotation.
//
// annot - handle to an annotation.
//
// Returns the number of sets of quadpoints, or 0 on failure.
FPDF_EXPORT size_t FPDF_CALLCONV
FPDFAnnot_CountAttachmentPoints(FPDF_ANNOTATION annot);
// Experimental API.
// Get the attachment points (i.e. quadpoints) of an annotation.
//
// annot - handle to an annotation.
// quad_index - index of the set of quadpoints.
// quad_points - receives the quadpoints; must not be NULL.
//
// Returns true if successful.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFAnnot_GetAttachmentPoints(FPDF_ANNOTATION annot,
size_t quad_index,
FS_QUADPOINTSF* quad_points);
// Experimental API.
// Set the annotation rectangle defining the location of the annotation. If the
// annotation's appearance stream is defined and this annotation is of a type
// without quadpoints, then update the bounding box too if the new rectangle
// defines a bigger one.
//
// annot - handle to an annotation.
// rect - the annotation rectangle to be set.
//
// Returns true if successful.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetRect(FPDF_ANNOTATION annot,
const FS_RECTF* rect);
// Experimental API.
// Get the annotation rectangle defining the location of the annotation.
//
// annot - handle to an annotation.
// rect - receives the rectangle; must not be NULL.
//
// Returns true if successful.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_GetRect(FPDF_ANNOTATION annot,
FS_RECTF* rect);
// Experimental API.
// Check if |annot|'s dictionary has |key| as a key.
//
// annot - handle to an annotation.
// key - the key to look for, encoded in UTF-8.
//
// Returns true if |key| exists.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_HasKey(FPDF_ANNOTATION annot,
FPDF_BYTESTRING key);
// Experimental API.
// Get the type of the value corresponding to |key| in |annot|'s dictionary.
//
// annot - handle to an annotation.
// key - the key to look for, encoded in UTF-8.
//
// Returns the type of the dictionary value.
FPDF_EXPORT FPDF_OBJECT_TYPE FPDF_CALLCONV
FPDFAnnot_GetValueType(FPDF_ANNOTATION annot, FPDF_BYTESTRING key);
// Experimental API.
// Set the string value corresponding to |key| in |annot|'s dictionary,
// overwriting the existing value if any. The value type would be
// FPDF_OBJECT_STRING after this function call succeeds.
//
// annot - handle to an annotation.
// key - the key to the dictionary entry to be set, encoded in UTF-8.
// value - the string value to be set, encoded in UTF16-LE.
//
// Returns true if successful.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFAnnot_SetStringValue(FPDF_ANNOTATION annot,
FPDF_BYTESTRING key,
FPDF_WIDESTRING value);
// Experimental API.
// Get the string value corresponding to |key| in |annot|'s dictionary. |buffer|
// is only modified if |buflen| is longer than the length of contents. Note that
// if |key| does not exist in the dictionary or if |key|'s corresponding value
// in the dictionary is not a string (i.e. the value is not of type
// FPDF_OBJECT_STRING or FPDF_OBJECT_NAME), then an empty string would be copied
// to |buffer| and the return value would be 2. On other errors, nothing would
// be added to |buffer| and the return value would be 0.
//
// annot - handle to an annotation.
// key - the key to the requested dictionary entry, encoded in UTF-8.
// buffer - buffer for holding the value string, encoded in UTF16-LE.
// buflen - length of the buffer.
//
// Returns the length of the string value.
FPDF_EXPORT unsigned long FPDF_CALLCONV
FPDFAnnot_GetStringValue(FPDF_ANNOTATION annot,
FPDF_BYTESTRING key,
void* buffer,
unsigned long buflen);
// Experimental API.
// Get the float value corresponding to |key| in |annot|'s dictionary. Writes
// value to |value| and returns True if |key| exists in the dictionary and
// |key|'s corresponding value is a number (FPDF_OBJECT_NUMBER), False
// otherwise.
//
// annot - handle to an annotation.
// key - the key to the requested dictionary entry, encoded in UTF-8.
// value - receives the value, must not be NULL.
//
// Returns True if value found, False otherwise.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFAnnot_GetNumberValue(FPDF_ANNOTATION annot,
FPDF_BYTESTRING key,
float* value);
// Experimental API.
// Set the AP (appearance string) in |annot|'s dictionary for a given
// |appearanceMode|.
//
// annot - handle to an annotation.
// appearanceMode - the appearance mode (normal, rollover or down) for which
// to get the AP.
// value - the string value to be set, encoded in UTF16-LE. If
// nullptr is passed, the AP is cleared for that mode. If the
// mode is Normal, APs for all modes are cleared.
//
// Returns true if successful.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFAnnot_SetAP(FPDF_ANNOTATION annot,
FPDF_ANNOT_APPEARANCEMODE appearanceMode,
FPDF_WIDESTRING value);
// Experimental API.
// Get the AP (appearance string) from |annot|'s dictionary for a given
// |appearanceMode|.
// |buffer| is only modified if |buflen| is large enough to hold the whole AP
// string. If |buflen| is smaller, the total size of the AP is still returned,
// but nothing is copied.
// If there is no appearance stream for |annot| in |appearanceMode|, an empty
// string is written to |buf| and 2 is returned.
// On other errors, nothing is written to |buffer| and 0 is returned.
//
// annot - handle to an annotation.
// appearanceMode - the appearance mode (normal, rollover or down) for which
// to get the AP.
// buffer - buffer for holding the value string, encoded in UTF16-LE.
// buflen - length of the buffer.
//
// Returns the length of the string value.
FPDF_EXPORT unsigned long FPDF_CALLCONV
FPDFAnnot_GetAP(FPDF_ANNOTATION annot,
FPDF_ANNOT_APPEARANCEMODE appearanceMode,
void* buffer,
unsigned long buflen);
// Experimental API.
// Get the annotation corresponding to |key| in |annot|'s dictionary. Common
// keys for linking annotations include "IRT" and "Popup". Must call
// FPDFPage_CloseAnnot() when the annotation returned by this function is no
// longer needed.
//
// annot - handle to an annotation.
// key - the key to the requested dictionary entry, encoded in UTF-8.
//
// Returns a handle to the linked annotation object, or NULL on failure.
FPDF_EXPORT FPDF_ANNOTATION FPDF_CALLCONV
FPDFAnnot_GetLinkedAnnot(FPDF_ANNOTATION annot, FPDF_BYTESTRING key);
// Experimental API.
// Get the annotation flags of |annot|.
//
// annot - handle to an annotation.
//
// Returns the annotation flags.
FPDF_EXPORT int FPDF_CALLCONV FPDFAnnot_GetFlags(FPDF_ANNOTATION annot);
// Experimental API.
// Set the |annot|'s flags to be of the value |flags|.
//
// annot - handle to an annotation.
// flags - the flag values to be set.
//
// Returns true if successful.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetFlags(FPDF_ANNOTATION annot,
int flags);
// Experimental API.
// Get the annotation flags of |annot|, which is an interactive form
// annotation in |page|.
//
// hHandle - handle to the form fill module, returned by
// FPDFDOC_InitFormFillEnvironment().
// page - handle to a page.
// annot - handle to an interactive form annotation.
//
// Returns the annotation flags specific to interactive forms.
FPDF_EXPORT int FPDF_CALLCONV
FPDFAnnot_GetFormFieldFlags(FPDF_FORMHANDLE handle,
FPDF_PAGE page,
FPDF_ANNOTATION annot);
// Experimental API.
// Retrieves an interactive form annotation whose rectangle contains a given
// point on a page. Must call FPDFPage_CloseAnnot() when the annotation returned
// is no longer needed.
//
//
// 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".
//
// Returns the interactive form annotation whose rectangle contains the given
// coordinates on the page. If there is no such annotation, return NULL.
FPDF_EXPORT FPDF_ANNOTATION FPDF_CALLCONV
FPDFAnnot_GetFormFieldAtPoint(FPDF_FORMHANDLE hHandle,
FPDF_PAGE page,
double page_x,
double page_y);
// Experimental API.
// Get the number of options in the |annot|'s "Opt" dictionary. Intended for
// use with listbox and combobox widget annotations.
//
// hHandle - handle to the form fill module, returned by
// FPDFDOC_InitFormFillEnvironment.
// annot - handle to an annotation.
//
// Returns the number of options in "Opt" dictionary on success. Return value
// will be -1 if annotation does not have an "Opt" dictionary or other error.
FPDF_EXPORT int FPDF_CALLCONV FPDFAnnot_GetOptionCount(FPDF_FORMHANDLE hHandle,
FPDF_ANNOTATION annot);
// Experimental API.
// Get the string value for the label of the option at |index| in |annot|'s
// "Opt" dictionary. Intended for use with listbox and combobox widget
// annotations. |buffer| is only modified if |buflen| is longer than the length
// of contents. If index is out of range or in case of other error, nothing
// will be added to |buffer| and the return value will be 0. Note that
// return value of empty string is 2 for "\0\0".
//
// hHandle - handle to the form fill module, returned by
// FPDFDOC_InitFormFillEnvironment.
// annot - handle to an annotation.
// index - numeric index of the option in the "Opt" array
// buffer - buffer for holding the value string, encoded in UTF16-LE.
// buflen - length of the buffer.
//
// Returns the length of the string value or 0 if annot does not have "Opt"
// array, index is out of range or other error.
FPDF_EXPORT unsigned long FPDF_CALLCONV
FPDFAnnot_GetOptionLabel(FPDF_FORMHANDLE hHandle,
FPDF_ANNOTATION annot,
int index,
void* buffer,
unsigned long buflen);
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif // PUBLIC_FPDF_ANNOT_H_

View File

@ -0,0 +1,170 @@
// Copyright 2017 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.
#ifndef PUBLIC_FPDF_ATTACHMENT_H_
#define PUBLIC_FPDF_ATTACHMENT_H_
// NOLINTNEXTLINE(build/include)
#include "fpdfview.h"
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
// Experimental API.
// Get the number of embedded files in |document|.
//
// document - handle to a document.
//
// Returns the number of embedded files in |document|.
FPDF_EXPORT int FPDF_CALLCONV
FPDFDoc_GetAttachmentCount(FPDF_DOCUMENT document);
// Experimental API.
// Add an embedded file with |name| in |document|. If |name| is empty, or if
// |name| is the name of a existing embedded file in |document|, or if
// |document|'s embedded file name tree is too deep (i.e. |document| has too
// many embedded files already), then a new attachment will not be added.
//
// document - handle to a document.
// name - name of the new attachment.
//
// Returns a handle to the new attachment object, or NULL on failure.
FPDF_EXPORT FPDF_ATTACHMENT FPDF_CALLCONV
FPDFDoc_AddAttachment(FPDF_DOCUMENT document, FPDF_WIDESTRING name);
// Experimental API.
// Get the embedded attachment at |index| in |document|. Note that the returned
// attachment handle is only valid while |document| is open.
//
// document - handle to a document.
// index - the index of the requested embedded file.
//
// Returns the handle to the attachment object, or NULL on failure.
FPDF_EXPORT FPDF_ATTACHMENT FPDF_CALLCONV
FPDFDoc_GetAttachment(FPDF_DOCUMENT document, int index);
// Experimental API.
// Delete the embedded attachment at |index| in |document|. Note that this does
// not remove the attachment data from the PDF file; it simply removes the
// file's entry in the embedded files name tree so that it does not appear in
// the attachment list. This behavior may change in the future.
//
// document - handle to a document.
// index - the index of the embedded file to be deleted.
//
// Returns true if successful.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFDoc_DeleteAttachment(FPDF_DOCUMENT document, int index);
// Experimental API.
// Get the name of the |attachment| file. |buffer| is only modified if |buflen|
// is longer than the length of the file name. On errors, |buffer| is unmodified
// and the returned length is 0.
//
// attachment - handle to an attachment.
// buffer - buffer for holding the file name, encoded in UTF16-LE.
// buflen - length of the buffer.
//
// Returns the length of the file name.
FPDF_EXPORT unsigned long FPDF_CALLCONV
FPDFAttachment_GetName(FPDF_ATTACHMENT attachment,
void* buffer,
unsigned long buflen);
// Experimental API.
// Check if the params dictionary of |attachment| has |key| as a key.
//
// attachment - handle to an attachment.
// key - the key to look for, encoded in UTF-8.
//
// Returns true if |key| exists.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFAttachment_HasKey(FPDF_ATTACHMENT attachment, FPDF_BYTESTRING key);
// Experimental API.
// Get the type of the value corresponding to |key| in the params dictionary of
// the embedded |attachment|.
//
// attachment - handle to an attachment.
// key - the key to look for, encoded in UTF-8.
//
// Returns the type of the dictionary value.
FPDF_EXPORT FPDF_OBJECT_TYPE FPDF_CALLCONV
FPDFAttachment_GetValueType(FPDF_ATTACHMENT attachment, FPDF_BYTESTRING key);
// Experimental API.
// Set the string value corresponding to |key| in the params dictionary of the
// embedded file |attachment|, overwriting the existing value if any. The value
// type should be FPDF_OBJECT_STRING after this function call succeeds.
//
// attachment - handle to an attachment.
// key - the key to the dictionary entry, encoded in UTF-8.
// value - the string value to be set, encoded in UTF16-LE.
//
// Returns true if successful.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFAttachment_SetStringValue(FPDF_ATTACHMENT attachment,
FPDF_BYTESTRING key,
FPDF_WIDESTRING value);
// Experimental API.
// Get the string value corresponding to |key| in the params dictionary of the
// embedded file |attachment|. |buffer| is only modified if |buflen| is longer
// than the length of the string value. Note that if |key| does not exist in the
// dictionary or if |key|'s corresponding value in the dictionary is not a
// string (i.e. the value is not of type FPDF_OBJECT_STRING or
// FPDF_OBJECT_NAME), then an empty string would be copied to |buffer| and the
// return value would be 2. On other errors, nothing would be added to |buffer|
// and the return value would be 0.
//
// attachment - handle to an attachment.
// key - the key to the requested string value, encoded in UTF-8.
// buffer - buffer for holding the string value encoded in UTF16-LE.
// buflen - length of the buffer.
//
// Returns the length of the dictionary value string.
FPDF_EXPORT unsigned long FPDF_CALLCONV
FPDFAttachment_GetStringValue(FPDF_ATTACHMENT attachment,
FPDF_BYTESTRING key,
void* buffer,
unsigned long buflen);
// Experimental API.
// Set the file data of |attachment|, overwriting the existing file data if any.
// The creation date and checksum will be updated, while all other dictionary
// entries will be deleted. Note that only contents with |len| smaller than
// INT_MAX is supported.
//
// attachment - handle to an attachment.
// contents - buffer holding the file data to be written in raw bytes.
// len - length of file data.
//
// Returns true if successful.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFAttachment_SetFile(FPDF_ATTACHMENT attachment,
FPDF_DOCUMENT document,
const void* contents,
const unsigned long len);
// Experimental API.
// Get the file data of |attachment|. |buffer| is only modified if |buflen| is
// longer than the length of the file. On errors, |buffer| is unmodified and the
// returned length is 0.
//
// attachment - handle to an attachment.
// buffer - buffer for holding the file data in raw bytes.
// buflen - length of the buffer.
//
// Returns the length of the file.
FPDF_EXPORT unsigned long FPDF_CALLCONV
FPDFAttachment_GetFile(FPDF_ATTACHMENT attachment,
void* buffer,
unsigned long buflen);
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif // PUBLIC_FPDF_ATTACHMENT_H_

View File

@ -0,0 +1,34 @@
// Copyright 2017 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.
#ifndef PUBLIC_FPDF_CATALOG_H_
#define PUBLIC_FPDF_CATALOG_H_
// NOLINTNEXTLINE(build/include)
#include "fpdfview.h"
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
/**
* Experimental API.
*
* Determine if |document| represents a tagged PDF.
*
* For the definition of tagged PDF, See (see 10.7 "Tagged PDF" in PDF
* Reference 1.7).
*
* document - handle to a document.
*
* Returns |true| iff |document| is a tagged PDF.
*/
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFCatalog_IsTagged(FPDF_DOCUMENT document);
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif // PUBLIC_FPDF_CATALOG_H_

View File

@ -59,14 +59,14 @@ typedef void* FPDF_AVAIL;
//
// Returns a handle to the document availability provider, or NULL on error.
//
// |FPDFAvail_Destroy| must be called when done with the availability provider.
DLLEXPORT FPDF_AVAIL STDCALL FPDFAvail_Create(FX_FILEAVAIL* file_avail,
FPDF_FILEACCESS* file);
// FPDFAvail_Destroy() must be called when done with the availability provider.
FPDF_EXPORT FPDF_AVAIL FPDF_CALLCONV FPDFAvail_Create(FX_FILEAVAIL* file_avail,
FPDF_FILEACCESS* file);
// Destroy the |avail| document availability provider.
//
// avail - handle to document availability provider to be destroyed.
DLLEXPORT void STDCALL FPDFAvail_Destroy(FPDF_AVAIL avail);
FPDF_EXPORT void FPDF_CALLCONV FPDFAvail_Destroy(FPDF_AVAIL avail);
// Download hints interface. Used to receive hints for further downloading.
typedef struct _FX_DOWNLOADHINTS {
@ -103,11 +103,12 @@ typedef struct _FX_DOWNLOADHINTS {
// Applications should call this function whenever new data arrives, and process
// all the generated download hints, if any, until the function returns
// |PDF_DATA_ERROR| or |PDF_DATA_AVAIL|.
// if hints is nullptr, the function just check current document availability.
//
// Once all data is available, call |FPDFAvail_GetDocument| to get a document
// Once all data is available, call FPDFAvail_GetDocument() to get a document
// handle.
DLLEXPORT int STDCALL
FPDFAvail_IsDocAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS* hints);
FPDF_EXPORT int FPDF_CALLCONV FPDFAvail_IsDocAvail(FPDF_AVAIL avail,
FX_DOWNLOADHINTS* hints);
// Get document from the availability provider.
//
@ -116,10 +117,12 @@ FPDFAvail_IsDocAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS* hints);
//
// Returns a handle to the document.
//
// When |FPDFAvail_IsDocAvail| returns TRUE, call |FPDFAvail_GetDocument| to
// When FPDFAvail_IsDocAvail() returns TRUE, call FPDFAvail_GetDocument() to
// retrieve the document handle.
DLLEXPORT FPDF_DOCUMENT STDCALL FPDFAvail_GetDocument(FPDF_AVAIL avail,
FPDF_BYTESTRING password);
// See the comments for FPDF_LoadDocument() regarding the encoding for
// |password|.
FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV
FPDFAvail_GetDocument(FPDF_AVAIL avail, FPDF_BYTESTRING password);
// Get the page number for the first available page in a linearized PDF.
//
@ -130,7 +133,7 @@ DLLEXPORT FPDF_DOCUMENT STDCALL FPDFAvail_GetDocument(FPDF_AVAIL avail,
// For most linearized PDFs, the first available page will be the first page,
// however, some PDFs might make another page the first available page.
// For non-linearized PDFs, this function will always return zero.
DLLEXPORT int STDCALL FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc);
FPDF_EXPORT int FPDF_CALLCONV FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc);
// Check if |page_index| is ready for loading, if not, get the
// |FX_DOWNLOADHINTS|.
@ -145,14 +148,16 @@ DLLEXPORT int STDCALL FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc);
// PDF_DATA_NOTAVAIL: Data not yet available.
// PDF_DATA_AVAIL: Data available.
//
// This function can be called only after |FPDFAvail_GetDocument| is called.
// This function can be called only after FPDFAvail_GetDocument() is called.
// Applications should call this function whenever new data arrives and process
// all the generated download |hints|, if any, until this function returns
// |PDF_DATA_ERROR| or |PDF_DATA_AVAIL|. Applications can then perform page
// loading.
DLLEXPORT int STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail,
int page_index,
FX_DOWNLOADHINTS* hints);
// if hints is nullptr, the function just check current availability of
// specified page.
FPDF_EXPORT int FPDF_CALLCONV FPDFAvail_IsPageAvail(FPDF_AVAIL avail,
int page_index,
FX_DOWNLOADHINTS* hints);
// Check if form data is ready for initialization, if not, get the
// |FX_DOWNLOADHINTS|.
@ -167,14 +172,16 @@ DLLEXPORT int STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail,
// PDF_FORM_AVAIL: Data available.
// PDF_FORM_NOTEXIST: No form data.
//
// This function can be called only after |FPDFAvail_GetDocument| is called.
// This function can be called only after FPDFAvail_GetDocument() is called.
// The application should call this function whenever new data arrives and
// process all the generated download |hints|, if any, until the function
// |PDF_FORM_ERROR|, |PDF_FORM_AVAIL| or |PDF_FORM_NOTEXIST|.
// if hints is nullptr, the function just check current form availability.
//
// Applications can then perform page loading. It is recommend to call
// |FPDFDOC_InitFormFillEnvironment| when |PDF_FORM_AVAIL| is returned.
DLLEXPORT int STDCALL FPDFAvail_IsFormAvail(FPDF_AVAIL avail,
FX_DOWNLOADHINTS* hints);
// FPDFDOC_InitFormFillEnvironment() when |PDF_FORM_AVAIL| is returned.
FPDF_EXPORT int FPDF_CALLCONV FPDFAvail_IsFormAvail(FPDF_AVAIL avail,
FX_DOWNLOADHINTS* hints);
// Check whether a document is a linearized PDF.
//
@ -185,11 +192,11 @@ DLLEXPORT int STDCALL FPDFAvail_IsFormAvail(FPDF_AVAIL avail,
// PDF_NOT_LINEARIZED
// PDF_LINEARIZATION_UNKNOWN
//
// |FPDFAvail_IsLinearized| will return |PDF_LINEARIZED| or |PDF_NOT_LINEARIZED|
// FPDFAvail_IsLinearized() will return |PDF_LINEARIZED| or |PDF_NOT_LINEARIZED|
// when we have 1k of data. If the files size less than 1k, it returns
// |PDF_LINEARIZATION_UNKNOWN| as there is insufficient information to determine
// if the PDF is linearlized.
DLLEXPORT int STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail);
FPDF_EXPORT int FPDF_CALLCONV FPDFAvail_IsLinearized(FPDF_AVAIL avail);
#ifdef __cplusplus
} // extern "C"

View File

@ -25,6 +25,17 @@ extern "C" {
// Launch an application or open a file.
#define PDFACTION_LAUNCH 4
// View destination fit types. See pdfmark reference v9, page 48.
#define PDFDEST_VIEW_UNKNOWN_MODE 0
#define PDFDEST_VIEW_XYZ 1
#define PDFDEST_VIEW_FIT 2
#define PDFDEST_VIEW_FITH 3
#define PDFDEST_VIEW_FITV 4
#define PDFDEST_VIEW_FITR 5
#define PDFDEST_VIEW_FITB 6
#define PDFDEST_VIEW_FITBH 7
#define PDFDEST_VIEW_FITBV 8
typedef struct _FS_QUADPOINTSF {
FS_FLOAT x1;
FS_FLOAT y1;
@ -44,7 +55,7 @@ typedef struct _FS_QUADPOINTSF {
//
// Returns a handle to the first child of |bookmark| or the first top-level
// bookmark item. NULL if no child or top-level bookmark found.
DLLEXPORT FPDF_BOOKMARK STDCALL
FPDF_EXPORT FPDF_BOOKMARK FPDF_CALLCONV
FPDFBookmark_GetFirstChild(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark);
// Get the next sibling of |bookmark|.
@ -54,7 +65,7 @@ FPDFBookmark_GetFirstChild(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark);
//
// Returns a handle to the next sibling of |bookmark|, or NULL if this is the
// last bookmark at this level.
DLLEXPORT FPDF_BOOKMARK STDCALL
FPDF_EXPORT FPDF_BOOKMARK FPDF_CALLCONV
FPDFBookmark_GetNextSibling(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark);
// Get the title of |bookmark|.
@ -70,9 +81,10 @@ FPDFBookmark_GetNextSibling(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark);
// Regardless of the platform, the |buffer| is always in UTF-16LE encoding. The
// string is terminated by a UTF16 NUL character. If |buflen| is less than the
// required length, or |buffer| is NULL, |buffer| will not be modified.
DLLEXPORT unsigned long STDCALL FPDFBookmark_GetTitle(FPDF_BOOKMARK bookmark,
void* buffer,
unsigned long buflen);
FPDF_EXPORT unsigned long FPDF_CALLCONV
FPDFBookmark_GetTitle(FPDF_BOOKMARK bookmark,
void* buffer,
unsigned long buflen);
// Find the bookmark with |title| in |document|.
//
@ -81,10 +93,10 @@ DLLEXPORT unsigned long STDCALL FPDFBookmark_GetTitle(FPDF_BOOKMARK bookmark,
//
// Returns the handle to the bookmark, or NULL if |title| can't be found.
//
// |FPDFBookmark_Find| will always return the first bookmark found even if
// FPDFBookmark_Find() will always return the first bookmark found even if
// multiple bookmarks have the same |title|.
DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_Find(FPDF_DOCUMENT document,
FPDF_WIDESTRING title);
FPDF_EXPORT FPDF_BOOKMARK FPDF_CALLCONV
FPDFBookmark_Find(FPDF_DOCUMENT document, FPDF_WIDESTRING title);
// Get the destination associated with |bookmark|.
//
@ -93,17 +105,18 @@ DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_Find(FPDF_DOCUMENT document,
//
// Returns the handle to the destination data, NULL if no destination is
// associated with |bookmark|.
DLLEXPORT FPDF_DEST STDCALL FPDFBookmark_GetDest(FPDF_DOCUMENT document,
FPDF_BOOKMARK bookmark);
FPDF_EXPORT FPDF_DEST FPDF_CALLCONV
FPDFBookmark_GetDest(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark);
// Get the action associated with |bookmark|.
//
// bookmark - handle to the bookmark.
//
// Returns the handle to the action data, or NULL if no action is associated
// with |bookmark|. When NULL is returned, |FPDFBookmark_GetDest| should be
// with |bookmark|. When NULL is returned, FPDFBookmark_GetDest() should be
// called to get the |bookmark| destination data.
DLLEXPORT FPDF_ACTION STDCALL FPDFBookmark_GetAction(FPDF_BOOKMARK bookmark);
FPDF_EXPORT FPDF_ACTION FPDF_CALLCONV
FPDFBookmark_GetAction(FPDF_BOOKMARK bookmark);
// Get the type of |action|.
//
@ -115,7 +128,7 @@ DLLEXPORT FPDF_ACTION STDCALL FPDFBookmark_GetAction(FPDF_BOOKMARK bookmark);
// PDFACTION_REMOTEGOTO
// PDFACTION_URI
// PDFACTION_LAUNCH
DLLEXPORT unsigned long STDCALL FPDFAction_GetType(FPDF_ACTION action);
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAction_GetType(FPDF_ACTION action);
// Get the destination of |action|.
//
@ -123,54 +136,71 @@ DLLEXPORT unsigned long STDCALL FPDFAction_GetType(FPDF_ACTION action);
// action - handle to the action. |action| must be a |PDFACTION_GOTO| or
// |PDFACTION_REMOTEGOTO|.
//
// Returns a handle to the destination data.
// Returns a handle to the destination data, or NULL on error, typically
// because the arguments were bad or the action was of the wrong type.
//
// In the case of |PDFACTION_REMOTEGOTO|, you should first call
// |FPDFAction_GetFilePath| then load that document, the document handle from
// that document should pass as |document| to |FPDFAction_GetDest|.
DLLEXPORT FPDF_DEST STDCALL FPDFAction_GetDest(FPDF_DOCUMENT document,
FPDF_ACTION action);
// In the case of |PDFACTION_REMOTEGOTO|, you must first call
// FPDFAction_GetFilePath(), then load the document at that path, then pass
// the document handle from that document as |document| to FPDFAction_GetDest().
FPDF_EXPORT FPDF_DEST FPDF_CALLCONV FPDFAction_GetDest(FPDF_DOCUMENT document,
FPDF_ACTION action);
// Get file path of a |PDFACTION_REMOTEGOTO| |action|.
// Get the file path of |action|.
//
// action - handle to the action. |action| must be a |PDFACTION_LAUNCH| or
// |PDFACTION_REMOTEGOTO|
// |PDFACTION_REMOTEGOTO|.
// buffer - a buffer for output the path string. May be NULL.
// buflen - the length of the buffer, in bytes. May be 0.
//
// Returns the number of bytes in the file path, including the trailing UTF16
// NUL character.
// Returns the number of bytes in the file path, including the trailing NUL
// character, or 0 on error, typically because the arguments were bad or the
// action was of the wrong type.
//
// Regardless of the platform, the |buffer| is always in UTF-16LE encoding.
// Regardless of the platform, the |buffer| is always in UTF-8 encoding.
// If |buflen| is less than the returned length, or |buffer| is NULL, |buffer|
// will not be modified.
DLLEXPORT unsigned long STDCALL
FPDF_EXPORT unsigned long FPDF_CALLCONV
FPDFAction_GetFilePath(FPDF_ACTION action, void* buffer, unsigned long buflen);
// Get the URI path of a |PDFACTION_URI| |action|.
// Get the URI path of |action|.
//
// document - handle to the document.
// action - handle to the action. Must be a |PDFACTION_URI|.
// buffer - a buffer for the path string. May be NULL.
// buflen - the length of the buffer, in bytes. May be 0.
//
// Returns the number of bytes in the URI path, including trailing zeros.
// Returns the number of bytes in the URI path, including the trailing NUL
// character, or 0 on error, typically because the arguments were bad or the
// action was of the wrong type.
//
// The |buffer| is always encoded in 7-bit ASCII. If |buflen| is less than the
// returned length, or |buffer| is NULL, |buffer| will not be modified.
DLLEXPORT unsigned long STDCALL FPDFAction_GetURIPath(FPDF_DOCUMENT document,
FPDF_ACTION action,
void* buffer,
unsigned long buflen);
FPDF_EXPORT unsigned long FPDF_CALLCONV
FPDFAction_GetURIPath(FPDF_DOCUMENT document,
FPDF_ACTION action,
void* buffer,
unsigned long buflen);
// Get the page index of |dest|.
//
// document - handle to the document.
// dest - handle to the destination.
//
// Returns the page index containing |dest|. Page indices start from 0.
DLLEXPORT unsigned long STDCALL FPDFDest_GetPageIndex(FPDF_DOCUMENT document,
FPDF_DEST dest);
// Returns the 0-based page index containing |dest|. Returns -1 on error.
FPDF_EXPORT int FPDF_CALLCONV FPDFDest_GetDestPageIndex(FPDF_DOCUMENT document,
FPDF_DEST dest);
// Get the view (fit type) specified by |dest|.
// Experimental API. Subject to change.
//
// dest - handle to the destination.
// pNumParams - receives the number of view parameters, which is at most 4.
// pParams - buffer to write the view parameters. Must be at least 4
// FS_FLOATs long.
// Returns one of the PDFDEST_VIEW_* constants, PDFDEST_VIEW_UNKNOWN_MODE if
// |dest| does not specify a view.
FPDF_EXPORT unsigned long FPDF_CALLCONV
FPDFDest_GetView(FPDF_DEST dest, unsigned long* pNumParams, FS_FLOAT* pParams);
// Get the (x, y, zoom) location of |dest| in the destination page, if the
// destination is in [page /XYZ x y zoom] syntax.
@ -186,13 +216,14 @@ DLLEXPORT unsigned long STDCALL FPDFDest_GetPageIndex(FPDF_DOCUMENT document,
//
// Note the [x, y, zoom] values are only set if the corresponding hasXVal,
// hasYVal or hasZoomVal flags are true.
DLLEXPORT FPDF_BOOL STDCALL FPDFDest_GetLocationInPage(FPDF_DEST dest,
FPDF_BOOL* hasXCoord,
FPDF_BOOL* hasYCoord,
FPDF_BOOL* hasZoom,
FS_FLOAT* x,
FS_FLOAT* y,
FS_FLOAT* zoom);
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFDest_GetLocationInPage(FPDF_DEST dest,
FPDF_BOOL* hasXCoord,
FPDF_BOOL* hasYCoord,
FPDF_BOOL* hasZoom,
FS_FLOAT* x,
FS_FLOAT* y,
FS_FLOAT* zoom);
// Find a link at point (|x|,|y|) on |page|.
//
@ -203,10 +234,10 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFDest_GetLocationInPage(FPDF_DEST dest,
// Returns a handle to the link, or NULL if no link found at the given point.
//
// You can convert coordinates from screen coordinates to page coordinates using
// |FPDF_DeviceToPage|.
DLLEXPORT FPDF_LINK STDCALL FPDFLink_GetLinkAtPoint(FPDF_PAGE page,
double x,
double y);
// FPDF_DeviceToPage().
FPDF_EXPORT FPDF_LINK FPDF_CALLCONV FPDFLink_GetLinkAtPoint(FPDF_PAGE page,
double x,
double y);
// Find the Z-order of link at point (|x|,|y|) on |page|.
//
@ -218,9 +249,10 @@ DLLEXPORT FPDF_LINK STDCALL FPDFLink_GetLinkAtPoint(FPDF_PAGE page,
// Larger Z-order numbers are closer to the front.
//
// You can convert coordinates from screen coordinates to page coordinates using
// |FPDF_DeviceToPage|.
DLLEXPORT int STDCALL
FPDFLink_GetLinkZOrderAtPoint(FPDF_PAGE page, double x, double y);
// FPDF_DeviceToPage().
FPDF_EXPORT int FPDF_CALLCONV FPDFLink_GetLinkZOrderAtPoint(FPDF_PAGE page,
double x,
double y);
// Get destination info for |link|.
//
@ -228,56 +260,57 @@ FPDFLink_GetLinkZOrderAtPoint(FPDF_PAGE page, double x, double y);
// link - handle to the link.
//
// Returns a handle to the destination, or NULL if there is no destination
// associated with the link. In this case, you should call |FPDFLink_GetAction|
// associated with the link. In this case, you should call FPDFLink_GetAction()
// to retrieve the action associated with |link|.
DLLEXPORT FPDF_DEST STDCALL FPDFLink_GetDest(FPDF_DOCUMENT document,
FPDF_LINK link);
FPDF_EXPORT FPDF_DEST FPDF_CALLCONV FPDFLink_GetDest(FPDF_DOCUMENT document,
FPDF_LINK link);
// Get action info for |link|.
//
// link - handle to the link.
//
// Returns a handle to the action associated to |link|, or NULL if no action.
DLLEXPORT FPDF_ACTION STDCALL FPDFLink_GetAction(FPDF_LINK link);
FPDF_EXPORT FPDF_ACTION FPDF_CALLCONV FPDFLink_GetAction(FPDF_LINK link);
// Enumerates all the link annotations in |page|.
//
// page - handle to the page.
// startPos - the start position, should initially be 0 and is updated with
// the next start position on return.
// linkAnnot - the link handle for |startPos|.
// page - handle to the page.
// start_pos - the start position, should initially be 0 and is updated with
// the next start position on return.
// link_annot - the link handle for |startPos|.
//
// Returns TRUE on success.
DLLEXPORT FPDF_BOOL STDCALL FPDFLink_Enumerate(FPDF_PAGE page,
int* startPos,
FPDF_LINK* linkAnnot);
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_Enumerate(FPDF_PAGE page,
int* start_pos,
FPDF_LINK* link_annot);
// Get the rectangle for |linkAnnot|.
// Get the rectangle for |link_annot|.
//
// linkAnnot - handle to the link annotation.
// rect - the annotation rectangle.
// link_annot - handle to the link annotation.
// rect - the annotation rectangle.
//
// Returns true on success.
DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetAnnotRect(FPDF_LINK linkAnnot,
FS_RECTF* rect);
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_GetAnnotRect(FPDF_LINK link_annot,
FS_RECTF* rect);
// Get the count of quadrilateral points to the |linkAnnot|.
// Get the count of quadrilateral points to the |link_annot|.
//
// linkAnnot - handle to the link annotation.
// link_annot - handle to the link annotation.
//
// Returns the count of quadrilateral points.
DLLEXPORT int STDCALL FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot);
FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountQuadPoints(FPDF_LINK link_annot);
// Get the quadrilateral points for the specified |quadIndex| in |linkAnnot|.
// Get the quadrilateral points for the specified |quad_index| in |link_annot|.
//
// linkAnnot - handle to the link annotation.
// quadIndex - the specified quad point index.
// quadPoints - receives the quadrilateral points.
// link_annot - handle to the link annotation.
// quad_index - the specified quad point index.
// quad_points - receives the quadrilateral points.
//
// Returns true on success.
DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot,
int quadIndex,
FS_QUADPOINTSF* quadPoints);
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFLink_GetQuadPoints(FPDF_LINK link_annot,
int quad_index,
FS_QUADPOINTSF* quad_points);
// Get meta-data |tag| content from |document|.
//
@ -296,10 +329,14 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot,
// The |buffer| is always encoded in UTF-16LE. The |buffer| is followed by two
// bytes of zeros indicating the end of the string. If |buflen| is less than
// the returned length, or |buffer| is NULL, |buffer| will not be modified.
DLLEXPORT unsigned long STDCALL FPDF_GetMetaText(FPDF_DOCUMENT document,
FPDF_BYTESTRING tag,
void* buffer,
unsigned long buflen);
//
// For linearized files, FPDFAvail_IsFormAvail must be called before this, and
// it must have returned PDF_FORM_AVAIL or PDF_FORM_NOTEXIST. Before that, there
// is no guarantee the metadata has been loaded.
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDF_GetMetaText(FPDF_DOCUMENT document,
FPDF_BYTESTRING tag,
void* buffer,
unsigned long buflen);
// Get the page label for |page_index| from |document|.
//
@ -313,10 +350,11 @@ DLLEXPORT unsigned long STDCALL FPDF_GetMetaText(FPDF_DOCUMENT document,
// The |buffer| is always encoded in UTF-16LE. The |buffer| is followed by two
// bytes of zeros indicating the end of the string. If |buflen| is less than
// the returned length, or |buffer| is NULL, |buffer| will not be modified.
DLLEXPORT unsigned long STDCALL FPDF_GetPageLabel(FPDF_DOCUMENT document,
int page_index,
void* buffer,
unsigned long buflen);
FPDF_EXPORT unsigned long FPDF_CALLCONV
FPDF_GetPageLabel(FPDF_DOCUMENT document,
int page_index,
void* buffer,
unsigned long buflen);
#ifdef __cplusplus
} // extern "C"

File diff suppressed because it is too large Load Diff

View File

@ -7,6 +7,8 @@
#ifndef PUBLIC_FPDF_EXT_H_
#define PUBLIC_FPDF_EXT_H_
#include <time.h>
// NOLINTNEXTLINE(build/include)
#include "fpdfview.h"
@ -64,9 +66,28 @@ typedef struct _UNSUPPORT_INFO {
// unsp_info - Pointer to an UNSUPPORT_INFO structure.
//
// Returns TRUE on success.
DLLEXPORT FPDF_BOOL STDCALL
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FSDK_SetUnSpObjProcessHandler(UNSUPPORT_INFO* unsp_info);
// Set replacement function for calls to time().
//
// This API is intended to be used only for testing, thus may cause PDFium to
// behave poorly in production environments.
//
// func - Function pointer to alternate implementation of time(), or
// NULL to restore to actual time() call itself.
FPDF_EXPORT void FPDF_CALLCONV FSDK_SetTimeFunction(time_t (*func)());
// Set replacement function for calls to localtime().
//
// This API is intended to be used only for testing, thus may cause PDFium to
// behave poorly in production environments.
//
// func - Function pointer to alternate implementation of localtime(), or
// NULL to restore to actual localtime() call itself.
FPDF_EXPORT void FPDF_CALLCONV
FSDK_SetLocaltimeFunction(struct tm* (*func)(const time_t*));
// Unknown page mode.
#define PAGEMODE_UNKNOWN -1
// Document outline, and thumbnails hidden.
@ -89,7 +110,7 @@ FSDK_SetUnSpObjProcessHandler(UNSUPPORT_INFO* unsp_info);
// Returns one of the |PAGEMODE_*| flags defined above.
//
// The page mode defines how the document should be initially displayed.
DLLEXPORT int STDCALL FPDFDoc_GetPageMode(FPDF_DOCUMENT document);
FPDF_EXPORT int FPDF_CALLCONV FPDFDoc_GetPageMode(FPDF_DOCUMENT document);
#ifdef __cplusplus
} // extern "C"

View File

@ -35,7 +35,7 @@ extern "C" {
//
// Currently, all failures return |FLATTEN_FAIL| with no indication of the
// cause.
DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag);
FPDF_EXPORT int FPDF_CALLCONV FPDFPage_Flatten(FPDF_PAGE page, int nFlag);
#ifdef __cplusplus
} // extern "C"

File diff suppressed because it is too large Load Diff

View File

@ -23,10 +23,34 @@ extern "C" {
// index - The page index to insert at.
//
// Returns TRUE on success.
DLLEXPORT FPDF_BOOL STDCALL FPDF_ImportPages(FPDF_DOCUMENT dest_doc,
FPDF_DOCUMENT src_doc,
FPDF_BYTESTRING pagerange,
int index);
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_ImportPages(FPDF_DOCUMENT dest_doc,
FPDF_DOCUMENT src_doc,
FPDF_BYTESTRING pagerange,
int index);
// Experimental API.
// Create a new document from |src_doc|. The pages of |src_doc| will be
// combined to provide |num_pages_on_x_axis x num_pages_on_y_axis| pages per
// |output_doc| page.
//
// src_doc - The document to be imported.
// output_width - The output page width in PDF "user space" units.
// output_height - The output page height in PDF "user space" units.
// num_pages_on_x_axis - The number of pages on X Axis.
// num_pages_on_y_axis - The number of pages on Y Axis.
//
// Return value:
// A handle to the created document, or NULL on failure.
//
// Comments:
// number of pages per page = num_pages_on_x_axis * num_pages_on_y_axis
//
FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV
FPDF_ImportNPagesToOne(FPDF_DOCUMENT src_doc,
float output_width,
float output_height,
unsigned int num_pages_on_x_axis,
unsigned int num_pages_on_y_axis);
// Copy the viewer preferences from |src_doc| into |dest_doc|.
//
@ -34,8 +58,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_ImportPages(FPDF_DOCUMENT dest_doc,
// src_doc - Document to read the viewer preferences from.
//
// Returns TRUE on success.
DLLEXPORT FPDF_BOOL STDCALL FPDF_CopyViewerPreferences(FPDF_DOCUMENT dest_doc,
FPDF_DOCUMENT src_doc);
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDF_CopyViewerPreferences(FPDF_DOCUMENT dest_doc, FPDF_DOCUMENT src_doc);
#ifdef __cplusplus
} // extern "C"

View File

@ -11,8 +11,8 @@
#include "fpdfview.h"
// Flags for progressive process status.
#define FPDF_RENDER_READER 0
#define FPDF_RENDER_TOBECOUNTINUED 1
#define FPDF_RENDER_READY 0
#define FPDF_RENDER_TOBECONTINUED 1
#define FPDF_RENDER_DONE 2
#define FPDF_RENDER_FAILED 3
@ -77,15 +77,15 @@ typedef struct _IFSDK_PAUSE {
// 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);
FPDF_EXPORT int FPDF_CALLCONV 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);
// Function: FPDF_RenderPage_Continue
// Continue rendering a PDF page.
@ -99,8 +99,8 @@ DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start(FPDF_BITMAP bitmap,
// Return value:
// The rendering status. See flags for progressive process status for
// the details.
DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page,
IFSDK_PAUSE* pause);
FPDF_EXPORT int FPDF_CALLCONV FPDF_RenderPage_Continue(FPDF_PAGE page,
IFSDK_PAUSE* pause);
// Function: FPDF_RenderPage_Close
// Release the resource allocate during page rendering. Need to be
@ -111,7 +111,7 @@ DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page,
// function.
// Return value:
// NULL
DLLEXPORT void STDCALL FPDF_RenderPage_Close(FPDF_PAGE page);
FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPage_Close(FPDF_PAGE page);
#ifdef __cplusplus
}

View File

@ -59,9 +59,9 @@ typedef struct FPDF_FILEWRITE_ {
// Return value:
// TRUE for succeed, FALSE for failed.
//
DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveAsCopy(FPDF_DOCUMENT document,
FPDF_FILEWRITE* pFileWrite,
FPDF_DWORD flags);
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV 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
@ -75,10 +75,11 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveAsCopy(FPDF_DOCUMENT document,
// Return value:
// TRUE if succeed, FALSE if failed.
//
DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion(FPDF_DOCUMENT document,
FPDF_FILEWRITE* pFileWrite,
FPDF_DWORD flags,
int fileVersion);
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDF_SaveWithVersion(FPDF_DOCUMENT document,
FPDF_FILEWRITE* pFileWrite,
FPDF_DWORD flags,
int fileVersion);
#ifdef __cplusplus
}

View File

@ -17,10 +17,10 @@ extern "C" {
// Get the character index in |text_page| internal character list.
//
// text_page - a text page information structure.
// nTextIndex - index of the text returned from |FPDFText_GetText|.
// nTextIndex - index of the text returned from FPDFText_GetText().
//
// Returns the index of the character in internal character list. -1 for error.
DLLEXPORT int STDCALL
FPDF_EXPORT int FPDF_CALLCONV
FPDFText_GetCharIndexFromTextIndex(FPDF_TEXTPAGE text_page, int nTextIndex);
// Get the text index in |text_page| internal character list.
@ -28,8 +28,8 @@ FPDFText_GetCharIndexFromTextIndex(FPDF_TEXTPAGE text_page, int nTextIndex);
// text_page - a text page information structure.
// nCharIndex - index of the character in internal character list.
//
// Returns the index of the text returned from |FPDFText_GetText|. -1 for error.
DLLEXPORT int STDCALL
// Returns the index of the text returned from FPDFText_GetText(). -1 for error.
FPDF_EXPORT int FPDF_CALLCONV
FPDFText_GetTextIndexFromCharIndex(FPDF_TEXTPAGE text_page, int nCharIndex);
#ifdef __cplusplus

View File

@ -21,7 +21,8 @@ extern "C" {
// function.
// Return value:
// A handle to the structure tree or NULL on error.
DLLEXPORT FPDF_STRUCTTREE STDCALL FPDF_StructTree_GetForPage(FPDF_PAGE page);
FPDF_EXPORT FPDF_STRUCTTREE FPDF_CALLCONV
FPDF_StructTree_GetForPage(FPDF_PAGE page);
// Function: FPDF_StructTree_Close
// Release the resource allocate by FPDF_StructTree_GetForPage.
@ -30,7 +31,8 @@ DLLEXPORT FPDF_STRUCTTREE STDCALL FPDF_StructTree_GetForPage(FPDF_PAGE page);
// FPDF_StructTree_LoadPage function.
// Return value:
// NULL
DLLEXPORT void STDCALL FPDF_StructTree_Close(FPDF_STRUCTTREE struct_tree);
FPDF_EXPORT void FPDF_CALLCONV
FPDF_StructTree_Close(FPDF_STRUCTTREE struct_tree);
// Function: FPDF_StructTree_CountChildren
// Count the number of children for the structure tree.
@ -39,7 +41,7 @@ DLLEXPORT void STDCALL FPDF_StructTree_Close(FPDF_STRUCTTREE struct_tree);
// FPDF_StructTree_LoadPage function.
// Return value:
// The number of children, or -1 on error.
DLLEXPORT int STDCALL
FPDF_EXPORT int FPDF_CALLCONV
FPDF_StructTree_CountChildren(FPDF_STRUCTTREE struct_tree);
// Function: FPDF_StructTree_GetChildAtIndex
@ -50,7 +52,7 @@ FPDF_StructTree_CountChildren(FPDF_STRUCTTREE struct_tree);
// index - The index for the child, 0-based.
// Return value:
// The child at the n-th index or NULL on error.
DLLEXPORT FPDF_STRUCTELEMENT STDCALL
FPDF_EXPORT FPDF_STRUCTELEMENT FPDF_CALLCONV
FPDF_StructTree_GetChildAtIndex(FPDF_STRUCTTREE struct_tree, int index);
// Function: FPDF_StructElement_GetAltText
@ -68,11 +70,21 @@ FPDF_StructTree_GetChildAtIndex(FPDF_STRUCTTREE struct_tree, int index);
// encoding. The string is terminated by a UTF16 NUL character. If
// |buflen| is less than the required length, or |buffer| is NULL,
// |buffer| will not be modified.
DLLEXPORT unsigned long STDCALL
FPDF_EXPORT unsigned long FPDF_CALLCONV
FPDF_StructElement_GetAltText(FPDF_STRUCTELEMENT struct_element,
void* buffer,
unsigned long buflen);
// Function: FPDF_StructElement_GetMarkedContentID
// Get the marked content ID for a given element.
// Parameters:
// struct_element - Handle to the struct element.
// Return value:
// The marked content ID of the element. If no ID exists, returns
// -1.
FPDF_EXPORT int FPDF_CALLCONV
FPDF_StructElement_GetMarkedContentID(FPDF_STRUCTELEMENT struct_element);
// Function: FPDF_StructElement_GetType
// Get the type (/S) for a given element.
// Parameters:
@ -88,7 +100,7 @@ FPDF_StructElement_GetAltText(FPDF_STRUCTELEMENT struct_element,
// encoding. The string is terminated by a UTF16 NUL character. If
// |buflen| is less than the required length, or |buffer| is NULL,
// |buffer| will not be modified.
DLLEXPORT unsigned long STDCALL
FPDF_EXPORT unsigned long FPDF_CALLCONV
FPDF_StructElement_GetType(FPDF_STRUCTELEMENT struct_element,
void* buffer,
unsigned long buflen);
@ -108,7 +120,7 @@ FPDF_StructElement_GetType(FPDF_STRUCTELEMENT struct_element,
// encoding. The string is terminated by a UTF16 NUL character. If
// |buflen| is less than the required length, or |buffer| is NULL,
// |buffer| will not be modified.
DLLEXPORT unsigned long STDCALL
FPDF_EXPORT unsigned long FPDF_CALLCONV
FPDF_StructElement_GetTitle(FPDF_STRUCTELEMENT struct_element,
void* buffer,
unsigned long buflen);
@ -119,7 +131,7 @@ FPDF_StructElement_GetTitle(FPDF_STRUCTELEMENT struct_element,
// struct_element - Handle to the struct element.
// Return value:
// The number of children, or -1 on error.
DLLEXPORT int STDCALL
FPDF_EXPORT int FPDF_CALLCONV
FPDF_StructElement_CountChildren(FPDF_STRUCTELEMENT struct_element);
// Function: FPDF_StructElement_GetChildAtIndex
@ -132,7 +144,7 @@ FPDF_StructElement_CountChildren(FPDF_STRUCTELEMENT struct_element);
// Comments:
// If the child exists but is not an element, then this function will
// return NULL. This will also return NULL for out of bounds indices.
DLLEXPORT FPDF_STRUCTELEMENT STDCALL
FPDF_EXPORT FPDF_STRUCTELEMENT FPDF_CALLCONV
FPDF_StructElement_GetChildAtIndex(FPDF_STRUCTELEMENT struct_element,
int index);

View File

@ -20,7 +20,7 @@
#define FXFONT_CHINESEBIG5_CHARSET 136
/* Font pitch and family flags */
#define FXFONT_FF_FIXEDPITCH 1
#define FXFONT_FF_FIXEDPITCH (1 << 0)
#define FXFONT_FF_ROMAN (1 << 4)
#define FXFONT_FF_SCRIPT (4 << 4)
@ -106,10 +106,7 @@ typedef struct _FPDF_SYSFONTINFO {
*constants.
* face - Typeface name. Currently use system local encoding
*only.
* bExact - Pointer to a boolean value receiving the indicator
*whether mapper found the exact match.
* If mapper is not sure whether it's exact match,
*ignore this paramter.
* bExact - Obsolete: this parameter is now ignored.
* Return Value:
* An opaque pointer for font handle, or NULL if system mapping is
*not supported.
@ -244,7 +241,7 @@ typedef struct FPDF_CharsetFontMap_ {
* Return Value:
* Pointer to the Charset Font Map.
**/
DLLEXPORT const FPDF_CharsetFontMap* STDCALL FPDF_GetDefaultTTFMap();
FPDF_EXPORT const FPDF_CharsetFontMap* FPDF_CALLCONV FPDF_GetDefaultTTFMap();
/**
* Function: FPDF_AddInstalledFont
@ -259,9 +256,9 @@ DLLEXPORT const FPDF_CharsetFontMap* STDCALL FPDF_GetDefaultTTFMap();
* Return Value:
* None.
**/
DLLEXPORT void STDCALL FPDF_AddInstalledFont(void* mapper,
const char* face,
int charset);
FPDF_EXPORT void FPDF_CALLCONV FPDF_AddInstalledFont(void* mapper,
const char* face,
int charset);
/**
* Function: FPDF_SetSystemFontInfo
@ -275,7 +272,8 @@ DLLEXPORT void STDCALL FPDF_AddInstalledFont(void* mapper,
* Return Value:
* None
**/
DLLEXPORT void STDCALL FPDF_SetSystemFontInfo(FPDF_SYSFONTINFO* pFontInfo);
FPDF_EXPORT void FPDF_CALLCONV
FPDF_SetSystemFontInfo(FPDF_SYSFONTINFO* pFontInfo);
/**
* Function: FPDF_GetDefaultSystemFontInfo
@ -294,7 +292,7 @@ DLLEXPORT void STDCALL FPDF_SetSystemFontInfo(FPDF_SYSFONTINFO* pFontInfo);
* Application should call FPDF_FreeDefaultSystemFontInfo to free the
*returned pointer.
**/
DLLEXPORT FPDF_SYSFONTINFO* STDCALL FPDF_GetDefaultSystemFontInfo();
FPDF_EXPORT FPDF_SYSFONTINFO* FPDF_CALLCONV FPDF_GetDefaultSystemFontInfo();
/**
* Function: FPDF_FreeDefaultSystemFontInfo
@ -307,7 +305,8 @@ DLLEXPORT FPDF_SYSFONTINFO* STDCALL FPDF_GetDefaultSystemFontInfo();
* Return Value:
* None
**/
DLLEXPORT void FPDF_FreeDefaultSystemFontInfo(FPDF_SYSFONTINFO* pFontInfo);
FPDF_EXPORT void FPDF_CALLCONV
FPDF_FreeDefaultSystemFontInfo(FPDF_SYSFONTINFO* pFontInfo);
#ifdef __cplusplus
}

View File

@ -27,7 +27,7 @@ extern "C" {
// Application must call FPDFText_ClosePage to release the text page
// information.
//
DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page);
FPDF_EXPORT FPDF_TEXTPAGE FPDF_CALLCONV FPDFText_LoadPage(FPDF_PAGE page);
// Function: FPDFText_ClosePage
// Release all resources allocated for a text page information
@ -38,7 +38,7 @@ DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page);
// Return Value:
// None.
//
DLLEXPORT void STDCALL FPDFText_ClosePage(FPDF_TEXTPAGE text_page);
FPDF_EXPORT void FPDF_CALLCONV FPDFText_ClosePage(FPDF_TEXTPAGE text_page);
// Function: FPDFText_CountChars
// Get number of characters in a page.
@ -56,7 +56,7 @@ DLLEXPORT void STDCALL FPDFText_ClosePage(FPDF_TEXTPAGE text_page);
// first character in the page
// has an index value of zero.
//
DLLEXPORT int STDCALL FPDFText_CountChars(FPDF_TEXTPAGE text_page);
FPDF_EXPORT int FPDF_CALLCONV FPDFText_CountChars(FPDF_TEXTPAGE text_page);
// Function: FPDFText_GetUnicode
// Get Unicode of a character in a page.
@ -70,8 +70,8 @@ DLLEXPORT int STDCALL FPDFText_CountChars(FPDF_TEXTPAGE text_page);
// convert to Unicode,
// the return value will be zero.
//
DLLEXPORT unsigned int STDCALL FPDFText_GetUnicode(FPDF_TEXTPAGE text_page,
int index);
FPDF_EXPORT unsigned int FPDF_CALLCONV
FPDFText_GetUnicode(FPDF_TEXTPAGE text_page, int index);
// Function: FPDFText_GetFontSize
// Get the font size of a particular character.
@ -84,8 +84,33 @@ DLLEXPORT unsigned int STDCALL FPDFText_GetUnicode(FPDF_TEXTPAGE text_page,
// 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);
FPDF_EXPORT double FPDF_CALLCONV FPDFText_GetFontSize(FPDF_TEXTPAGE text_page,
int index);
// Experimental API.
// Function: FPDFText_GetFontInfo
// Get the font name and flags of a particular character.
// Parameters:
// text_page - Handle to a text page information structure.
// Returned by FPDFText_LoadPage function.
// index - Zero-based index of the character.
// buffer - A buffer receiving the font name.
// buflen - The length of |buffer| in bytes.
// flags - Optional pointer to an int receiving the font flags.
// These flags should be interpreted per PDF spec 1.7 Section 5.7.1
// Font Descriptor Flags.
// Return value:
// On success, return the length of the font name, including the
// trailing NUL character, in bytes. If this length is less than or
// equal to |length|, |buffer| is set to the font name, |flags| is
// set to the font flags. |buffer| is in UTF-8 encoding. Return 0 on
// failure.
FPDF_EXPORT unsigned long FPDF_CALLCONV
FPDFText_GetFontInfo(FPDF_TEXTPAGE text_page,
int index,
void* buffer,
unsigned long buflen,
int* flags);
// Function: FPDFText_GetCharBox
// Get bounding box of a particular character.
@ -102,16 +127,39 @@ DLLEXPORT double STDCALL FPDFText_GetFontSize(FPDF_TEXTPAGE text_page,
// top - Pointer to a double number receiving top position of
// the character box.
// Return Value:
// None.
// On success, return TRUE and fill in |left|, |right|, |bottom|, and
// |top|. If |text_page| is invalid, or if |index| is out of bounds,
// then return FALSE, and the out parameters remain unmodified.
// Comments:
// All positions are measured in PDF "user space".
//
DLLEXPORT void STDCALL FPDFText_GetCharBox(FPDF_TEXTPAGE text_page,
int index,
double* left,
double* right,
double* bottom,
double* top);
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_GetCharBox(FPDF_TEXTPAGE text_page,
int index,
double* left,
double* right,
double* bottom,
double* top);
// Function: FPDFText_GetCharOrigin
// Get origin of a particular character.
// Parameters:
// text_page - Handle to a text page information structure.
// Returned by FPDFText_LoadPage function.
// index - Zero-based index of the character.
// x - Pointer to a double number receiving x coordinate of
// the character origin.
// y - Pointer to a double number receiving y coordinate of
// the character origin.
// Return Value:
// Whether the call succeeded. If false, x and y are unchanged.
// Comments:
// All positions are measured in PDF "user space".
//
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFText_GetCharOrigin(FPDF_TEXTPAGE text_page,
int index,
double* x,
double* y);
// Function: FPDFText_GetCharIndexAtPos
// Get the index of a character at or nearby a certain position on the
@ -131,11 +179,12 @@ DLLEXPORT void STDCALL FPDFText_GetCharBox(FPDF_TEXTPAGE text_page,
// be -1.
// If an error occurs, -3 will be returned.
//
DLLEXPORT int STDCALL FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page,
double x,
double y,
double xTolerance,
double yTolerance);
FPDF_EXPORT int FPDF_CALLCONV
FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page,
double x,
double y,
double xTolerance,
double yTolerance);
// Function: FPDFText_GetText
// Extract unicode text string from the page.
@ -154,10 +203,10 @@ DLLEXPORT int STDCALL FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page,
// Comments:
// This function ignores characters without unicode information.
//
DLLEXPORT int STDCALL FPDFText_GetText(FPDF_TEXTPAGE text_page,
int start_index,
int count,
unsigned short* result);
FPDF_EXPORT int FPDF_CALLCONV 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.
@ -177,9 +226,9 @@ DLLEXPORT int STDCALL FPDFText_GetText(FPDF_TEXTPAGE text_page,
// 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);
FPDF_EXPORT int FPDF_CALLCONV FPDFText_CountRects(FPDF_TEXTPAGE text_page,
int start_index,
int count);
// Function: FPDFText_GetRect
// Get a rectangular area from the result generated by
@ -197,14 +246,18 @@ DLLEXPORT int STDCALL FPDFText_CountRects(FPDF_TEXTPAGE text_page,
// bottom - Pointer to a double value receiving the rectangle
// bottom boundary.
// Return Value:
// None.
// On success, return TRUE and fill in |left|, |top|, |right|, and
// |bottom|. If |text_page| is invalid then return FALSE, and the out
// parameters remain unmodified. If |text_page| is valid but
// |rect_index| is out of bounds, then return FALSE and set the out
// parameters to 0.
//
DLLEXPORT void STDCALL FPDFText_GetRect(FPDF_TEXTPAGE text_page,
int rect_index,
double* left,
double* top,
double* right,
double* bottom);
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_GetRect(FPDF_TEXTPAGE text_page,
int rect_index,
double* left,
double* top,
double* right,
double* bottom);
// Function: FPDFText_GetBoundedText
// Extract unicode text within a rectangular boundary on the page.
@ -232,19 +285,22 @@ DLLEXPORT void STDCALL FPDFText_GetRect(FPDF_TEXTPAGE text_page,
// 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);
FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page,
double left,
double top,
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.
//
// If not set, it will not match case by default.
#define FPDF_MATCHCASE 0x00000001
// If not set, it will not match the whole word by default.
#define FPDF_MATCHWHOLEWORD 0x00000002
// If not set, it will skip past the current match to look for the next match.
#define FPDF_CONSECUTIVE 0x00000004
// Function: FPDFText_FindStart
// Start a search.
@ -258,10 +314,11 @@ DLLEXPORT int STDCALL FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page,
// 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);
FPDF_EXPORT FPDF_SCHHANDLE FPDF_CALLCONV
FPDFText_FindStart(FPDF_TEXTPAGE text_page,
FPDF_WIDESTRING findwhat,
unsigned long flags,
int start_index);
// Function: FPDFText_FindNext
// Search in the direction from page start to end.
@ -271,7 +328,7 @@ DLLEXPORT FPDF_SCHHANDLE STDCALL FPDFText_FindStart(FPDF_TEXTPAGE text_page,
// Return Value:
// Whether a match is found.
//
DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindNext(FPDF_SCHHANDLE handle);
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_FindNext(FPDF_SCHHANDLE handle);
// Function: FPDFText_FindPrev
// Search in the direction from page end to start.
@ -281,7 +338,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindNext(FPDF_SCHHANDLE handle);
// Return Value:
// Whether a match is found.
//
DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindPrev(FPDF_SCHHANDLE handle);
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_FindPrev(FPDF_SCHHANDLE handle);
// Function: FPDFText_GetSchResultIndex
// Get the starting character index of the search result.
@ -291,7 +348,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindPrev(FPDF_SCHHANDLE handle);
// Return Value:
// Index for the starting character.
//
DLLEXPORT int STDCALL FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle);
FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle);
// Function: FPDFText_GetSchCount
// Get the number of matched characters in the search result.
@ -301,7 +358,7 @@ DLLEXPORT int STDCALL FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle);
// Return Value:
// Number of matched characters.
//
DLLEXPORT int STDCALL FPDFText_GetSchCount(FPDF_SCHHANDLE handle);
FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetSchCount(FPDF_SCHHANDLE handle);
// Function: FPDFText_FindClose
// Release a search context.
@ -311,7 +368,7 @@ DLLEXPORT int STDCALL FPDFText_GetSchCount(FPDF_SCHHANDLE handle);
// Return Value:
// None.
//
DLLEXPORT void STDCALL FPDFText_FindClose(FPDF_SCHHANDLE handle);
FPDF_EXPORT void FPDF_CALLCONV FPDFText_FindClose(FPDF_SCHHANDLE handle);
// Function: FPDFLink_LoadWebLinks
// Prepare information about weblinks in a page.
@ -336,7 +393,8 @@ DLLEXPORT void STDCALL FPDFText_FindClose(FPDF_SCHHANDLE handle);
//
// FPDFLink_CloseWebLinks must be called to release resources.
//
DLLEXPORT FPDF_PAGELINK STDCALL FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page);
FPDF_EXPORT FPDF_PAGELINK FPDF_CALLCONV
FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page);
// Function: FPDFLink_CountWebLinks
// Count number of detected web links.
@ -345,7 +403,7 @@ DLLEXPORT FPDF_PAGELINK STDCALL FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page);
// Return Value:
// Number of detected web links.
//
DLLEXPORT int STDCALL FPDFLink_CountWebLinks(FPDF_PAGELINK link_page);
FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountWebLinks(FPDF_PAGELINK link_page);
// Function: FPDFLink_GetURL
// Fetch the URL information for a detected web link.
@ -366,10 +424,10 @@ DLLEXPORT int STDCALL FPDFLink_CountWebLinks(FPDF_PAGELINK link_page);
// If |link_index| does not correspond to a valid link, then the result
// is an empty string.
//
DLLEXPORT int STDCALL FPDFLink_GetURL(FPDF_PAGELINK link_page,
int link_index,
unsigned short* buffer,
int buflen);
FPDF_EXPORT int FPDF_CALLCONV 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.
@ -380,8 +438,8 @@ DLLEXPORT int STDCALL FPDFLink_GetURL(FPDF_PAGELINK link_page,
// Number of rectangular areas for the link. If |link_index| does
// not correspond to a valid link, then 0 is returned.
//
DLLEXPORT int STDCALL FPDFLink_CountRects(FPDF_PAGELINK link_page,
int link_index);
FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountRects(FPDF_PAGELINK link_page,
int link_index);
// Function: FPDFLink_GetRect
// Fetch the boundaries of a rectangle for a link.
@ -398,16 +456,18 @@ DLLEXPORT int STDCALL FPDFLink_CountRects(FPDF_PAGELINK link_page,
// bottom - Pointer to a double value receiving the rectangle
// bottom boundary.
// Return Value:
// None. If |link_index| does not correspond to a valid link, then
// |left|, |top|, |right|, and |bottom| remain unmodified.
// On success, return TRUE and fill in |left|, |top|, |right|, and
// |bottom|. If |link_page| is invalid or if |link_index| does not
// correspond to a valid link, then return FALSE, and the out
// parameters remain unmodified.
//
DLLEXPORT void STDCALL FPDFLink_GetRect(FPDF_PAGELINK link_page,
int link_index,
int rect_index,
double* left,
double* top,
double* right,
double* bottom);
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_GetRect(FPDF_PAGELINK link_page,
int link_index,
int rect_index,
double* left,
double* top,
double* right,
double* bottom);
// Function: FPDFLink_CloseWebLinks
// Release resources used by weblink feature.
@ -416,7 +476,7 @@ DLLEXPORT void STDCALL FPDFLink_GetRect(FPDF_PAGELINK link_page,
// Return Value:
// None.
//
DLLEXPORT void STDCALL FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page);
FPDF_EXPORT void FPDF_CALLCONV FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page);
#ifdef __cplusplus
}

View File

@ -14,102 +14,204 @@
extern "C" {
#endif
typedef void* FPDF_PAGEARCSAVER;
typedef void* FPDF_PAGEARCLOADER;
/**
* Set "MediaBox" entry to the page dictionary.
*
* page - Handle to a page.
* left - The left of the rectangle.
* bottom - The bottom of the rectangle.
* right - The right of the rectangle.
* top - The top of the rectangle.
*/
FPDF_EXPORT void FPDF_CALLCONV FPDFPage_SetMediaBox(FPDF_PAGE page,
float left,
float bottom,
float right,
float top);
/**
* 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.
*
* page - Handle to a page.
* left - The left of the rectangle.
* bottom - The bottom of the rectangle.
* right - The right of the rectangle.
* top - The top of the rectangle.
*/
FPDF_EXPORT void FPDF_CALLCONV FPDFPage_SetCropBox(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.
* @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.
* @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.
* @retval True if success,else fail.
*/
DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetCropBox(FPDF_PAGE page,
float* left,
float* bottom,
float* right,
float* top);
* Set "BleedBox" entry to the page dictionary.
*
* page - Handle to a page.
* left - The left of the rectangle.
* bottom - The bottom of the rectangle.
* right - The right of the rectangle.
* top - The top of the rectangle.
*/
FPDF_EXPORT void FPDF_CALLCONV FPDFPage_SetBleedBox(FPDF_PAGE page,
float left,
float bottom,
float right,
float top);
/**
* 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.
* @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);
* Set "TrimBox" entry to the page dictionary.
*
* page - Handle to a page.
* left - The left of the rectangle.
* bottom - The bottom of the rectangle.
* right - The right of the rectangle.
* top - The top of the rectangle.
*/
FPDF_EXPORT void FPDF_CALLCONV FPDFPage_SetTrimBox(FPDF_PAGE page,
float left,
float bottom,
float right,
float top);
/**
* 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.
* @retval None.
*/
DLLEXPORT void STDCALL
* Set "ArtBox" entry to the page dictionary.
*
* page - Handle to a page.
* left - The left of the rectangle.
* bottom - The bottom of the rectangle.
* right - The right of the rectangle.
* top - The top of the rectangle.
*/
FPDF_EXPORT void FPDF_CALLCONV FPDFPage_SetArtBox(FPDF_PAGE page,
float left,
float bottom,
float right,
float top);
/**
* Get "MediaBox" entry from the page dictionary.
*
* page - Handle to a page.
* left - Pointer to a float value receiving the left of the rectangle.
* bottom - Pointer to a float value receiving the bottom of the rectangle.
* right - Pointer to a float value receiving the right of the rectangle.
* top - Pointer to a float value receiving the top of the rectangle.
*
* On success, return true and write to the out parameters. Otherwise return
* false and leave the out parameters unmodified.
*/
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_GetMediaBox(FPDF_PAGE page,
float* left,
float* bottom,
float* right,
float* top);
/**
* Get "CropBox" entry from the page dictionary.
*
* page - Handle to a page.
* left - Pointer to a float value receiving the left of the rectangle.
* bottom - Pointer to a float value receiving the bottom of the rectangle.
* right - Pointer to a float value receiving the right of the rectangle.
* top - Pointer to a float value receiving the top of the rectangle.
*
* On success, return true and write to the out parameters. Otherwise return
* false and leave the out parameters unmodified.
*/
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_GetCropBox(FPDF_PAGE page,
float* left,
float* bottom,
float* right,
float* top);
/**
* Get "BleedBox" entry from the page dictionary.
*
* page - Handle to a page.
* left - Pointer to a float value receiving the left of the rectangle.
* bottom - Pointer to a float value receiving the bottom of the rectangle.
* right - Pointer to a float value receiving the right of the rectangle.
* top - Pointer to a float value receiving the top of the rectangle.
*
* On success, return true and write to the out parameters. Otherwise return
* false and leave the out parameters unmodified.
*/
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_GetBleedBox(FPDF_PAGE page,
float* left,
float* bottom,
float* right,
float* top);
/**
* Get "TrimBox" entry from the page dictionary.
*
* page - Handle to a page.
* left - Pointer to a float value receiving the left of the rectangle.
* bottom - Pointer to a float value receiving the bottom of the rectangle.
* right - Pointer to a float value receiving the right of the rectangle.
* top - Pointer to a float value receiving the top of the rectangle.
*
* On success, return true and write to the out parameters. Otherwise return
* false and leave the out parameters unmodified.
*/
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_GetTrimBox(FPDF_PAGE page,
float* left,
float* bottom,
float* right,
float* top);
/**
* Get "ArtBox" entry from the page dictionary.
*
* page - Handle to a page.
* left - Pointer to a float value receiving the left of the rectangle.
* bottom - Pointer to a float value receiving the bottom of the rectangle.
* right - Pointer to a float value receiving the right of the rectangle.
* top - Pointer to a float value receiving the top of the rectangle.
*
* On success, return true and write to the out parameters. Otherwise return
* false and leave the out parameters unmodified.
*/
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_GetArtBox(FPDF_PAGE page,
float* left,
float* bottom,
float* right,
float* top);
/**
* Apply transforms to |page|.
*
* If |matrix| is provided it will be applied to transform the page.
* If |clipRect| is provided it will be used to clip the resulting page.
* If neither |matrix| or |clipRect| are provided this method returns |false|.
* Returns |true| if transforms are applied.
*
* This function will transform the whole page, and would take effect to all the
* objects in the page.
*
* page - Page handle.
* matrix - Transform matrix.
* clipRect - Clipping rectangle.
*/
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFPage_TransFormWithClip(FPDF_PAGE page,
const FS_MATRIX* matrix,
const FS_RECTF* clipRect);
/**
* Transform (scale, rotate, shear, move) the clip path of page object.
* 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.
*/
FPDF_EXPORT void FPDF_CALLCONV
FPDFPageObj_TransformClipPath(FPDF_PAGEOBJECT page_object,
double a,
double b,
@ -119,40 +221,40 @@ FPDFPageObj_TransformClipPath(FPDF_PAGEOBJECT page_object,
double f);
/**
* Create a new clip path, with a rectangle inserted.
*
* @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.
* @retval a handle to the clip path.
*/
DLLEXPORT FPDF_CLIPPATH STDCALL FPDF_CreateClipPath(float left,
float bottom,
float right,
float top);
* Create a new clip path, with a rectangle inserted.
*
* Caller takes ownership of the returned FPDF_CLIPPATH. It should be freed with
* FPDF_DestroyClipPath().
*
* left - The left of the clip box.
* bottom - The bottom of the clip box.
* right - The right of the clip box.
* top - The top of the clip box.
*/
FPDF_EXPORT FPDF_CLIPPATH FPDF_CALLCONV FPDF_CreateClipPath(float left,
float bottom,
float right,
float top);
/**
* Destroy the clip path.
*
* @param[in] clipPath - A handle to the clip path.
* Destroy the clip path.
* @retval None.
*/
DLLEXPORT void STDCALL FPDF_DestroyClipPath(FPDF_CLIPPATH clipPath);
* Destroy the clip path.
*
* clipPath - A handle to the clip path. It will be invalid after this call.
*/
FPDF_EXPORT void FPDF_CALLCONV 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.
* @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.
*/
DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page,
FPDF_CLIPPATH clipPath);
* Clip the page content, the page content that outside the clipping region
* become invisible.
*
* 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.
*
* page - A page handle.
* clipPath - A handle to the clip path. (Does not take ownership.)
*/
FPDF_EXPORT void FPDF_CALLCONV FPDFPage_InsertClipPath(FPDF_PAGE page,
FPDF_CLIPPATH clipPath);
#ifdef __cplusplus
}

View File

@ -10,6 +10,8 @@
#ifndef PUBLIC_FPDFVIEW_H_
#define PUBLIC_FPDFVIEW_H_
#include <stddef.h>
#if defined(_WIN32) && !defined(__WINDOWS__)
#include <windows.h>
#endif
@ -20,28 +22,44 @@
#define PDF_USE_XFA
#endif // PDF_ENABLE_XFA
// PDF types
typedef void* FPDF_ACTION;
typedef void* FPDF_BITMAP;
typedef void* FPDF_BOOKMARK;
typedef void* FPDF_CLIPPATH;
typedef void* FPDF_DEST;
typedef void* FPDF_DOCUMENT;
typedef void* FPDF_FONT;
typedef void* FPDF_LINK;
typedef void* FPDF_PAGE;
typedef void* FPDF_PAGELINK;
typedef void* FPDF_PAGEOBJECT; // Page object(text, path, etc)
typedef void* FPDF_PAGERANGE;
typedef void* FPDF_RECORDER;
typedef void* FPDF_SCHHANDLE;
typedef void* FPDF_STRUCTELEMENT;
typedef void* FPDF_STRUCTTREE;
typedef void* FPDF_TEXTPAGE;
// PDF object types
#define FPDF_OBJECT_UNKNOWN 0
#define FPDF_OBJECT_BOOLEAN 1
#define FPDF_OBJECT_NUMBER 2
#define FPDF_OBJECT_STRING 3
#define FPDF_OBJECT_NAME 4
#define FPDF_OBJECT_ARRAY 5
#define FPDF_OBJECT_DICTIONARY 6
#define FPDF_OBJECT_STREAM 7
#define FPDF_OBJECT_NULLOBJ 8
#define FPDF_OBJECT_REFERENCE 9
// PDF types - use incomplete types for type safety.
typedef const struct fpdf_action_t__* FPDF_ACTION;
typedef struct fpdf_annotation_t__* FPDF_ANNOTATION;
typedef struct fpdf_attachment_t__* FPDF_ATTACHMENT;
typedef struct fpdf_bitmap_t__* FPDF_BITMAP;
typedef const struct fpdf_bookmark_t__* FPDF_BOOKMARK;
typedef struct fpdf_clippath_t__* FPDF_CLIPPATH;
typedef const struct fpdf_dest_t__* FPDF_DEST;
typedef struct fpdf_document_t__* FPDF_DOCUMENT;
typedef struct fpdf_font_t__* FPDF_FONT;
typedef struct fpdf_form_handle_t__* FPDF_FORMHANDLE;
typedef struct fpdf_link_t__* FPDF_LINK;
typedef struct fpdf_page_t__* FPDF_PAGE;
typedef struct fpdf_pagelink_t__* FPDF_PAGELINK;
typedef struct fpdf_pageobject_t__* FPDF_PAGEOBJECT; // (text, path, etc.)
typedef struct fpdf_pageobjectmark_t__* FPDF_PAGEOBJECTMARK;
typedef const struct fpdf_pagerange_t__* FPDF_PAGERANGE;
typedef const struct fpdf_pathsegment_t* FPDF_PATHSEGMENT;
typedef void* FPDF_RECORDER; // Passed into skia.
typedef struct fpdf_schhandle_t__* FPDF_SCHHANDLE;
typedef struct fpdf_structelement_t__* FPDF_STRUCTELEMENT;
typedef struct fpdf_structtree_t__* FPDF_STRUCTTREE;
typedef struct fpdf_textpage_t__* FPDF_TEXTPAGE;
#ifdef PDF_ENABLE_XFA
typedef void* FPDF_STRINGHANDLE;
typedef void* FPDF_WIDGET;
typedef struct fpdf_widget_t__* FPDF_WIDGET;
#endif // PDF_ENABLE_XFA
// Basic data types
@ -97,7 +115,14 @@ typedef struct _FPDF_BSTR {
// system wide string by yourself.
typedef const char* FPDF_STRING;
// Matrix for transformation.
// Matrix for transformation, in the form [a b c d e f], equivalent to:
// | a b 0 |
// | c d 0 |
// | e f 1 |
//
// Translation is performed with [1 0 0 1 tx ty].
// Scaling is performed with [sx 0 0 sy 0 0].
// See PDF Reference 1.7, 4.2.2 Common Transformations for more.
typedef struct _FS_MATRIX_ {
float a;
float b;
@ -122,13 +147,20 @@ typedef struct _FS_RECTF_ {
// Const Pointer to FS_RECTF structure.
typedef const FS_RECTF* FS_LPCRECTF;
// Annotation enums.
typedef int FPDF_ANNOTATION_SUBTYPE;
typedef int FPDF_ANNOT_APPEARANCEMODE;
// Dictionary value types.
typedef int FPDF_OBJECT_TYPE;
#if defined(_WIN32) && defined(FPDFSDK_EXPORTS)
// On Windows system, functions are exported in a DLL
#define DLLEXPORT __declspec(dllexport)
#define STDCALL __stdcall
#define FPDF_EXPORT __declspec(dllexport)
#define FPDF_CALLCONV __stdcall
#else
#define DLLEXPORT
#define STDCALL
#define FPDF_EXPORT
#define FPDF_CALLCONV
#endif
// Exported Functions
@ -145,7 +177,7 @@ extern "C" {
// Comments:
// Convenience function to call FPDF_InitLibraryWithConfig() for
// backwards comatibility purposes.
DLLEXPORT void STDCALL FPDF_InitLibrary();
FPDF_EXPORT void FPDF_CALLCONV FPDF_InitLibrary();
// Process-wide options for initializing the library.
typedef struct FPDF_LIBRARY_CONFIG_ {
@ -179,8 +211,8 @@ typedef struct FPDF_LIBRARY_CONFIG_ {
// Comments:
// You have to call this function before you can call any PDF
// processing functions.
DLLEXPORT void STDCALL FPDF_InitLibraryWithConfig(
const FPDF_LIBRARY_CONFIG* config);
FPDF_EXPORT void FPDF_CALLCONV
FPDF_InitLibraryWithConfig(const FPDF_LIBRARY_CONFIG* config);
// Function: FPDF_DestroyLibary
// Release all resources allocated by the FPDFSDK library.
@ -193,7 +225,7 @@ DLLEXPORT void STDCALL FPDF_InitLibraryWithConfig(
// the library.
// After this function is called, you should not call any PDF
// processing functions.
DLLEXPORT void STDCALL FPDF_DestroyLibrary();
FPDF_EXPORT void FPDF_CALLCONV FPDF_DestroyLibrary();
// Policy for accessing the local machine time.
#define FPDF_POLICY_MACHINETIME_ACCESS 0
@ -206,8 +238,8 @@ DLLEXPORT void STDCALL FPDF_DestroyLibrary();
// enable - True to enable, false to disable the policy.
// Return value:
// None.
DLLEXPORT void STDCALL FPDF_SetSandBoxPolicy(FPDF_DWORD policy,
FPDF_BOOL enable);
FPDF_EXPORT void FPDF_CALLCONV FPDF_SetSandBoxPolicy(FPDF_DWORD policy,
FPDF_BOOL enable);
#if defined(_WIN32)
#if defined(PDFIUM_PRINT_TEXT_WITH_GDI)
@ -225,7 +257,7 @@ typedef void (*PDFiumEnsureTypefaceCharactersAccessible)(const LOGFONT* font,
// func - A function pointer. See description above.
// Return value:
// None.
DLLEXPORT void STDCALL
FPDF_EXPORT void FPDF_CALLCONV
FPDF_SetTypefaceAccessibleFunc(PDFiumEnsureTypefaceCharactersAccessible func);
// Function: FPDF_SetPrintTextWithGDI
@ -235,21 +267,27 @@ FPDF_SetTypefaceAccessibleFunc(PDFiumEnsureTypefaceCharactersAccessible func);
// use_gdi - Set to true to enable printing text with GDI.
// Return value:
// None.
DLLEXPORT void STDCALL FPDF_SetPrintTextWithGDI(FPDF_BOOL use_gdi);
FPDF_EXPORT void FPDF_CALLCONV FPDF_SetPrintTextWithGDI(FPDF_BOOL use_gdi);
#endif // PDFIUM_PRINT_TEXT_WITH_GDI
// Function: FPDF_SetPrintPostscriptLevel
// Set postscript printing level when printing on Windows.
// Function: FPDF_SetPrintMode
// Set printing mode when printing on Windows.
// Experimental API.
// Parameters:
// postscript_level - 0 to disable postscript printing,
// 2 to print with postscript level 2,
// 3 to print with postscript level 3.
// All other values are invalid.
// mode - FPDF_PRINTMODE_EMF to output EMF (default)
// FPDF_PRINTMODE_TEXTONLY to output text only (for charstream
// devices)
// FPDF_PRINTMODE_POSTSCRIPT2 to output level 2 PostScript into
// EMF as a series of GDI comments.
// FPDF_PRINTMODE_POSTSCRIPT3 to output level 3 PostScript into
// EMF as a series of GDI comments.
// FPDF_PRINTMODE_POSTSCRIPT2_PASSTHROUGH to output level 2
// PostScript via ExtEscape() in PASSTHROUGH mode.
// FPDF_PRINTMODE_POSTSCRIPT3_PASSTHROUGH to output level 3
// PostScript via ExtEscape() in PASSTHROUGH mode.
// Return value:
// True if successful, false if unsucessful (typically invalid input).
DLLEXPORT FPDF_BOOL STDCALL
FPDF_SetPrintPostscriptLevel(FPDF_BOOL postscript_level);
// True if successful, false if unsuccessful (typically invalid input).
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_SetPrintMode(int mode);
#endif // defined(_WIN32)
// Function: FPDF_LoadDocument
@ -258,14 +296,21 @@ FPDF_SetPrintPostscriptLevel(FPDF_BOOL postscript_level);
// file_path - Path to the PDF file (including extension).
// password - A string used as the password for the PDF file.
// If no password is needed, empty or NULL can be used.
// See comments below regarding the encoding.
// Return value:
// A handle to the loaded document, or NULL on failure.
// Comments:
// Loaded document can be closed by FPDF_CloseDocument().
// If this function fails, you can use FPDF_GetLastError() to retrieve
// the reason why it failed.
DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path,
FPDF_BYTESTRING password);
//
// The encoding for |password| can be either UTF-8 or Latin-1. PDFs,
// depending on the security handler revision, will only accept one or
// the other encoding. If |password|'s encoding and the PDF's expected
// encoding do not match, FPDF_LoadDocument() will automatically
// convert |password| to the other encoding.
FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV
FPDF_LoadDocument(FPDF_STRING file_path, FPDF_BYTESTRING password);
// Function: FPDF_LoadMemDocument
// Open and load a PDF document from memory.
@ -281,13 +326,15 @@ DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path,
// The loaded document can be closed by FPDF_CloseDocument.
// If this function fails, you can use FPDF_GetLastError() to retrieve
// the reason why it failed.
//
// See the comments for FPDF_LoadDocument() regarding the encoding for
// |password|.
// Notes:
// If PDFium is built with the XFA module, the application should call
// FPDF_LoadXFA() function after the PDF document loaded to support XFA
// fields defined in the fpdfformfill.h file.
DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadMemDocument(const void* data_buf,
int size,
FPDF_BYTESTRING password);
FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV
FPDF_LoadMemDocument(const void* data_buf, int size, FPDF_BYTESTRING password);
// Structure for custom file access.
typedef struct {
@ -296,6 +343,7 @@ typedef struct {
// A function pointer for getting a block of data from a specific position.
// Position is specified by byte offset from the beginning of the file.
// The pointer to the buffer is never NULL and the size is never 0.
// The position and size will never go out of range of the file length.
// It may be possible for FPDFSDK to call this function multiple times for
// the same position.
@ -395,7 +443,8 @@ typedef struct _FPDF_FILEHANDLER {
FPDF_RESULT (*Truncate)(FPDF_LPVOID clientData, FPDF_DWORD size);
} FPDF_FILEHANDLER, *FPDF_LPFILEHANDLER;
#endif
#endif // PDF_ENABLE_XFA
// Function: FPDF_LoadCustomDocument
// Load PDF document from a custom access descriptor.
// Parameters:
@ -404,15 +453,19 @@ typedef struct _FPDF_FILEHANDLER {
// Return value:
// A handle to the loaded document, or NULL on failure.
// Comments:
// The application must keep the file resources valid until the PDF
// document is closed.
// The application must keep the file resources |pFileAccess| points to
// valid until the returned FPDF_DOCUMENT is closed. |pFileAccess|
// itself does not need to outlive the FPDF_DOCUMENT.
//
// The loaded document can be closed with FPDF_CloseDocument.
// The loaded document can be closed with FPDF_CloseDocument().
//
// See the comments for FPDF_LoadDocument() regarding the encoding for
// |password|.
// Notes:
// If PDFium is built with the XFA module, the application should call
// FPDF_LoadXFA() function after the PDF document loaded to support XFA
// fields defined in the fpdfformfill.h file.
DLLEXPORT FPDF_DOCUMENT STDCALL
FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV
FPDF_LoadCustomDocument(FPDF_FILEACCESS* pFileAccess, FPDF_BYTESTRING password);
// Function: FPDF_GetFileVersion
@ -426,8 +479,8 @@ FPDF_LoadCustomDocument(FPDF_FILEACCESS* pFileAccess, FPDF_BYTESTRING password);
// Comments:
// If the document was created by FPDF_CreateNewDocument,
// then this function will always fail.
DLLEXPORT FPDF_BOOL STDCALL FPDF_GetFileVersion(FPDF_DOCUMENT doc,
int* fileVersion);
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_GetFileVersion(FPDF_DOCUMENT doc,
int* fileVersion);
#define FPDF_ERR_SUCCESS 0 // No error.
#define FPDF_ERR_UNKNOWN 1 // Unknown error.
@ -450,7 +503,22 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_GetFileVersion(FPDF_DOCUMENT doc,
// Comments:
// If the previous SDK call succeeded, the return value of this
// function is not defined.
DLLEXPORT unsigned long STDCALL FPDF_GetLastError();
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDF_GetLastError();
// Function: FPDF_DocumentHasValidCrossReferenceTable
// Whether the document's cross reference table is valid or not.
// Experimental API.
// Parameters:
// document - Handle to a document. Returned by FPDF_LoadDocument.
// Return value:
// True if the PDF parser did not encounter problems parsing the cross
// reference table. False if the parser could not parse the cross
// reference table and the table had to be rebuild from other data
// within the document.
// Comments:
// The return value can change over time as the PDF parser evolves.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDF_DocumentHasValidCrossReferenceTable(FPDF_DOCUMENT document);
// Function: FPDF_GetDocPermission
// Get file permission flags of the document.
@ -460,7 +528,8 @@ DLLEXPORT unsigned long STDCALL FPDF_GetLastError();
// A 32-bit integer indicating permission flags. Please refer to the
// PDF Reference for detailed descriptions. If the document is not
// protected, 0xffffffff will be returned.
DLLEXPORT unsigned long STDCALL FPDF_GetDocPermissions(FPDF_DOCUMENT document);
FPDF_EXPORT unsigned long FPDF_CALLCONV
FPDF_GetDocPermissions(FPDF_DOCUMENT document);
// Function: FPDF_GetSecurityHandlerRevision
// Get the revision for the security handler.
@ -470,7 +539,8 @@ DLLEXPORT unsigned long STDCALL FPDF_GetDocPermissions(FPDF_DOCUMENT document);
// The security handler revision number. Please refer to the PDF
// Reference for a detailed description. If the document is not
// protected, -1 will be returned.
DLLEXPORT int STDCALL FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document);
FPDF_EXPORT int FPDF_CALLCONV
FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document);
// Function: FPDF_GetPageCount
// Get total number of pages in the document.
@ -478,7 +548,7 @@ DLLEXPORT int STDCALL FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document);
// document - Handle to document. Returned by FPDF_LoadDocument.
// Return value:
// Total number of pages in the document.
DLLEXPORT int STDCALL FPDF_GetPageCount(FPDF_DOCUMENT document);
FPDF_EXPORT int FPDF_CALLCONV FPDF_GetPageCount(FPDF_DOCUMENT document);
// Function: FPDF_LoadPage
// Load a page inside the document.
@ -490,8 +560,8 @@ DLLEXPORT int STDCALL FPDF_GetPageCount(FPDF_DOCUMENT document);
// Comments:
// The loaded page can be rendered to devices using FPDF_RenderPage.
// The loaded page can be closed using FPDF_ClosePage.
DLLEXPORT FPDF_PAGE STDCALL FPDF_LoadPage(FPDF_DOCUMENT document,
int page_index);
FPDF_EXPORT FPDF_PAGE FPDF_CALLCONV FPDF_LoadPage(FPDF_DOCUMENT document,
int page_index);
// Function: FPDF_GetPageWidth
// Get page width.
@ -500,7 +570,7 @@ DLLEXPORT FPDF_PAGE STDCALL FPDF_LoadPage(FPDF_DOCUMENT document,
// Return value:
// 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);
FPDF_EXPORT double FPDF_CALLCONV FPDF_GetPageWidth(FPDF_PAGE page);
// Function: FPDF_GetPageHeight
// Get page height.
@ -509,7 +579,20 @@ DLLEXPORT double STDCALL FPDF_GetPageWidth(FPDF_PAGE page);
// Return value:
// 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);
FPDF_EXPORT double FPDF_CALLCONV FPDF_GetPageHeight(FPDF_PAGE page);
// Experimental API.
// Function: FPDF_GetPageBoundingBox
// Get the bounding box of the page. This is the intersection between
// its media box and its crop box.
// Parameters:
// page - Handle to the page. Returned by FPDF_LoadPage.
// rect - Pointer to a rect to receive the page bounding box.
// On an error, |rect| won't be filled.
// Return value:
// True for success.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_GetPageBoundingBox(FPDF_PAGE page,
FS_RECTF* rect);
// Function: FPDF_GetPageSizeByIndex
// Get the size of the page at the given index.
@ -522,10 +605,10 @@ DLLEXPORT double STDCALL FPDF_GetPageHeight(FPDF_PAGE page);
// (in points).
// Return value:
// 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);
FPDF_EXPORT int FPDF_CALLCONV FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document,
int page_index,
double* width,
double* height);
// Page rendering flags. They can be combined with bit-wise OR.
//
@ -579,14 +662,14 @@ DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document,
// 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);
FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPage(HDC dc,
FPDF_PAGE page,
int start_x,
int start_y,
int size_x,
int size_y,
int rotate,
int flags);
#endif
// Function: FPDF_RenderPageBitmap
@ -594,7 +677,8 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc,
// Parameters:
// bitmap - Handle to the device independent bitmap (as the
// output buffer). The bitmap handle can be created
// by FPDFBitmap_Create.
// by FPDFBitmap_Create or retrieved from an image
// object by FPDFImageObj_GetBitmap.
// page - Handle to the page. Returned by FPDF_LoadPage
// start_x - Left pixel position of the display area in
// bitmap coordinates.
@ -614,41 +698,44 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc,
// widget and popup annotations.
// 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);
FPDF_EXPORT void FPDF_CALLCONV 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_RenderPageBitmapWithMatrix
// Render contents of a page to a device independent bitmap.
// Parameters:
// bitmap - Handle to the device independent bitmap (as the
// output buffer). The bitmap handle can be created
// by FPDFBitmap_Create.
// page - Handle to the page. Returned by FPDF_LoadPage
// matrix - The transform matrix.
// clipping - The rect to clip to.
// by FPDFBitmap_Create or retrieved by
// FPDFImageObj_GetBitmap.
// page - Handle to the page. Returned by FPDF_LoadPage.
// matrix - The transform matrix, which must be invertible.
// See PDF Reference 1.7, 4.2.2 Common Transformations.
// clipping - The rect to clip to in device coords.
// flags - 0 for normal display, or combination of the Page
// Rendering flags defined above. With the FPDF_ANNOT
// flag, it renders all annotations that do not require
// user-interaction, which are all annotations except
// widget and popup annotations.
// Return value:
// None.
DLLEXPORT void STDCALL FPDF_RenderPageBitmapWithMatrix(FPDF_BITMAP bitmap,
FPDF_PAGE page,
const FS_MATRIX* matrix,
const FS_RECTF* clipping,
int flags);
// None. Note that behavior is undefined if det of |matrix| is 0.
FPDF_EXPORT void FPDF_CALLCONV
FPDF_RenderPageBitmapWithMatrix(FPDF_BITMAP bitmap,
FPDF_PAGE page,
const FS_MATRIX* matrix,
const FS_RECTF* clipping,
int flags);
#ifdef _SKIA_SUPPORT_
DLLEXPORT FPDF_RECORDER STDCALL FPDF_RenderPageSkp(FPDF_PAGE page,
int size_x,
int size_y);
FPDF_EXPORT FPDF_RECORDER FPDF_CALLCONV FPDF_RenderPageSkp(FPDF_PAGE page,
int size_x,
int size_y);
#endif
// Function: FPDF_ClosePage
@ -657,7 +744,7 @@ DLLEXPORT FPDF_RECORDER STDCALL FPDF_RenderPageSkp(FPDF_PAGE page,
// page - Handle to the loaded page.
// Return value:
// None.
DLLEXPORT void STDCALL FPDF_ClosePage(FPDF_PAGE page);
FPDF_EXPORT void FPDF_CALLCONV FPDF_ClosePage(FPDF_PAGE page);
// Function: FPDF_CloseDocument
// Close a loaded PDF document.
@ -665,7 +752,7 @@ DLLEXPORT void STDCALL FPDF_ClosePage(FPDF_PAGE page);
// document - Handle to the loaded document.
// Return value:
// None.
DLLEXPORT void STDCALL FPDF_CloseDocument(FPDF_DOCUMENT document);
FPDF_EXPORT void FPDF_CALLCONV FPDF_CloseDocument(FPDF_DOCUMENT document);
// Function: FPDF_DeviceToPage
// Convert the screen coordinates of a point to page coordinates.
@ -689,7 +776,8 @@ DLLEXPORT void STDCALL FPDF_CloseDocument(FPDF_DOCUMENT document);
// page_y - A pointer to a double receiving the converted Y
// value in page coordinates.
// Return value:
// None.
// Returns true if the conversion succeeds, and |page_x| and |page_y|
// successfully receives the converted coordinates.
// Comments:
// The page coordinate system has its origin at the left-bottom corner
// of the page, with the X-axis on the bottom going to the right, and
@ -707,16 +795,16 @@ DLLEXPORT void STDCALL FPDF_CloseDocument(FPDF_DOCUMENT document);
// You must make sure the start_x, start_y, size_x, size_y
// and rotate parameters have exactly same values as you used in
// the 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);
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV 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);
// Function: FPDF_PageToDevice
// Convert the page coordinates of a point to screen coordinates.
@ -740,19 +828,20 @@ DLLEXPORT void STDCALL FPDF_DeviceToPage(FPDF_PAGE page,
// device_y - A pointer to an integer receiving the result Y
// value in device coordinates.
// Return value:
// None.
// Returns true if the conversion succeeds, and |device_x| and
// |device_y| successfully receives the converted coordinates.
// Comments:
// See comments for FPDF_DeviceToPage().
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);
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV 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);
// Function: FPDFBitmap_Create
// Create a device independent bitmap (FXDIB).
@ -783,11 +872,13 @@ DLLEXPORT void STDCALL FPDF_PageToDevice(FPDF_PAGE page,
// 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);
FPDF_EXPORT FPDF_BITMAP FPDF_CALLCONV FPDFBitmap_Create(int width,
int height,
int alpha);
// More DIB formats
// Unknown or unsupported format.
#define FPDFBitmap_Unknown 0
// Gray scale bitmap, one byte per pixel.
#define FPDFBitmap_Gray 1
// 3 bytes per pixel, byte order: blue, green, red.
@ -822,11 +913,23 @@ DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_Create(int width,
// If an external 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);
FPDF_EXPORT FPDF_BITMAP FPDF_CALLCONV FPDFBitmap_CreateEx(int width,
int height,
int format,
void* first_scan,
int stride);
// Function: FPDFBitmap_GetFormat
// Get the format of the bitmap.
// Parameters:
// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create
// or FPDFImageObj_GetBitmap.
// Return value:
// The format of the bitmap.
// Comments:
// Only formats supported by FPDFBitmap_CreateEx are supported by this
// function; see the list of such formats above.
FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetFormat(FPDF_BITMAP bitmap);
// Function: FPDFBitmap_FillRect
// Fill a rectangle in a bitmap.
@ -852,17 +955,18 @@ DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_CreateEx(int width,
// background will be replaced by the source color and the alpha.
//
// If the 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);
FPDF_EXPORT void FPDF_CALLCONV FPDFBitmap_FillRect(FPDF_BITMAP bitmap,
int left,
int top,
int width,
int height,
FPDF_DWORD color);
// Function: FPDFBitmap_GetBuffer
// Get data buffer of a bitmap.
// Parameters:
// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create.
// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create
// or FPDFImageObj_GetBitmap.
// Return value:
// The pointer to the first byte of the bitmap buffer.
// Comments:
@ -874,44 +978,48 @@ DLLEXPORT void STDCALL FPDFBitmap_FillRect(FPDF_BITMAP bitmap,
//
// The data is in BGRA format. Where the A maybe unused if alpha was
// not specified.
DLLEXPORT void* STDCALL FPDFBitmap_GetBuffer(FPDF_BITMAP bitmap);
FPDF_EXPORT void* FPDF_CALLCONV FPDFBitmap_GetBuffer(FPDF_BITMAP bitmap);
// Function: FPDFBitmap_GetWidth
// Get width of a bitmap.
// Parameters:
// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create.
// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create
// or FPDFImageObj_GetBitmap.
// Return value:
// The width of the bitmap in pixels.
DLLEXPORT int STDCALL FPDFBitmap_GetWidth(FPDF_BITMAP bitmap);
FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetWidth(FPDF_BITMAP bitmap);
// Function: FPDFBitmap_GetHeight
// Get height of a bitmap.
// Parameters:
// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create.
// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create
// or FPDFImageObj_GetBitmap.
// Return value:
// The height of the bitmap in pixels.
DLLEXPORT int STDCALL FPDFBitmap_GetHeight(FPDF_BITMAP bitmap);
FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetHeight(FPDF_BITMAP bitmap);
// Function: FPDFBitmap_GetStride
// Get number of bytes for each line in the bitmap buffer.
// Parameters:
// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create.
// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create
// or FPDFImageObj_GetBitmap.
// Return value:
// The number of bytes for each line in the bitmap buffer.
// Comments:
// The stride may be more than width * number of bytes per pixel.
DLLEXPORT int STDCALL FPDFBitmap_GetStride(FPDF_BITMAP bitmap);
FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetStride(FPDF_BITMAP bitmap);
// Function: FPDFBitmap_Destroy
// Destroy a bitmap and release all related buffers.
// Parameters:
// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create.
// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create
// or FPDFImageObj_GetBitmap.
// Return value:
// None.
// Comments:
// This function will not destroy any external buffers provided when
// the bitmap was created.
DLLEXPORT void STDCALL FPDFBitmap_Destroy(FPDF_BITMAP bitmap);
FPDF_EXPORT void FPDF_CALLCONV FPDFBitmap_Destroy(FPDF_BITMAP bitmap);
// Function: FPDF_VIEWERREF_GetPrintScaling
// Whether the PDF document prefers to be scaled or not.
@ -919,7 +1027,7 @@ DLLEXPORT void STDCALL FPDFBitmap_Destroy(FPDF_BITMAP bitmap);
// document - Handle to the loaded document.
// Return value:
// None.
DLLEXPORT FPDF_BOOL STDCALL
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDF_VIEWERREF_GetPrintScaling(FPDF_DOCUMENT document);
// Function: FPDF_VIEWERREF_GetNumCopies
@ -928,7 +1036,8 @@ FPDF_VIEWERREF_GetPrintScaling(FPDF_DOCUMENT 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);
FPDF_EXPORT int FPDF_CALLCONV
FPDF_VIEWERREF_GetNumCopies(FPDF_DOCUMENT document);
// Function: FPDF_VIEWERREF_GetPrintPageRange
// Page numbers to initialize print dialog box when file is printed.
@ -936,9 +1045,31 @@ DLLEXPORT int STDCALL FPDF_VIEWERREF_GetNumCopies(FPDF_DOCUMENT document);
// document - Handle to the loaded document.
// Return value:
// The print page range to be used for printing.
DLLEXPORT FPDF_PAGERANGE STDCALL
FPDF_EXPORT FPDF_PAGERANGE FPDF_CALLCONV
FPDF_VIEWERREF_GetPrintPageRange(FPDF_DOCUMENT document);
// Function: FPDF_VIEWERREF_GetPrintPageRangeCount
// Returns the number of elements in a FPDF_PAGERANGE.
// Experimental API.
// Parameters:
// pagerange - Handle to the page range.
// Return value:
// The number of elements in the page range. Returns 0 on error.
FPDF_EXPORT size_t FPDF_CALLCONV
FPDF_VIEWERREF_GetPrintPageRangeCount(FPDF_PAGERANGE pagerange);
// Function: FPDF_VIEWERREF_GetPrintPageRangeElement
// Returns an element from a FPDF_PAGERANGE.
// Experimental API.
// Parameters:
// pagerange - Handle to the page range.
// index - Index of the element.
// Return value:
// The value of the element in the page range at a given index.
// Returns -1 on error.
FPDF_EXPORT int FPDF_CALLCONV
FPDF_VIEWERREF_GetPrintPageRangeElement(FPDF_PAGERANGE pagerange, size_t index);
// Function: FPDF_VIEWERREF_GetDuplex
// Returns the paper handling option to be used when printing from
// the print dialog.
@ -946,7 +1077,7 @@ FPDF_VIEWERREF_GetPrintPageRange(FPDF_DOCUMENT document);
// document - Handle to the loaded document.
// Return value:
// The paper handling option to be used when printing.
DLLEXPORT FPDF_DUPLEXTYPE STDCALL
FPDF_EXPORT FPDF_DUPLEXTYPE FPDF_CALLCONV
FPDF_VIEWERREF_GetDuplex(FPDF_DOCUMENT document);
// Function: FPDF_VIEWERREF_GetName
@ -954,7 +1085,8 @@ FPDF_VIEWERREF_GetDuplex(FPDF_DOCUMENT document);
// be of type "name".
// Parameters:
// document - Handle to the loaded document.
// key - Name of the key in the viewer pref dictionary.
// key - Name of the key in the viewer pref dictionary,
// encoded in UTF-8.
// buffer - A string to write the contents of the key to.
// length - Length of the buffer.
// Return value:
@ -963,10 +1095,11 @@ FPDF_VIEWERREF_GetDuplex(FPDF_DOCUMENT document);
// as when |document| is invalid or |buffer| is NULL. If |length| is
// less than the returned length, or |buffer| is NULL, |buffer| will
// not be modified.
DLLEXPORT unsigned long STDCALL FPDF_VIEWERREF_GetName(FPDF_DOCUMENT document,
FPDF_BYTESTRING key,
char* buffer,
unsigned long length);
FPDF_EXPORT unsigned long FPDF_CALLCONV
FPDF_VIEWERREF_GetName(FPDF_DOCUMENT document,
FPDF_BYTESTRING key,
char* buffer,
unsigned long length);
// Function: FPDF_CountNamedDests
// Get the count of named destinations in the PDF document.
@ -974,7 +1107,8 @@ DLLEXPORT unsigned long STDCALL FPDF_VIEWERREF_GetName(FPDF_DOCUMENT document,
// document - Handle to a document
// Return value:
// The count of named destinations.
DLLEXPORT FPDF_DWORD STDCALL FPDF_CountNamedDests(FPDF_DOCUMENT document);
FPDF_EXPORT FPDF_DWORD FPDF_CALLCONV
FPDF_CountNamedDests(FPDF_DOCUMENT document);
// Function: FPDF_GetNamedDestByName
// Get a the destination handle for the given name.
@ -983,8 +1117,8 @@ DLLEXPORT FPDF_DWORD STDCALL FPDF_CountNamedDests(FPDF_DOCUMENT document);
// name - The name of a destination.
// Return value:
// The handle to the destination.
DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDestByName(FPDF_DOCUMENT document,
FPDF_BYTESTRING name);
FPDF_EXPORT FPDF_DEST FPDF_CALLCONV
FPDF_GetNamedDestByName(FPDF_DOCUMENT document, FPDF_BYTESTRING name);
// Function: FPDF_GetNamedDest
// Get the named destination by index.
@ -1007,25 +1141,38 @@ DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDestByName(FPDF_DOCUMENT document,
//
// 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);
FPDF_EXPORT FPDF_DEST FPDF_CALLCONV FPDF_GetNamedDest(FPDF_DOCUMENT document,
int index,
void* buffer,
long* buflen);
#ifdef PDF_ENABLE_V8
// Function: FPDF_GetRecommendedV8Flags
// Returns a space-separated string of command line flags that are
// recommended to be passed into V8 via V8::SetFlagsFromString()
// prior to initializing the PDFium library.
// Parameters:
// None.
// Return value:
// NUL-terminated string of the form "--flag1 --flag2".
// The caller must not attempt to modify or free the result.
FPDF_EXPORT const char* FPDF_CALLCONV FPDF_GetRecommendedV8Flags();
#endif // PDF_ENABLE_V8
#ifdef PDF_ENABLE_XFA
// Function: FPDF_BStr_Init
// Helper function to initialize a byte string.
DLLEXPORT FPDF_RESULT STDCALL FPDF_BStr_Init(FPDF_BSTR* str);
FPDF_EXPORT FPDF_RESULT FPDF_CALLCONV FPDF_BStr_Init(FPDF_BSTR* str);
// Function: FPDF_BStr_Set
// Helper function to set string data.
DLLEXPORT FPDF_RESULT STDCALL FPDF_BStr_Set(FPDF_BSTR* str,
FPDF_LPCSTR bstr,
int length);
FPDF_EXPORT FPDF_RESULT FPDF_CALLCONV FPDF_BStr_Set(FPDF_BSTR* str,
FPDF_LPCSTR bstr,
int length);
// Function: FPDF_BStr_Clear
// Helper function to clear a byte string.
DLLEXPORT FPDF_RESULT STDCALL FPDF_BStr_Clear(FPDF_BSTR* str);
FPDF_EXPORT FPDF_RESULT FPDF_CALLCONV FPDF_BStr_Clear(FPDF_BSTR* str);
#endif // PDF_ENABLE_XFA
#ifdef __cplusplus