Skip to main content

load_pdf_from_bytes

Function load_pdf_from_bytes 

Source
pub fn load_pdf_from_bytes(
    data: &[u8],
    _password: Option<&str>,
) -> Result<RawPdfDocument, EdgePdfError>
Expand description

Load a PDF from an in-memory byte slice.

Uses lopdf’s Document::load_mem() which parses PDF from &[u8]. This is the WASM-compatible loader — no filesystem access required.

§Arguments

  • data — raw PDF bytes
  • _password — optional decryption password (not yet implemented)

§Errors

Returns EdgePdfError::LoadError if the bytes cannot be parsed as PDF.