Introduction
What @omsimos/pdf-raster is for, what it returns, and where it fits in backend and document-processing workflows.
Single responsibility
@omsimos/pdf-raster converts PDF pages into image buffers with a single
native API.
@omsimos/pdf-raster is a native server-side library for turning PDFs into
page images quickly.
It fits cleanly anywhere you need page images instead of PDF bytes:
Start with a PDF from disk, object storage, an upload, or another API.
Use @omsimos/pdf-raster to render the document into page images.
Use the output in previews, background jobs, OCR flows, VLM prompts, or any other downstream image workflow.
What the library does
One public API
The package centers on convert(input, options?).
Native rendering
Rendering is handled through Rust, napi-rs, and PDFium.
Lossless output
Each page comes back as an image Buffer with dimensions and DPI metadata.
What it intentionally does not do
- no browser runtime support
- no document editing, annotation, or extraction APIs
That narrow API keeps the package easy to reason about. You can use the output for previews, storage, background jobs, OCR, VLM prompts, or other downstream processing without changing how the conversion layer works.
Output shape
Each page is returned as:
type ConvertedPage = {
pageIndex: number;
data: Buffer;
mimeType: "image/png" | "image/jpeg" | "image/webp";
width: number;
height: number;
dpi: number;
};Why this package exists
Many systems do not want PDF bytes directly. They want page images that are:
- lossless
- easy to inspect
- high enough resolution for reading and analysis
- straightforward to pass into downstream APIs
This package makes that conversion step small, explicit, and fast.