Embed image in PDF
embed_imageEmbed a base64-encoded JPEG or PNG image into a PDF document. Optionally add a caption, set custom dimensions, and apply PDF/A conformance for archival.
Instructions
Generate a PDF document with an embedded JPEG or PNG image. The image is accepted as a base64-encoded string and can include an optional caption and custom render dimensions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Document title rendered at the top and used as PDF metadata title. | |
| imageBase64 | Yes | Base64-encoded image bytes. Supports JPEG and PNG formats. | |
| mimeType | Yes | MIME type of the image. Must match the actual encoding of imageBase64. | |
| caption | No | Optional caption rendered below the image. | |
| width | No | Render width in points. If omitted, the image is auto-sized to fit the page. | |
| height | No | Render height in points. If omitted, aspect ratio is preserved. | |
| pdfA | No | Optional PDF/A conformance level (powered by pdfnative v1.2). Use 'pdfa1b' for archival of simple text+images, 'pdfa2b'/'pdfa2u' for richer content (2u guarantees Unicode mapping), 'pdfa3b' when embedding source attachments (Factur-X / ZUGFeRD). Mutually exclusive with PDF encryption. See docs/guides/PDFA.md. | |
| outputMode | No | Either 'base64' (returns the PDF inline) or 'file' (writes to a sandboxed path inside PDFNATIVE_MCP_OUTPUT_DIR). | base64 |
| outputPath | No | Required when outputMode='file'. Relative path inside the sandbox; must end with .pdf. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | ||
| sizeBytes | Yes | ||
| filePath | No | Absolute sandboxed file path (when mode='file'). | |
| base64 | No | Base64-encoded PDF bytes (when mode='base64'). |