Page Devices

BmpDevice

BmpDevice renders a PDF page to a BMP image file. This is useful for generating thumbnails, document previews, and image-based pipelines.

try (Document doc = new Document("input.pdf")) {
    BmpDevice device = new BmpDevice();
    Page page = doc.getPages().get(1);
    device.process(page, "page1.bmp");
}

The output is a standard BMP file that can be further processed with standard Java image libraries.

PdfPageRenderer

PdfPageRenderer provides programmatic page rendering with configurable resolution and output dimensions for generating page previews at custom sizes.

Use Cases

  • Thumbnail generation — render the first page of each document as a preview image
  • Document preview — display a specific page in an image viewer
  • Image pipelines — pass rendered page images to OCR or image analysis tools

See Also