Upload a PDF
upload_documentUse this when the user already has a PDF (public https URL or base64) that should be printed and posted. Stores the file in the user's account, runs the print check (A4 or US Letter, free margins; printed_on says the paper: US Letter PDFs are printed on US Letter, a PDF mixing A4 and US Letter pages on A4, see us_letter_note; decide by compliant, as all_pages_a4 is false for a US Letter PDF) and returns document_id for create_letter. If the check fails, call fix_document_margins or ask the user for a corrected file. For a file on the user's own device, use create_upload_link instead. Sends nothing. Needs the user's account.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pdf_url | No | Public https URL of the PDF (A4 or US Letter pages), e.g. https://example.com/letter.pdf. Pass pdf_url or pdf_base64. | |
| file_name | No | Name to store the file under, e.g. cancellation.pdf. Default: the name from the URL, or "document.pdf". | |
| pdf_base64 | No | The PDF file as base64 (a data:application/pdf;base64, prefix is fine), for files up to about 3 MB. Pass pdf_url or pdf_base64. Larger files: pass pdf_url, or use create_upload_link. |