PodPDF

v1.2.0
io.github.mohzameer/podpdf Checked 15 hours ago Published 4 days ago

Turn HTML, Markdown, URLs and saved templates into PDFs with the PodPDF API.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

generate_pdf Generate PDF

Convert HTML, Markdown or a public HTTPS URL to a PDF (up to 25 pages, 30 seconds). Returns a download link valid for 1 hour. Costs one PodPDF credit. Docs: https://apidocs.podpdf.com/api-reference/quickjob

ParameterTypeDescription
content *stringThe HTML, the Markdown, or the https:// URL to convert
input_type *stringWhat `content` is
formatstringPaper size (default A4)
landscapebooleanLandscape orientation
langstringWith pdf_standard: the document language, e.g. "en-GB". Defaults to <html lang>, then "en"
marginstringMargin for all four sides, e.g. "20mm" or "0.5in"
pageRangesstringPages to keep, e.g. "1-3, 5"
pdf_standardstringAlpha. Make an accessible, tagged PDF: "pdf/ua-1" (PDF/UA-1, PDF 1.7) or "pdf/ua-2" (PDF/UA-2, PDF 2.0). HTML and Markdown only. The result includes veraPDF's conformance verdict. Leave it out for an…
printBackgroundbooleanPrint background colours and images (default true)
save_pathstringOptional local file path to save the PDF to, e.g. "./invoice.pdf". The download link is returned either way.
scalenumberRender scale, 0.1 to 2 (default 1)
titlestringWith pdf_standard: the title PDF readers show. Defaults to the page's <title>, then its first heading

render_template Render Template

Fill a saved PodPDF template with data and render it to PDF. Template IDs are shown in the dashboard (Templates → Use via API). Docs: https://apidocs.podpdf.com/api-reference/templates

ParameterTypeDescription
data *objectValues for the template's fields; nested objects and arrays of objects for list fields. A dotted key such as "customer.name" is also accepted.
template_id *stringTemplate ID from the PodPDF dashboard
filenamestringFile name for the PDF
langstringWith pdf_standard: the document language, e.g. "en-GB". Defaults to <html lang>, then "en"
pdf_standardstringAlpha. Make an accessible, tagged PDF: "pdf/ua-1" (PDF/UA-1, PDF 1.7) or "pdf/ua-2" (PDF/UA-2, PDF 2.0). HTML and Markdown only. The result includes veraPDF's conformance verdict. Leave it out for an…
save_pathstringOptional local file path to save the PDF to, e.g. "./invoice.pdf". The download link is returned either way.
titlestringWith pdf_standard: the title PDF readers show. Defaults to the page's <title>, then its first heading

start_long_job Start Long Job

Queue a large HTML or Markdown document (up to 100 pages) for asynchronous rendering. Returns a job_id; set wait to true to poll until it finishes and return the download link. Docs: https://apidocs.podpdf.com/api-reference/longjob

ParameterTypeDescription
content *stringThe HTML or Markdown to render
input_type *stringWhat `content` is
formatstringPaper size (default A4)
landscapebooleanLandscape orientation
langstringWith pdf_standard: the document language, e.g. "en-GB". Defaults to <html lang>, then "en"
marginstringMargin for all four sides, e.g. "20mm" or "0.5in"
pageRangesstringPages to keep, e.g. "1-3, 5"
pdf_standardstringAlpha. Make an accessible, tagged PDF: "pdf/ua-1" (PDF/UA-1, PDF 1.7) or "pdf/ua-2" (PDF/UA-2, PDF 2.0). HTML and Markdown only. The result includes veraPDF's conformance verdict. Leave it out for an…
printBackgroundbooleanPrint background colours and images (default true)
scalenumberRender scale, 0.1 to 2 (default 1)
titlestringWith pdf_standard: the title PDF readers show. Defaults to the page's <title>, then its first heading
waitbooleanWait up to 3 minutes for the job to finish (default false)

get_job Get Job

Get the status and details of a PodPDF job (queued, processing, completed, partial_failed, failed, timeout). Docs: https://apidocs.podpdf.com/api-reference/jobs

ParameterTypeDescription
job_id *stringJob ID

merge_pdfs Merge PDFs

Merge 2 to 20 PDFs into one, in the order given, optionally taking only some pages of each. Costs one PodPDF credit. Docs: https://apidocs.podpdf.com/api-reference/pdf-tools

ParameterTypeDescription
files *arrayThe PDFs to merge, in order
filenamestringName for the merged PDF, e.g. "deal-pack.pdf"
pagesarrayOptional page range per file, in the same order, e.g. ["", "2-end"]. Blank means every page.
save_pathstringOptional local file path to save the PDF to, e.g. "./invoice.pdf". The download link is returned either way.

split_pdf Split PDF

Split one PDF into several: each page, every N pages, by page ranges, or just the pages you pick. Costs one PodPDF credit. Docs: https://apidocs.podpdf.com/api-reference/pdf-tools

ParameterTypeDescription
file *stringA PDF: a path on this machine, e.g. "./contract.pdf", or an https:// link to one
mode *stringeach_page: one PDF per page. every_n: a new file every N pages. ranges: one file per range. extract: one file with the pages you name.
every_nintegerFor every_n: how many pages per file
filename_patternstringHow to name the parts; {basename}, {index}, {index:03} and {pages} are filled in
pagesstringFor extract: e.g. "1-3,5"
rangesarrayFor ranges: e.g. ["1-3", "4-9", "10-end"]
save_dirstringOptional local directory to save every part into

inspect_pdf Inspect PDF

Look at a PDF without changing it: page count, page ids and sizes, encryption, and (with for_edit) every form field with its type, value and options. Free, and the right first step before edit_pdf. Docs: https://apidocs.podpdf.com/api-reference/pdf-editor

ParameterTypeDescription
file *stringA PDF: a path on this machine, e.g. "./contract.pdf", or an https:// link to one
for_editbooleantrue also returns page ids for recipes and the form field survey (needs the editor on your plan)

edit_pdf Edit PDF

Apply a recipe of operations to a PDF in one call, charged once however many it carries: text.add, watermark.text, watermark.image, header_footer, bates.stamp, pages.rotate/delete/extract/reorder/insert, metadata.set/strip, sanitize, form.fill, form.flatten, annotate.highlight/note/stamp, annotations.flatten. Call inspect_pdf with for_edit first for page ids and form fields. Docs: https://apidocs.podpdf.com/api-reference/pdf-editor

ParameterTypeDescription
file *stringA PDF: a path on this machine, e.g. "./contract.pdf", or an https:// link to one
recipe *arrayOperations applied in order, e.g. [{"op":"watermark.text","text":"DRAFT","rotation":45},{"op":"metadata.strip"}]. For `pages`, use page ids from inspect_pdf as a list (["p0","p2"]) or page numbers as…
filenamestringName for the edited PDF
save_pathstringOptional local file path to save the PDF to, e.g. "./invoice.pdf". The download link is returned either way.

protect_pdf Protect PDF

Password-protect a copy of a PDF (AES-256): a password to open it, and/or an owner password with restrictions on printing, copying or editing. Costs one PodPDF credit. The password passes through this conversation to PodPDF, which uses it to write the file and never stores or logs it. Asking twice is charged twice. Docs: https://apidocs.podpdf.com/api-reference/pdf-tools

ParameterTypeDescription
file *stringA PDF: a path on this machine, e.g. "./contract.pdf", or an https:// link to one
filenamestringName for the protected PDF; defaults to the original name with -protected
owner_passwordstringNeeded to change or remove the protection. Required when anything in permissions is restricted; must differ from user_password.
permissionsobjectWhat readers may do. Everything is allowed unless restricted here. Screen readers can always read the text.
save_pathstringOptional local file path to save the PDF to, e.g. "./invoice.pdf". The download link is returned either way.
user_passwordstringNeeded to open the PDF. Up to 127 bytes. PodPDF cannot recover it.

unlock_pdf Unlock PDF

Remove the password and restrictions from a copy of a protected PDF, so it can be merged, split or edited. Needs the right password: the open password or the owner password, and only the owner password for a PDF that opens freely but restricts printing or copying. A wrong password is not charged; otherwise one PodPDF credit. The password passes through this conversation to PodPDF, which uses it to write the file and never stores or logs it. Asking twice is charged twice. Docs: https://apidocs.podpdf.com/api-reference/pdf-tools

ParameterTypeDescription
file *stringA PDF: a path on this machine, e.g. "./contract.pdf", or an https:// link to one
password *stringThe PDF's open password or owner password
filenamestringName for the unlocked PDF; defaults to the original name with -unlocked
save_pathstringOptional local file path to save the PDF to, e.g. "./invoice.pdf". The download link is returned either way.