Tools and options

Every tool a run can start, the files it takes and each option it accepts, with the limits that refuse a run before anything is counted.

How options work

Send the options of a tool in the options object of POST /v1/tools/{toolId}/runs. The server checks them with the rules below before it counts anything, so a run with options that do not fit is refused with the error code options.invalid and costs no task. The same rules are returned as a JSON Schema in the options field of GET /v1/tools/{toolId}. An option that is not listed is refused.

Page numbers count from 1. A page list is written like 1-3, 5. Positions on a page, in the tools that draw on it, are in points (72 to the inch) measured from the bottom left corner of the visible page, before any rotation the page carries. Colours are written #RRGGBB. Text drawn on a page uses a standard font, so it accepts Western European characters only; other text is refused with options.invalid.

A tool that places pictures on a document (sign and editor) takes the document as the first file and the pictures after it, in order. A picture is named in the options by its number, from 1.

merge

Takes at least 2 files of type PDF.

This tool takes no options. Send an empty object.

split

Takes 1 file of type PDF. Returns: One ZIP holding one PDF for each range.

Options of split
OptionTypeRequiredLimits
rangesstringNo1 to 2000 characters
everyintegerNo1 to 2000

reorder

Takes 1 file of type PDF.

Options of reorder
OptionTypeRequiredLimits
orderarray of integerYes1 to 2000 items

extract-pages

Takes 1 file of type PDF.

Options of extract-pages
OptionTypeRequiredLimits
pagesstringYes1 to 2000 characters

insert-pages

Takes 2 files of type PDF.

Options of insert-pages
OptionTypeRequiredLimits
afterintegerYes0 to 2000

insert-blank-pages

Takes 1 file of type PDF.

Options of insert-blank-pages
OptionTypeRequiredLimits
afterintegerYes0 to 2000
countintegerYes1 to 500

delete-pages

Takes 1 file of type PDF.

Options of delete-pages
OptionTypeRequiredLimits
pagesstringYes1 to 2000 characters

rotate

Takes 1 file of type PDF.

Options of rotate
OptionTypeRequiredLimits
angle90 or 180 or 270Nodefault 90
pagesstringNo1 to 2000 characters

crop

Takes 1 file of type PDF.

Options of crop
OptionTypeRequiredLimits
topnumberNo0 to 1000, default 10
rightnumberNo0 to 1000, default 10
bottomnumberNo0 to 1000, default 10
leftnumberNo0 to 1000, default 10
pagesstringNo1 to 2000 characters

page-numbers

Takes 1 file of type PDF.

Options of page-numbers
OptionTypeRequiredLimits
position"bottom-center" | "bottom-right" | "bottom-left" | "top-center" | "top-right" | "top-left"Nodefault "bottom-center"
startintegerNo0 to 100000, default 1
format"n" | "n-of-total"Nodefault "n"

pdf-to-word

Takes at least 1 file of type PDF.

This tool takes no options. Send an empty object.

pdf-to-excel

Takes at least 1 file of type PDF.

This tool takes no options. Send an empty object.

pdf-to-ppt

Takes at least 1 file of type PDF.

This tool takes no options. Send an empty object.

pdf-to-zpl

Takes 1 file of type PDF. Returns: One ZPL file with a label for each page.

Options of pdf-to-zpl
OptionTypeRequiredLimits
density6 or 8 or 12 or 24Nodefault 8
size"4x6in" | "4x4in" | "4x2in" | "2x1in" | "100x150mm"Nodefault "4x6in"
fit"contain" | "cover"Nodefault "contain"
thresholdintegerNo1 to 254, default 128
compression"hex" | "acs" | "z64"Nodefault "z64"

pdf-to-jpg

Takes 1 file of type PDF. Returns: One JPEG for a one page document, otherwise one ZIP with a JPEG for each page.

Options of pdf-to-jpg
OptionTypeRequiredLimits
dpi72 or 150 or 300Nodefault 150
qualityintegerNo10 to 100, default 85

pdf-to-png

Takes 1 file of type PDF. Returns: One PNG for a one page document, otherwise one ZIP with a PNG for each page.

Options of pdf-to-png
OptionTypeRequiredLimits
dpi72 or 150 or 300Nodefault 150

pdf-a

Takes at least 1 file of type PDF.

This tool takes no options. Send an empty object.

word-to-pdf

Takes at least 1 file of type application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/msword, application/vnd.oasis.opendocument.text, application/rtf.

This tool takes no options. Send an empty object.

excel-to-pdf

Takes at least 1 file of type application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, application/vnd.oasis.opendocument.spreadsheet, text/csv.

This tool takes no options. Send an empty object.

ppt-to-pdf

Takes at least 1 file of type application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.ms-powerpoint, application/vnd.oasis.opendocument.presentation.

This tool takes no options. Send an empty object.

zpl-to-pdf

Takes 1 file of type text.

Options of zpl-to-pdf
OptionTypeRequiredLimits
density6 or 8 or 12 or 24Nodefault 8
size"4x6in" | "4x4in" | "4x2in" | "2x1in" | "100x150mm"Nodefault "4x6in"

jpg-to-pdf

Takes at least 1 file of type JPEG, PNG.

Options of jpg-to-pdf
OptionTypeRequiredLimits
size"fit" | "a4" | "letter"Nodefault "fit"
marginnumberNo0 to 50, default 0

html-to-pdf

Takes 0 to 1 files of type text/html.

Options of html-to-pdf
OptionTypeRequiredLimits
urlstringNo1 to 2048 characters

scan-to-pdf

Takes at least 1 file of type JPEG, PNG.

Options of scan-to-pdf
OptionTypeRequiredLimits
size"fit" | "a4" | "letter"Nodefault "a4"
marginnumberNo0 to 50, default 10
cleanbooleanNodefault true

editor

Takes 1 to 11 files of type PDF, JPEG, PNG. Returns: A PDF with the text, pictures and rectangles drawn into the page content.

Options of editor
OptionTypeRequiredLimits
editsarray of object or object or objectYes1 to 500 items
edits[].type"text"Yes
edits[].pageintegerYes1 to 2000
edits[].xnumberNo-20000 to 20000
edits[].ynumberNo-20000 to 20000
edits[].anchor"bottom-left" | "bottom-center" | "bottom-right" | "top-left" | "top-center" | "top-right" | "center"No
edits[].textstringYes1 to 2000 characters
edits[].sizenumberNo4 to 200, default 12
edits[].colorstringNodefault "#000000"
edits[].opacitynumberNoat most 1, above 0, default 1
edits[].type"image"Yes
edits[].pageintegerYes1 to 2000
edits[].imageintegerYes1 to 10
edits[].xnumberNo-20000 to 20000
edits[].ynumberNo-20000 to 20000
edits[].anchor"bottom-left" | "bottom-center" | "bottom-right" | "top-left" | "top-center" | "top-right" | "center"No
edits[].widthnumberYesat most 20000, above 0
edits[].heightnumberNoat most 20000, above 0
edits[].opacitynumberNoat most 1, above 0, default 1
edits[].type"rectangle"Yes
edits[].pageintegerYes1 to 2000
edits[].xnumberYes-20000 to 20000
edits[].ynumberYes-20000 to 20000
edits[].widthnumberYesat most 20000, above 0
edits[].heightnumberYesat most 20000, above 0
edits[].colorstringNodefault "#FFFFFF"
edits[].opacitynumberNoat most 1, above 0, default 1

watermark

Takes 1 file of type PDF.

Options of watermark
OptionTypeRequiredLimits
textstringYes1 to 200 characters
opacitynumberNoat most 1, above 0, default 0.25
pagesstringNo1 to 2000 characters

forms

Takes 1 file of type PDF.

Options of forms
OptionTypeRequiredLimits
valuesobjectYes
flattenbooleanNodefault false

compare

Takes 2 files of type PDF. Returns: One JSON report: whether the documents are identical, and for each changed page the words removed and added.

This tool takes no options. Send an empty object.

annotate

Takes 1 file of type PDF. Returns: A PDF with real annotations, which any reader shows and lets the person edit or delete.

Options of annotate
OptionTypeRequiredLimits
annotationsarray of object or object or object or object or objectYes1 to 500 items
annotations[].type"highlight"Yes
annotations[].pageintegerYes1 to 2000
annotations[].xnumberYes-20000 to 20000
annotations[].ynumberYes-20000 to 20000
annotations[].widthnumberYesat most 20000, above 0
annotations[].heightnumberYesat most 20000, above 0
annotations[].colorstringNodefault "#FFEB3B"
annotations[].opacitynumberNoat most 1, above 0, default 0.4
annotations[].contentsstringNo1 to 2000 characters
annotations[].type"rectangle"Yes
annotations[].pageintegerYes1 to 2000
annotations[].xnumberYes-20000 to 20000
annotations[].ynumberYes-20000 to 20000
annotations[].widthnumberYesat most 20000, above 0
annotations[].heightnumberYesat most 20000, above 0
annotations[].colorstringNodefault "#E53935"
annotations[].lineWidthnumberNo0.25 to 20, default 2
annotations[].contentsstringNo1 to 2000 characters
annotations[].type"line"Yes
annotations[].pageintegerYes1 to 2000
annotations[].x1numberYes-20000 to 20000
annotations[].y1numberYes-20000 to 20000
annotations[].x2numberYes-20000 to 20000
annotations[].y2numberYes-20000 to 20000
annotations[].colorstringNodefault "#E53935"
annotations[].lineWidthnumberNo0.25 to 20, default 2
annotations[].contentsstringNo1 to 2000 characters
annotations[].type"note"Yes
annotations[].pageintegerYes1 to 2000
annotations[].xnumberYes-20000 to 20000
annotations[].ynumberYes-20000 to 20000
annotations[].contentsstringYes1 to 2000 characters
annotations[].colorstringNodefault "#FFEB3B"
annotations[].type"text"Yes
annotations[].pageintegerYes1 to 2000
annotations[].xnumberYes-20000 to 20000
annotations[].ynumberYes-20000 to 20000
annotations[].widthnumberYesat most 20000, above 0
annotations[].heightnumberYesat most 20000, above 0
annotations[].textstringYes1 to 2000 characters
annotations[].sizenumberNo4 to 72, default 12
annotations[].colorstringNodefault "#000000"

bates

Takes at least 1 file of type PDF.

Options of bates
OptionTypeRequiredLimits
prefixstringNoat most 32 characters, default ""
suffixstringNoat most 32 characters, default ""
startintegerNo0 to 1000000000000, default 1
digitsintegerNo1 to 12, default 6
position"bottom-right" | "bottom-left" | "bottom-center" | "top-right" | "top-left" | "top-center"Nodefault "bottom-right"
fontSizenumberNo4 to 72, default 10

redact

Takes 1 file of type PDF. Returns: A PDF in which each page with a covered area has been rebuilt from a picture of itself, so the covered text, drawing and pictures no longer exist in the file. Pages without a covered area are copied unchanged. Annotations, links and form fields of a rebuilt page are not kept, and the information of the original document (title, author and similar) is dropped.

Options of redact
OptionTypeRequiredLimits
areasarray of objectNoat most 500 items
areas[].pageintegerYes1 to 2000
areas[].xnumberYes-20000 to 20000
areas[].ynumberYes-20000 to 20000
areas[].widthnumberYesat most 20000, above 0
areas[].heightnumberYesat most 20000, above 0
termsarray of stringNoat most 50 items
dpi150 or 200 or 300Nodefault 200

protect

Takes 1 file of type PDF.

Options of protect
OptionTypeRequiredLimits
passwordstringYes4 to 128 characters
ownerPasswordstringNo4 to 128 characters
allowPrintingbooleanNodefault true
allowCopyingbooleanNodefault true
allowEditingbooleanNodefault true

unlock

Takes 1 file of type PDF.

Options of unlock
OptionTypeRequiredLimits
passwordstringYes1 to 128 characters

repair

Takes 1 file of type PDF.

This tool takes no options. Send an empty object.

sign

Takes 2 to 11 files of type PDF, JPEG, PNG. Returns: A PDF with the signature pictures drawn into the page content. This places a picture. It is not a certificate signature.

Options of sign
OptionTypeRequiredLimits
placementsarray of objectYes1 to 50 items
placements[].pageintegerYes1 to 2000
placements[].imageintegerYes1 to 10
placements[].xnumberNo-20000 to 20000
placements[].ynumberNo-20000 to 20000
placements[].anchor"bottom-left" | "bottom-center" | "bottom-right" | "top-left" | "top-center" | "top-right" | "center"No
placements[].widthnumberYesat most 20000, above 0
placements[].heightnumberNoat most 20000, above 0
placements[].opacitynumberNoat most 1, above 0, default 1

compress

Takes at least 1 file of type PDF.

Options of compress
OptionTypeRequiredLimits
quality"lossless" | "balanced" | "small"Nodefault "balanced"

ocr

Takes 1 file of type PDF.

Options of ocr
OptionTypeRequiredLimits
languagesarray of "eng" | "spa" | "hin" | "fra" | "deu" | "jpn" | "chi_sim" | "ara" | "por" | "heb"Yes1 to 3 items