Cargo Features

[dependencies]
pdfium-render = { version = "0.8.25", default-features = false, features = ["image", "bindings", "static", "thread_safe", "libc++", "sync", "paragraph", "flatten", "pdfium_latest", "pdfium_future", "pdfium_6666", "pdfium_6611", "pdfium_6569", "pdfium_6555", "pdfium_6490", "pdfium_6337", "pdfium_6295", "pdfium_6124", "pdfium_6084", "pdfium_6043", "pdfium_6015", "pdfium_5961", "pdfium_use_win32", "pdfium_use_skia", "pdfium_enable_xfa", "pdfium_enable_v8"] }
default = image, pdfium_latest, thread_safe

These default features are set whenever pdfium-render is added without default-features = false somewhere in the dependency tree.

image default

Enables image

DynamicImage trait definitions changed between 0.23.14 and 0.24.0; we use trait from version 0.24.0 and later.

Affects common::PdfPageObjectsCommon.create_image_object

bindings build

Enables bindgen <=0.69.4

Bindgen 0.70.0 and later cause build failures when compiling to WASM. For more details, see:

static libc++? libstdc++?
thread_safe default sync?
libstdc++ libc++ = static
sync = thread_safe
paragraph

Affects page::paragraph

flatten
pdfium_latest default = pdfium_6666

PdfiumLibraryBindings supports pinning its API definitions to a specific Pdfium release. This allows pdfium-render consumers to safely upgrade their pdfium-render dependency without having to simultaneously upgrade their Pdfium dependency.

By default, pdfium-render attempts to bind against the latest released version of the Pdfium API. To explicitly bind against an older version, select one of the feature flags below when taking pdfium-render as a dependency in your project's Cargo.toml.

pdfium_future = pdfium_enable_v8, pdfium_enable_xfa, pdfium_use_skia

Affects bindings::PdfiumLibraryBindings.FPDFBitmap_FillRect, bindings::PdfiumLibraryBindings.FPDFFont_GetBaseFontName, bindings::PdfiumLibraryBindings.FPDFFont_GetFamilyName, bindings::PdfiumLibraryBindings.FPDFCatalog_SetLanguage, bindings::PdfiumLibraryBindings.FPDFText_GetTextObject, bindings::PdfiumLibraryBindings.FPDFPageObj_TransformF, bindings::PdfiumLibraryBindings.FPDFPageObj_GetMarkedContentID, bindings::PdfiumLibraryBindings.FPDF_GetDefaultTTFMapCount, bindings::PdfiumLibraryBindings.FPDF_GetDefaultTTFMapEntry, bindings::PdfiumLibraryBindings.FPDFAnnot_GetFontColor, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetType, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBooleanValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetNumberValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetStringValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBlobValue

pdfium_6666 pdfium_latest

Affects bindings::PdfiumLibraryBindings.FPDFBitmap_FillRect, bindings::PdfiumLibraryBindings.FPDFFont_GetBaseFontName, bindings::PdfiumLibraryBindings.FPDFFont_GetFamilyName, bindings::PdfiumLibraryBindings.FPDFCatalog_SetLanguage, bindings::PdfiumLibraryBindings.FPDFText_GetTextObject, bindings::PdfiumLibraryBindings.FPDFPageObj_TransformF, bindings::PdfiumLibraryBindings.FPDFPageObj_GetMarkedContentID, bindings::PdfiumLibraryBindings.FPDF_GetDefaultTTFMapCount, bindings::PdfiumLibraryBindings.FPDF_GetDefaultTTFMapEntry, bindings::PdfiumLibraryBindings.FPDFAnnot_GetFontColor, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetType, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBooleanValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetNumberValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetStringValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBlobValue

pdfium_6611

Affects bindings::PdfiumLibraryBindings.FPDFFont_GetFamilyName, bindings::PdfiumLibraryBindings.FPDFText_GetTextObject, bindings::PdfiumLibraryBindings.FPDFPageObj_TransformF, bindings::PdfiumLibraryBindings.FPDFPageObj_GetMarkedContentID, bindings::PdfiumLibraryBindings.FPDF_GetDefaultTTFMapCount, bindings::PdfiumLibraryBindings.FPDF_GetDefaultTTFMapEntry, bindings::PdfiumLibraryBindings.FPDFAnnot_GetFontColor, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetType, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBooleanValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetNumberValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetStringValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBlobValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_CountChildren, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetChildAtIndex, bindings::PdfiumLibraryBindings.FPDFAnnot_GetFileAttachment

pdfium_6569

Affects bindings::PdfiumLibraryBindings.FPDF_GetDefaultTTFMapCount, bindings::PdfiumLibraryBindings.FPDF_GetDefaultTTFMapEntry, bindings::PdfiumLibraryBindings.FPDFAnnot_GetFontColor, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetType, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBooleanValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetNumberValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetStringValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBlobValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_CountChildren, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetChildAtIndex, bindings::PdfiumLibraryBindings.FPDFAnnot_GetFileAttachment, bindings::PdfiumLibraryBindings.FPDFAnnot_AddFileAttachment, bindings::PdfiumLibraryBindings.FPDFAnnot_AddFileAttachment_str, bindings::PdfiumLibraryBindings.FPDF_GetDocUserPermissions, bindings::PdfiumLibraryBindings.FPDFText_LoadCidType2Font

pdfium_6555

Affects bindings::PdfiumLibraryBindings.FPDFAnnot_GetFontColor, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetType, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBooleanValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetNumberValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetStringValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBlobValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_CountChildren, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetChildAtIndex, bindings::PdfiumLibraryBindings.FPDFAnnot_GetFileAttachment, bindings::PdfiumLibraryBindings.FPDFAnnot_AddFileAttachment, bindings::PdfiumLibraryBindings.FPDFAnnot_AddFileAttachment_str, bindings::PdfiumLibraryBindings.FPDF_GetDocUserPermissions, bindings::PdfiumLibraryBindings.FPDFText_LoadCidType2Font, bindings::PdfiumLibraryBindings.FPDF_StructElement_GetChildMarkedContentID, bindings::PdfiumLibraryBindings.FPDFText_GetTextRenderMode

pdfium_6490

Affects bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetType, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBooleanValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetNumberValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetStringValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBlobValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_CountChildren, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetChildAtIndex, bindings::PdfiumLibraryBindings.FPDFAnnot_GetFileAttachment, bindings::PdfiumLibraryBindings.FPDFAnnot_AddFileAttachment, bindings::PdfiumLibraryBindings.FPDFAnnot_AddFileAttachment_str, bindings::PdfiumLibraryBindings.FPDF_GetDocUserPermissions, bindings::PdfiumLibraryBindings.FPDFText_LoadCidType2Font, bindings::PdfiumLibraryBindings.FPDF_StructElement_GetChildMarkedContentID, bindings::PdfiumLibraryBindings.FPDFText_GetTextRenderMode, bindings::PdfiumLibraryBindings.FPDFFont_GetFontName

pdfium_6406 pdfium_6337

Affects bindings::PdfiumLibraryBindings.FPDFAnnot_GetFileAttachment, bindings::PdfiumLibraryBindings.FPDFAnnot_AddFileAttachment, bindings::PdfiumLibraryBindings.FPDFAnnot_AddFileAttachment_str, bindings::PdfiumLibraryBindings.FPDF_GetDocUserPermissions, bindings::PdfiumLibraryBindings.FPDFText_LoadCidType2Font, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetType, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBooleanValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetNumberValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetStringValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBlobValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_GetChildMarkedContentID, bindings::PdfiumLibraryBindings.FPDFText_GetTextRenderMode, bindings::PdfiumLibraryBindings.FPDFFont_GetFontName, bindings::PdfiumLibraryBindings.FPDF_MovePages, bindings::PdfiumLibraryBindings.FPDFBitmap_FillRect, bindings::PdfiumLibraryBindings.FPDFText_IsHyphen

pdfium_6295

Affects bindings::PdfiumLibraryBindings.FPDF_GetDocUserPermissions, bindings::PdfiumLibraryBindings.FPDFText_LoadCidType2Font, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetType, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBooleanValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetNumberValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetStringValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBlobValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_GetChildMarkedContentID, bindings::PdfiumLibraryBindings.FPDFText_GetTextRenderMode, bindings::PdfiumLibraryBindings.FPDFFont_GetFontName, bindings::PdfiumLibraryBindings.FPDF_MovePages, bindings::PdfiumLibraryBindings.FPDFBitmap_FillRect, bindings::PdfiumLibraryBindings.FPDFText_IsHyphen

pdfium_6259 pdfium_6164 pdfium_6124

Affects bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetType, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBooleanValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetNumberValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetStringValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBlobValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_GetChildMarkedContentID, bindings::PdfiumLibraryBindings.FPDFText_GetTextRenderMode, bindings::PdfiumLibraryBindings.FPDFFont_GetFontName, bindings::PdfiumLibraryBindings.FPDF_MovePages, bindings::PdfiumLibraryBindings.FPDFBitmap_FillRect, bindings::PdfiumLibraryBindings.FPDFText_IsHyphen

pdfium_6110 pdfium_6084

Affects bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetType, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBooleanValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetNumberValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetStringValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBlobValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_GetChildMarkedContentID, bindings::PdfiumLibraryBindings.FPDFText_GetTextRenderMode, bindings::PdfiumLibraryBindings.FPDFFont_GetFontName, bindings::PdfiumLibraryBindings.FPDF_MovePages, bindings::PdfiumLibraryBindings.FPDFBitmap_FillRect, bindings::PdfiumLibraryBindings.FPDFText_IsHyphen

pdfium_6043

Affects bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetType, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBooleanValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetNumberValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetStringValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBlobValue, bindings::PdfiumLibraryBindings.FPDFText_GetTextRenderMode, bindings::PdfiumLibraryBindings.FPDFFont_GetFontName, bindings::PdfiumLibraryBindings.FPDF_MovePages, bindings::PdfiumLibraryBindings.FPDFBitmap_FillRect, bindings::PdfiumLibraryBindings.FPDFText_IsHyphen

pdfium_6015

Affects bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetType, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBooleanValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetNumberValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetStringValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBlobValue, bindings::PdfiumLibraryBindings.FPDFText_GetTextRenderMode, bindings::PdfiumLibraryBindings.FPDFFont_GetFontName, bindings::PdfiumLibraryBindings.FPDFBitmap_FillRect, bindings::PdfiumLibraryBindings.FPDFText_IsHyphen

pdfium_5961

Affects bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetType, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBooleanValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetNumberValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetStringValue, bindings::PdfiumLibraryBindings.FPDF_StructElement_Attr_GetBlobValue, bindings::PdfiumLibraryBindings.FPDFText_GetTextRenderMode, bindings::PdfiumLibraryBindings.FPDFFont_GetFontName, bindings::PdfiumLibraryBindings.FPDFBitmap_FillRect

pdfium_use_win32

Certain Pdfium API functions are only made available when compile time flags are set when the Pdfium binary is compiled. The features below make these functions available in PdfiumLibraryBindings. They correspond to the Pdfium compile time flags _WIN32, PDF_USE_SKIA, PDF_ENABLE_XFA, and PDF_ENABLE_V8.

Enables windows

Affects bindings::PdfiumLibraryBindings.FPDF_SetPrintMode, bindings::PdfiumLibraryBindings.FPDF_RenderPage

pdfium_use_skia pdfium_future?

Affects bindings::PdfiumLibraryBindings.FPDF_RenderPageSkia, bindings::PdfiumLibraryBindings.FPDF_FFLDrawSkia

pdfium_enable_xfa pdfium_future?

Affects bindings::PdfiumLibraryBindings.FPDF_GetXFAPacketCount, bindings::PdfiumLibraryBindings.FPDF_GetXFAPacketName, bindings::PdfiumLibraryBindings.FPDF_GetXFAPacketContent, bindings::PdfiumLibraryBindings.FPDF_BStr_Init, bindings::PdfiumLibraryBindings.FPDF_BStr_Set, bindings::PdfiumLibraryBindings.FPDF_BStr_Clear

pdfium_enable_v8 pdfium_future?

Affects bindings::PdfiumLibraryBindings.FPDF_GetRecommendedV8Flags, bindings::PdfiumLibraryBindings.FPDF_GetArrayBufferAllocatorSharedInstance