Skip to content

Commit

Permalink
Updage Pdfium version, uprade gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
makuke1234 committed Jun 6, 2022
1 parent f478f0b commit 9af56ad
Show file tree
Hide file tree
Showing 13 changed files with 310 additions and 46 deletions.
Binary file modified bin/libgcc_s_dw2-1.dll
Binary file not shown.
Binary file modified bin/libstdc++-6.dll
Binary file not shown.
Binary file modified bin/libwinpthread-1.dll
Binary file not shown.
Binary file modified bin/pdfium.dll
Binary file not shown.
12 changes: 12 additions & 0 deletions pdfium/include/fpdf_doc.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,18 @@ FPDFBookmark_GetTitle(FPDF_BOOKMARK bookmark,
void* buffer,
unsigned long buflen);

// Experimental API.
// Get the number of chlidren of |bookmark|.
//
// bookmark - handle to the bookmark.
//
// Returns a signed integer that represents the number of sub-items the given
// bookmark has. If the value is positive, child items shall be shown by default
// (open state). If the value is negative, child items shall be hidden by
// default (closed state). Please refer to PDF 32000-1:2008, Table 153.
// Returns 0 if the bookmark has no children or is invalid.
FPDF_EXPORT int FPDF_CALLCONV FPDFBookmark_GetCount(FPDF_BOOKMARK bookmark);

// Find the bookmark with |title| in |document|.
//
// document - handle to the document.
Expand Down
32 changes: 32 additions & 0 deletions pdfium/include/fpdf_edit.h
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,38 @@ FPDF_EXPORT FPDF_FONT FPDF_CALLCONV FPDFTextObj_GetFont(FPDF_PAGEOBJECT text);
FPDF_EXPORT unsigned long FPDF_CALLCONV
FPDFFont_GetFontName(FPDF_FONT font, char* buffer, unsigned long length);

// Experimental API.
// Get the decoded data from the |font| object.
//
// font - The handle to the font object. (Required)
// buffer - The address of a buffer that receives the font data.
// buflen - Length of the buffer.
// out_buflen - Pointer to variable that will receive the minimum buffer size
// to contain the font data. Not filled if the return value is
// FALSE. (Required)
//
// Returns TRUE on success. In which case, |out_buflen| will be filled, and
// |buffer| will be filled if it is large enough. Returns FALSE if any of the
// required parameters are null.
//
// The decoded data is the uncompressed font data. i.e. the raw font data after
// having all stream filters applied, when the data is embedded.
//
// If the font is not embedded, then this API will instead return the data for
// the substitution font it is using.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFFont_GetFontData(FPDF_FONT font,
uint8_t* buffer,
size_t buflen,
size_t* out_buflen);

// Experimental API.
// Get whether |font| is embedded or not.
//
// font - the handle to the font object.
//
// Returns 1 if the font is embedded, 0 if it not, and -1 on failure.
FPDF_EXPORT int FPDF_CALLCONV FPDFFont_GetIsEmbedded(FPDF_FONT font);

// Experimental API.
// Get the descriptor flags of a font.
//
Expand Down
12 changes: 9 additions & 3 deletions pdfium/include/fpdf_formfill.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,9 @@ typedef struct _IPDF_JsPlatform {
int length);

/*
* Pointer to FPDF_FORMFILLINFO interface.
* Pointer for embedder-specific data. Unused by PDFium, and despite
* its name, can be any data the embedder desires, though traditionally
* a FPDF_FORMFILLINFO interface.
*/
void* m_pFormfillinfo;

Expand Down Expand Up @@ -637,8 +639,9 @@ typedef struct _FPDF_FORMFILLINFO {
* Return value:
* None.
* Comments:
* See the named actions description of <<PDF Reference, version 1.7>>
* for more details.
* See ISO 32000-1:2008, section 12.6.4.11 for descriptions of the
* standard named actions, but note that a document may supply any
* name of its choosing.
*/
void (*FFI_ExecuteNamedAction)(struct _FPDF_FORMFILLINFO* pThis,
FPDF_BYTESTRING namedAction);
Expand Down Expand Up @@ -1480,6 +1483,9 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnKeyDown(FPDF_FORMHANDLE hHandle,
* flag values).
* Return Value:
* True indicates success; otherwise false.
* Comments:
* Currently unimplemented and always returns false. PDFium reserves this
* API and may implement it in the future on an as-needed basis.
*/
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnKeyUp(FPDF_FORMHANDLE hHandle,
FPDF_PAGE page,
Expand Down
244 changes: 239 additions & 5 deletions pdfium/include/fpdf_structtree.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ FPDF_StructTree_GetChildAtIndex(FPDF_STRUCTTREE struct_tree, int index);
// buffer - A buffer for output the alt text. May be NULL.
// buflen - The length of the buffer, in bytes. May be 0.
// Return value:
// The number of bytes in the title, including the terminating NUL
// The number of bytes in the alt text, including the terminating NUL
// character. The number of bytes is returned regardless of the
// |buffer| and |buflen| parameters.
// Comments:
Expand All @@ -76,6 +76,26 @@ FPDF_StructElement_GetAltText(FPDF_STRUCTELEMENT struct_element,
unsigned long buflen);

// Experimental API.
// Function: FPDF_StructElement_GetActualText
// Get the actual text for a given element.
// Parameters:
// struct_element - Handle to the struct element.
// buffer - A buffer for output the actual text. May be NULL.
// buflen - The length of the buffer, in bytes. May be 0.
// Return value:
// The number of bytes in the actual text, including the terminating
// NUL character. The number of bytes is returned regardless of the
// |buffer| and |buflen| parameters.
// Comments:
// Regardless of the platform, the |buffer| is always in UTF-16LE
// encoding. The string is terminated by a UTF16 NUL character. If
// |buflen| is less than the required length, or |buffer| is NULL,
// |buffer| will not be modified.
FPDF_EXPORT unsigned long FPDF_CALLCONV
FPDF_StructElement_GetActualText(FPDF_STRUCTELEMENT struct_element,
void* buffer,
unsigned long buflen);

// Function: FPDF_StructElement_GetID
// Get the ID for a given element.
// Parameters:
Expand Down Expand Up @@ -154,8 +174,8 @@ FPDF_StructElement_GetMarkedContentID(FPDF_STRUCTELEMENT struct_element);
// Get the type (/S) for a given element.
// Parameters:
// struct_element - Handle to the struct element.
// buffer - A buffer for output. May be NULL.
// buflen - The length of the buffer, in bytes. May be 0.
// buffer - A buffer for output. May be NULL.
// buflen - The length of the buffer, in bytes. May be 0.
// Return value:
// The number of bytes in the type, including the terminating NUL
// character. The number of bytes is returned regardless of the
Expand All @@ -170,6 +190,27 @@ FPDF_StructElement_GetType(FPDF_STRUCTELEMENT struct_element,
void* buffer,
unsigned long buflen);

// Experimental API.
// Function: FPDF_StructElement_GetObjType
// Get the object type (/Type) for a given element.
// Parameters:
// struct_element - Handle to the struct element.
// buffer - A buffer for output. May be NULL.
// buflen - The length of the buffer, in bytes. May be 0.
// Return value:
// The number of bytes in the object type, including the terminating
// NUL character. The number of bytes is returned regardless of the
// |buffer| and |buflen| parameters.
// Comments:
// Regardless of the platform, the |buffer| is always in UTF-16LE
// encoding. The string is terminated by a UTF16 NUL character. If
// |buflen| is less than the required length, or |buffer| is NULL,
// |buffer| will not be modified.
FPDF_EXPORT unsigned long FPDF_CALLCONV
FPDF_StructElement_GetObjType(FPDF_STRUCTELEMENT struct_element,
void* buffer,
unsigned long buflen);

// Function: FPDF_StructElement_GetTitle
// Get the title (/T) for a given element.
// Parameters:
Expand Down Expand Up @@ -202,8 +243,8 @@ FPDF_StructElement_CountChildren(FPDF_STRUCTELEMENT struct_element);
// Function: FPDF_StructElement_GetChildAtIndex
// Get a child in the structure element.
// Parameters:
// struct_tree - Handle to the struct element.
// index - The index for the child, 0-based.
// struct_element - Handle to the struct element.
// index - The index for the child, 0-based.
// Return value:
// The child at the n-th index or NULL on error.
// Comments:
Expand All @@ -213,6 +254,199 @@ FPDF_EXPORT FPDF_STRUCTELEMENT FPDF_CALLCONV
FPDF_StructElement_GetChildAtIndex(FPDF_STRUCTELEMENT struct_element,
int index);

// Experimental API.
// Function: FPDF_StructElement_GetParent
// Get the parent of the structure element.
// Parameters:
// struct_element - Handle to the struct element.
// Return value:
// The parent structure element or NULL on error.
// Comments:
// If structure element is StructTreeRoot, then this function will
// return NULL.
FPDF_EXPORT FPDF_STRUCTELEMENT FPDF_CALLCONV
FPDF_StructElement_GetParent(FPDF_STRUCTELEMENT struct_element);

// Function: FPDF_StructElement_GetAttributeCount
// Count the number of attributes for the structure element.
// Parameters:
// struct_element - Handle to the struct element.
// Return value:
// The number of attributes, or -1 on error.
FPDF_EXPORT int FPDF_CALLCONV
FPDF_StructElement_GetAttributeCount(FPDF_STRUCTELEMENT struct_element);

// Experimental API.
// Function: FPDF_StructElement_GetAttributeAtIndex
// Get an attribute object in the structure element.
// Parameters:
// struct_element - Handle to the struct element.
// index - The index for the attribute object, 0-based.
// Return value:
// The attribute object at the n-th index or NULL on error.
// Comments:
// If the attribute object exists but is not a dict, then this
// function will return NULL. This will also return NULL for out of
// bounds indices.
FPDF_EXPORT FPDF_STRUCTELEMENT_ATTR FPDF_CALLCONV
FPDF_StructElement_GetAttributeAtIndex(FPDF_STRUCTELEMENT struct_element, int index);

// Experimental API.
// Function: FPDF_StructElement_Attr_GetCount
// Count the number of attributes in a structure element attribute map.
// Parameters:
// struct_attribute - Handle to the struct element attribute.
// Return value:
// The number of attributes, or -1 on error.
FPDF_EXPORT int FPDF_CALLCONV
FPDF_StructElement_Attr_GetCount(FPDF_STRUCTELEMENT_ATTR struct_attribute);


// Experimental API.
// Function: FPDF_StructElement_Attr_GetName
// Get the name of an attribute in a structure element attribute map.
// Parameters:
// struct_attribute - Handle to the struct element attribute.
// index - The index of attribute in the map.
// buffer - A buffer for output. May be NULL. This is only
// modified if |buflen| is longer than the length
// of the key. Optional, pass null to just
// retrieve the size of the buffer needed.
// buflen - The length of the buffer.
// out_buflen - A pointer to variable that will receive the
// minimum buffer size to contain the key. Not
// filled if FALSE is returned.
// Return value:
// TRUE if the operation was successful, FALSE otherwise.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDF_StructElement_Attr_GetName(FPDF_STRUCTELEMENT_ATTR struct_attribute,
int index,
void* buffer,
unsigned long buflen,
unsigned long* out_buflen);

// Experimental API.
// Function: FPDF_StructElement_Attr_GetType
// Get the type of an attribute in a structure element attribute map.
// Parameters:
// struct_attribute - Handle to the struct element attribute.
// name - The attribute name.
// Return value:
// Returns the type of the value, or FPDF_OBJECT_UNKNOWN in case of
// failure.
FPDF_EXPORT FPDF_OBJECT_TYPE FPDF_CALLCONV
FPDF_StructElement_Attr_GetType(FPDF_STRUCTELEMENT_ATTR struct_attribute,
FPDF_BYTESTRING name);

// Experimental API.
// Function: FPDF_StructElement_Attr_GetBooleanValue
// Get the value of a boolean attribute in an attribute map by name as
// FPDF_BOOL. FPDF_StructElement_Attr_GetType() should have returned
// FPDF_OBJECT_BOOLEAN for this property.
// Parameters:
// struct_attribute - Handle to the struct element attribute.
// name - The attribute name.
// out_value - A pointer to variable that will receive the
// value. Not filled if false is returned.
// Return value:
// Returns TRUE if the name maps to a boolean value, FALSE otherwise.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDF_StructElement_Attr_GetBooleanValue(
FPDF_STRUCTELEMENT_ATTR struct_attribute,
FPDF_BYTESTRING name,
FPDF_BOOL* out_value);

// Experimental API.
// Function: FPDF_StructElement_Attr_GetNumberValue
// Get the value of a number attribute in an attribute map by name as
// float. FPDF_StructElement_Attr_GetType() should have returned
// FPDF_OBJECT_NUMBER for this property.
// Parameters:
// struct_attribute - Handle to the struct element attribute.
// name - The attribute name.
// out_value - A pointer to variable that will receive the
// value. Not filled if false is returned.
// Return value:
// Returns TRUE if the name maps to a number value, FALSE otherwise.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDF_StructElement_Attr_GetNumberValue(FPDF_STRUCTELEMENT_ATTR struct_attribute,
FPDF_BYTESTRING name,
float* out_value);

// Experimental API.
// Function: FPDF_StructElement_Attr_GetStringValue
// Get the value of a string attribute in an attribute map by name as
// string. FPDF_StructElement_Attr_GetType() should have returned
// FPDF_OBJECT_STRING or FPDF_OBJECT_NAME for this property.
// Parameters:
// struct_attribute - Handle to the struct element attribute.
// name - The attribute name.
// buffer - A buffer for holding the returned key in
// UTF-16LE. This is only modified if |buflen| is
// longer than the length of the key. Optional,
// pass null to just retrieve the size of the
// buffer needed.
// buflen - The length of the buffer.
// out_buflen - A pointer to variable that will receive the
// minimum buffer size to contain the key. Not
// filled if FALSE is returned.
// Return value:
// Returns TRUE if the name maps to a string value, FALSE otherwise.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDF_StructElement_Attr_GetStringValue(FPDF_STRUCTELEMENT_ATTR struct_attribute,
FPDF_BYTESTRING name,
void* buffer,
unsigned long buflen,
unsigned long* out_buflen);

// Experimental API.
// Function: FPDF_StructElement_Attr_GetBlobValue
// Get the value of a blob attribute in an attribute map by name as
// string.
// Parameters:
// struct_attribute - Handle to the struct element attribute.
// name - The attribute name.
// buffer - A buffer for holding the returned value. This
// is only modified if |buflen| is at least as
// long as the length of the value. Optional, pass
// null to just retrieve the size of the buffer
// needed.
// buflen - The length of the buffer.
// out_buflen - A pointer to variable that will receive the
// minimum buffer size to contain the key. Not
// filled if FALSE is returned.
// Return value:
// Returns TRUE if the name maps to a string value, FALSE otherwise.
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDF_StructElement_Attr_GetBlobValue(FPDF_STRUCTELEMENT_ATTR struct_attribute,
FPDF_BYTESTRING name,
void* buffer,
unsigned long buflen,
unsigned long* out_buflen);

// Experimental API.
// Function: FPDF_StructElement_GetMarkedContentIdCount
// Get the count of marked content ids for a given element.
// Parameters:
// struct_element - Handle to the struct element.
// Return value:
// The count of marked content ids or -1 if none exists.
FPDF_EXPORT int FPDF_CALLCONV
FPDF_StructElement_GetMarkedContentIdCount(FPDF_STRUCTELEMENT struct_element);

// Experimental API.
// Function: FPDF_StructElement_GetMarkedContentIdAtIndex
// Get the marked content id at a given index for a given element.
// Parameters:
// struct_element - Handle to the struct element.
// index - The index of the marked content id, 0-based.
// Return value:
// The marked content ID of the element. If no ID exists, returns
// -1.
FPDF_EXPORT int FPDF_CALLCONV
FPDF_StructElement_GetMarkedContentIdAtIndex(FPDF_STRUCTELEMENT struct_element,
int index);

#ifdef __cplusplus
} // extern "C"
#endif
Expand Down
4 changes: 4 additions & 0 deletions pdfium/include/fpdf_sysfontinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@
#define FXFONT_HANGEUL_CHARSET 129
#define FXFONT_GB2312_CHARSET 134
#define FXFONT_CHINESEBIG5_CHARSET 136
#define FXFONT_GREEK_CHARSET 161
#define FXFONT_VIETNAMESE_CHARSET 163
#define FXFONT_HEBREW_CHARSET 177
#define FXFONT_ARABIC_CHARSET 178
#define FXFONT_CYRILLIC_CHARSET 204
#define FXFONT_THAI_CHARSET 222
#define FXFONT_EASTERNEUROPEAN_CHARSET 238

/* Font pitch and family flags */
Expand Down
Loading

0 comments on commit 9af56ad

Please sign in to comment.