Skip to main content

convert_bytes

Function convert_bytes 

Source
pub fn convert_bytes(
    data: &[u8],
    file_name: &str,
    config: &ProcessingConfig,
) -> Result<PdfDocument, EdgePdfError>
Expand description

Convert a PDF from an in-memory byte slice to structured data.

This is the WASM-compatible entry point. It replaces all filesystem operations with in-memory equivalents and skips raster table OCR.

§Arguments

  • data — raw PDF bytes (e.g., from a Uint8Array in JavaScript)
  • file_name — display name (used in PdfDocument.file_name)
  • config — processing configuration

§Returns

Structured document or error.

§Errors

Returns an error if the PDF cannot be parsed or processed.