pdfporter

v0.1.0
io.github.CloudCorpRecords/pdfporter Checked 1 day ago Published 28 days ago

Convert files/URLs to PDF via conv2pdf; writes output files locally and deletes conversion jobs.

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

convert_to_pdf

Word, Excel, PowerPoint, OpenDocument, Apple Pages, RTF, TXT, CSV, PNG, JPG, WebP, GIF, TIFF, HEIC, EPUB, PostScript (PS, EPS) or HTML file to PDF, chosen from the extension. Reads the local file, uploads it to the conv2pdf API, writes the converted PDF to output_path (or next to the input) and deletes the conversion job afterwards.

ParameterTypeDescription
path *stringLocal path of the input file. The file is read locally and uploaded to the conv2pdf API.
output_pathstringLocal path the converted result is written to. When omitted, the output is written next to the input file. An existing file at this path is refused, never overwritten.

convert_url_to_pdf

Public web page to PDF, from its address, printed as a browser would. Sends the URL to the conv2pdf API, writes the resulting PDF to the local output_path and deletes the conversion job afterwards.

ParameterTypeDescription
output_path *stringLocal path the converted PDF is written to. Always required for this tool. An existing file at this path is refused, never overwritten.
url *stringAddress of the public web page to convert. The URL is sent to the conv2pdf API, which renders the page.

convert_heic_to_jpg

iPhone HEIC or HEIF photo to JPG. Reads the local file, uploads it to the conv2pdf API, writes the JPG to output_path (or next to the input) and deletes the conversion job afterwards.

ParameterTypeDescription
path *stringLocal path of the input file. The file is read locally and uploaded to the conv2pdf API.
output_pathstringLocal path the converted result is written to. When omitted, the output is written next to the input file. An existing file at this path is refused, never overwritten.

convert_pdf_to_word

PDF with real text to an editable DOCX document. Reads the local file, uploads it to the conv2pdf API, writes the DOCX to output_path (or next to the input) and deletes the conversion job afterwards.

ParameterTypeDescription
path *stringLocal path of the input file. The file is read locally and uploaded to the conv2pdf API.
output_pathstringLocal path the converted result is written to. When omitted, the output is written next to the input file. An existing file at this path is refused, never overwritten.
passwordstringPassword that opens the protected input PDF.

convert_pdf_to_images

One PNG or JPG per page, in a ZIP file. Reads the local file, uploads it to the conv2pdf API, writes the ZIP to output_path (or next to the input) and deletes the conversion job afterwards.

ParameterTypeDescription
path *stringLocal path of the input file. The file is read locally and uploaded to the conv2pdf API.
formatstringImage format for the pages: png (default) or jpg.
output_pathstringLocal path the converted result is written to. When omitted, the output is written next to the input file. An existing file at this path is refused, never overwritten.
passwordstringPassword that opens the protected input PDF.

merge_pdfs

Combine several PDFs into one, in the order given. Reads the local files, uploads them to the conv2pdf API, writes the merged PDF to output_path (or next to the first input) and deletes the conversion job afterwards.

ParameterTypeDescription
paths *arrayLocal paths of the PDFs to merge (2 to 20 files), combined in the order given. Each file is read locally and uploaded to the conv2pdf API.
output_pathstringLocal path the merged PDF is written to. When omitted, merged.pdf is written next to the first input file. An existing file at this path is refused, never overwritten.

extract_pdf_pages

Copy the pages you list, such as 1-5,7,10-12, into a new PDF, in the order written. Reads the local file, uploads it to the conv2pdf API, writes the new PDF to output_path (or next to the input) and deletes the conversion job afterwards.

ParameterTypeDescription
path *stringLocal path of the input file. The file is read locally and uploaded to the conv2pdf API.
ranges *stringPages to copy, such as 1-5,7,10-12, in the order written.
output_pathstringLocal path the converted result is written to. When omitted, the output is written next to the input file. An existing file at this path is refused, never overwritten.
passwordstringPassword that opens the protected input PDF.

split_pdf

One PDF per page, in a ZIP file. Reads the local file, uploads it to the conv2pdf API, writes the ZIP to output_path (or next to the input) and deletes the conversion job afterwards.

ParameterTypeDescription
path *stringLocal path of the input file. The file is read locally and uploaded to the conv2pdf API.
output_pathstringLocal path the converted result is written to. When omitted, the output is written next to the input file. An existing file at this path is refused, never overwritten.
passwordstringPassword that opens the protected input PDF.

rotate_pdf

Turn every page by 90, 180 or 270 degrees. Reads the local file, uploads it to the conv2pdf API, writes the rotated PDF to output_path (or next to the input) and deletes the conversion job afterwards.

ParameterTypeDescription
path *stringLocal path of the input file. The file is read locally and uploaded to the conv2pdf API.
rotation *integerDegrees to turn every page: 90, 180 or 270.
output_pathstringLocal path the converted result is written to. When omitted, the output is written next to the input file. An existing file at this path is refused, never overwritten.
passwordstringPassword that opens the protected input PDF.

add_page_numbers

Number the pages, as "3 / 12" or "3", bottom center, left or right. Reads the local file, uploads it to the conv2pdf API, writes the numbered PDF to output_path (or next to the input) and deletes the conversion job afterwards.

ParameterTypeDescription
path *stringLocal path of the input file. The file is read locally and uploaded to the conv2pdf API.
formatstringPage-number format: "full" (default, as "3 / 12") or "simple" (as "3").
output_pathstringLocal path the converted result is written to. When omitted, the output is written next to the input file. An existing file at this path is refused, never overwritten.
passwordstringPassword that opens the protected input PDF.
positionstringWhere the page number goes: bottom-center (default), bottom-left or bottom-right.

add_watermark

Stamp a text of up to 50 characters on every page. Reads the local file, uploads it to the conv2pdf API, writes the watermarked PDF to output_path (or next to the input) and deletes the conversion job afterwards.

ParameterTypeDescription
path *stringLocal path of the input file. The file is read locally and uploaded to the conv2pdf API.
text *stringWatermark text stamped on every page (up to 50 characters).
output_pathstringLocal path the converted result is written to. When omitted, the output is written next to the input file. An existing file at this path is refused, never overwritten.
passwordstringPassword that opens the protected input PDF.

compress_pdf

Reduce the size, keeping images at 72, 150 or 300 DPI. Reads the local file, uploads it to the conv2pdf API, writes the compressed PDF to output_path (or next to the input) and deletes the conversion job afterwards.

ParameterTypeDescription
path *stringLocal path of the input file. The file is read locally and uploaded to the conv2pdf API.
output_pathstringLocal path the converted result is written to. When omitted, the output is written next to the input file. An existing file at this path is refused, never overwritten.
passwordstringPassword that opens the protected input PDF.
qualitystringCompression quality: low, medium (default) or high, keeping images at 72, 150 or 300 DPI.

protect_pdf

Set a password, and optionally forbid printing or copying. Reads the local file, uploads it to the conv2pdf API, writes the protected PDF to output_path (or next to the input) and deletes the conversion job afterwards.

ParameterTypeDescription
password *stringThe new password to set on the output PDF (6 to 64 characters).
path *stringLocal path of the input file. The file is read locally and uploaded to the conv2pdf API.
output_pathstringLocal path the converted result is written to. When omitted, the output is written next to the input file. An existing file at this path is refused, never overwritten.
prevent_copybooleanWhen true, copying content from the protected PDF is forbidden.
prevent_printbooleanWhen true, printing the protected PDF is forbidden.

unlock_pdf

Remove a password you know, or the printing and copying restrictions. Reads the local file, uploads it to the conv2pdf API, writes the unlocked PDF to output_path (or next to the input) and deletes the conversion job afterwards.

ParameterTypeDescription
path *stringLocal path of the input file. The file is read locally and uploaded to the conv2pdf API.
output_pathstringLocal path the converted result is written to. When omitted, the output is written next to the input file. An existing file at this path is refused, never overwritten.
passwordstringPassword that opens the protected input PDF.

get_quota

Plan, usage and limits of the API key