pub struct Pdfium { /* private fields */ }
Expand description

A high-level idiomatic Rust wrapper around Pdfium, the C++ PDF library used by the Google Chromium project.

Implementations

Initializes the external pdfium library, loading it from the system libraries. Returns a new PdfiumLibraryBindings object that contains bindings to the functions exposed by the library, or an error if the library could not be loaded.

Initializes the external pdfium library, loading it from the given path. Returns a new PdfiumLibraryBindings object that contains bindings to the functions exposed by the library, or an error if the library could not be loaded.

Returns the name of the external Pdfium library on the currently running platform. On Linux and Android, this will be libpdfium.so or similar; on Windows, this will be pdfium.dll or similar; on MacOS, this will be libpdfium.dylib or similar.

Returns the name of the external Pdfium library on the currently running platform, prefixed with the given path string.

Creates a new Pdfium object from the given external pdfium library bindings.

Attempts to open a PdfDocument from the given file path.

If the document is password protected, the given password will be used to unlock it.

This function is not available when compiling to WASM. Either embed the bytes of the target PDF document directly into the compiled WASM module using the include_bytes!() macro, or use Javascript’s fetch() API to retrieve the bytes of the target document over the network, then load those bytes into Pdfium using the load_pdf_from_bytes() function.

Attempts to open a PdfDocument from the given byte buffer.

If the document is password protected, the given password will be used to unlock it.

Trait Implementations

Returns the “default value” for a type. Read more

Closes the external pdfium library, releasing held memory.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.