Apache PDFBox - Image to PDF
🔧 Operation Name
Apache PDFBox – Image to PDF
imageToPdf
🧾 Description
Converts a single image (e.g., JPG, PNG, GIF, BMP) into a one-page PDF document. The resulting PDF has a single page sized to match the dimensions of the source image.
Perfect for embedding scanned receipts, screenshots, or images into a PDF workflow.
✅ Inputs
Image File [Binary] (
InputStream) Binary content of the image (JPEG, PNG, etc.).
📤 Output
Payload:
InputStream(binary stream) A one-page PDF containing the provided image.Attributes:
PdfBoxFileAttributesMetadata of the generated PDF: number of pages (always 1), file size, creation date, etc.
🔍 Notes
The generated page is automatically sized to the image’s pixel dimensions (no scaling).
You can adjust scaling or margins later by combining this with other operations (e.g., rotatePages, filterPages).
Currently supports formats loadable by
PDImageXObject(PNG, JPEG, BMP, GIF).Always outputs a single-page PDF regardless of the image dimensions.
Underlying Application Interface:
Last updated