email_to_pdf
Convert MSG or EML email files into PDF documents, with options to embed or convert attachments, set page size, orientation, and margins.
Instructions
Convert email to PDF.
Ref: https://developer.pdf.co/api/pdf-from-email.md
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to the source file (MSG, EML). Supports publicly accessible links including Google Drive, Dropbox, PDF.co Built-In Files Storage. Use 'upload_file' tool to upload local files. | |
| api_key | No | PDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional) | |
| margins | No | Set to CSS style margins like 10px, 5mm, 5in for all sides or 5px 5px 5px 5px (the order of margins is top, right, bottom, left). (Optional) | |
| profiles | No | Extra engine options for this endpoint as a JSON object encoded in a string. The options differ per endpoint; see https://developer.pdf.co/api/profiles. (Optional) | |
| paperSize | No | A4 is set by default. Can be Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5, A6 or a custom size. Custom size can be set in px (pixels), mm or in (inches) with width and height separated by space like this: 200 300, 200px 300px, 200mm 300mm, 20cm 30cm or 6in 8in. (Optional) | |
| expiration | No | Lifetime of the output link in minutes; the output file is deleted afterwards. API default is 60; the maximum depends on the plan. (Optional) | |
| orientation | No | Set to Portrait or Landscape. Portrait is set by default. (Optional) | |
| embedAttachments | No | Set to true to automatically embeds all attachments from original input email MSG or EML files into the final output PDF. Set it to false if you don’t want to embed attachments so it will convert only the body of the input email. True by default. | |
| convertAttachments | No | Set to false if you don’t want to convert attachments from the original email and want to embed them as original files (as embedded PDF attachments). Converts attachments that are supported by the PDF.co API (DOC, DOCx, HTML, PNG, JPG etc.) into PDF format and then merges into output final PDF. Non-supported file types are added as PDF attachments (Adobe Reader or another viewer may be required to view PDF attachments). |