Self-Hosted API Reference Guide

MCP-oriented Markdown conversion of the self-hosted API reference guide for pdfRest API Toolkit container and AWS deployments.

pdfRest API Toolkit - Self-Hosted API Reference Guide

PDF processing REST APIs via GET/POST HTTP requests for AWS & Container deployment

Getting Started

Welcome to the pdfRest API Toolkit reference guide for self-hosted deployment! Below you will find all the information you need to use any of the pdfRest API Tools. This guide is organized by API endpoints, which express the output file types that can be generated from input files supplied with requests. For example, to convert a JPG file to a PDF, you would send the JPG file to the /pdf endpoint.

Note that the examples throughout are presented using cURL, but the APIs support any standard method for sending GET and POST HTTP requests.

Additional Resources

API Endpoints

GET /resource/{id}

Summary

Retrieve a resource or its URL by ID. Resource IDs can be found in the JSON response of POST requests.

Examples

curl -X GET "YOUR_DOMAIN_HERE/resource/0950b9bdf-0465-4d3f-8ea3-d2894f1ae839?format=file" --output "@PATH_TO_FILE/output_file.pdf"
curl -X GET "YOUR_DOMAIN_HERE/resource/112f7ea0d-0e56-44bc-a3d2-42fdff96d993?format=url"

Path Parameters

id
uuid required
Alphanumeric ID (UUID) of the resource to return
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
format
string required
Specify whether to return the file directly, URL to the file, or information about the file
Accepts:
  • file - return the file itself
  • url - return JSON containing the URL of the resource file
  • info - return JSON containing detailed information about the file (resource ID, file name, url, file type, file size (bytes), last modified datetime)

Default:None
endpoint: GET /resource/{id}
endpoint_parameters:
  path:
    - name: "id"
      location: "path"
      type: "uuid"
      required: true
      description: "Alphanumeric ID (UUID) of the resource to return"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
    - name: "format"
      location: "path"
      type: "string"
      required: true
      description: "Specify whether to return the file directly, URL to the file, or information about the file"
      accepts:
        - "`file` - return the file itself"
        - "`url` - return JSON containing the URL of the resource file"
        - "`info` - return JSON containing detailed information about the file:"
      info_response_fields:
        - "resource ID"
        - "file name"
        - "url"
        - "file type"
        - "file size (bytes)"
        - "last modified datetime"
      default: "None"

Responses


DELETE /resource/{id}

Summary

Delete a resource file by ID. Resource IDs can be found in the JSON response of POST requests. Note that the file must have been uploaded or generated using the same API Key provided with the call to delete it.

Examples

curl --request DELETE "YOUR_DOMAIN_HERE/resource/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Path Parameters

id
uuid required
Alphanumeric ID (UUID) of the resource to delete
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
endpoint: DELETE /resource/{id}
endpoint_parameters:
  path:
    - name: "id"
      location: "path"
      type: "uuid"
      required: true
      description: "Alphanumeric ID (UUID) of the resource to delete"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"

Responses


POST /pdf-info

Summary

Return detailed information about a PDF document and its contents to assess the current state of the file and drive conditional processing.

NOTE: Some PDF conditions can prevent all queries from completing. For example, if the document is password-protected, corrupted, or not actually a PDF, all queries will not be able to be completed. The output response will always include an "allQueriesProcessed" field with a true or false value. When this is false, an additional "warning" field will also be included in the output response with a human-readable string explaining why all queries could not be processed.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/pdf-info" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "queries=title,filename"
curl -X POST "YOUR_DOMAIN_HERE/pdf-info" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "queries=tagged,image_only,creation_date,modified_date,doc_language"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
queries
string required
Comma separated list of information to request about the input PDF file and its contents.
Accepts:
  • tagged - Checks for presence of structure tags in the input document. Returns true or false
  • image_only - Checks if the document is 'image only' meaning that it will only feature a series of embedded graphical image files, one per page and does not have any text or other features common to PDF documents, except for some metadata. Returns true or false
  • title - The title of the PDF as listed in the metadata. Returns a string which may be empty if the document does not have a title
  • subject - The subject of the PDF as listed in the metadata. Returns a string which may be empty if the document does not have a subject
  • author - The author of the PDF as listed in the metadata. Returns a string which may be empty if the document does not have an author
  • producer - The producer of the PDF as listed in the metadata. Returns a string which may be empty if the document does not have a producer
  • creator - The creator of the PDF as listed in the metadata. Returns a string which may be empty if the document does not have a creator
  • creation_date - The creation date of the PDF as listed in the metadata. Returns a string which may be empty if the document does not have a creation date
  • modified_date - The most recent modification date of the PDF as listed in the metadata. Returns a string which may be empty if the document does not have a modification date
  • keywords - The keywords of the PDF as listed in the metadata. Returns a string which may be empty if the document does not have keywords
  • custom_metadata - Retrieves custom metadata from the PDF and presents it as a JSON list of key:value pairs, where each pair represents a custom property and its value.
  • doc_language - The language that the file claims to be written in. Returns a string
  • page_count - The number of pages in the PDF document. Returns an integer
  • contains_annotations - Checks whether the document contains annotations, such as notes, highlighted text, file attachments, crossed out text, and text callout boxes. Returns true or false
  • contains_signature - Checks if the document contains any digital signatures. Returns true or false
  • pdf_version - Retrieves the version of the PDF standard that the document was created with. Returns a string of the form X.Y.Z where X, Y, and Z are the major, minor, and extension versions respectively
  • file_size - Retrieves the size of the input file in bytes. Returns an integer
  • filename - The name of the input file. Returns a string
  • restrict_permissions_set - Checks whether the document has restrict permissions set to prevent printing, copying, signing etc. Returns true or false
  • contains_xfa - Checks whether the document contains XFA forms. Returns true or false
  • contains_acroforms - Checks whether the document contains Acroforms. Returns true or false
  • contains_javascript - Checks whether the document contains javascript. Returns true or false
  • contains_transparency - Checks whether the document contains transparent objects. Returns true or false
  • contains_embedded_file - Checks whether the document contains one or more embedded files. Returns true or false
  • uses_embedded_fonts - Checks whether the document contains fully embedded fonts. Returns true or false
  • uses_nonembedded_fonts - Checks whether the document contains non-embedded fonts. Returns true or false
  • pdfa - Checks whether the document claims and conforms to a PDF/A standard. Returns true or false
  • pdfua_claim - Checks whether the document claims to conform to a PDF/UA standard. Returns true or false
  • pdfe_claim - Checks whether the document claims to conform to a PDF/E standard. Returns true or false
  • pdfx_claim - Checks whether the document claims to conform to a PDF/X standard. Returns true or false
  • requires_password_to_open - Checks whether the document requires a password to open. Returns true or false. Note A document requiring a password cannot be opened by this route and will not be able to return much other information

Example:tagged,image_only,creation_date,modified_date,doc_language
Default:None
endpoint: POST /pdf-info
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "queries"
      location: "body"
      type: "string"
      required: true
      description: "Comma separated list of information to request about the input PDF file and its contents."
      accepts:
        - "`tagged` - Checks for presence of structure tags in the input document. Returns true or false"
        - "`image_only` - Checks if the document is 'image only' meaning that it will only feature a series of embedded graphical image files, one per page and does not have any text or other features common to PDF documents, except for some metadata. Returns true or false"
        - "`title` - The title of the PDF as listed in the metadata. Returns a string which may be empty if the document does not have a title"
        - "`subject` - The subject of the PDF as listed in the metadata. Returns a string which may be empty if the document does not have a subject"
        - "`author` - The author of the PDF as listed in the metadata. Returns a string which may be empty if the document does not have an author"
        - "`producer` - The producer of the PDF as listed in the metadata. Returns a string which may be empty if the document does not have a producer"
        - "`creator` - The creator of the PDF as listed in the metadata. Returns a string which may be empty if the document does not have a creator"
        - "`creation_date` - The creation date of the PDF as listed in the metadata. Returns a string which may be empty if the document does not have a creation date"
        - "`modified_date` - The most recent modification date of the PDF as listed in the metadata. Returns a string which may be empty if the document does not have a modification date"
        - "`keywords` - The keywords of the PDF as listed in the metadata. Returns a string which may be empty if the document does not have keywords"
        - "`custom_metadata` - Retrieves custom metadata from the PDF and presents it as a JSON list of key:value pairs, where each pair represents a custom property and its value."
        - "`doc_language` - The language that the file claims to be written in. Returns a string"
        - "`page_count` - The number of pages in the PDF document. Returns an integer"
        - "`contains_annotations` - Checks whether the document contains annotations, such as notes, highlighted text, file attachments, crossed out text, and text callout boxes. Returns true or false"
        - "`contains_signature` - Checks if the document contains any digital signatures. Returns true or false"
        - "`pdf_version` - Retrieves the version of the PDF standard that the document was created with. Returns a string of the form X.Y.Z where X, Y, and Z are the major, minor, and extension versions respectively"
        - "`file_size` - Retrieves the size of the input file in bytes. Returns an integer"
        - "`filename` - The name of the input file. Returns a string"
        - "`restrict_permissions_set` - Checks whether the document has restrict permissions set to prevent printing, copying, signing etc. Returns true or false"
        - "`contains_xfa` - Checks whether the document contains XFA forms. Returns true or false"
        - "`contains_acroforms` - Checks whether the document contains Acroforms. Returns true or false"
        - "`contains_javascript` - Checks whether the document contains javascript. Returns true or false"
        - "`contains_transparency` - Checks whether the document contains transparent objects. Returns true or false"
        - "`contains_embedded_file` - Checks whether the document contains one or more embedded files. Returns true or false"
        - "`uses_embedded_fonts` - Checks whether the document contains fully embedded fonts. Returns true or false"
        - "`uses_nonembedded_fonts` - Checks whether the document contains non-embedded fonts. Returns true or false"
        - "`pdfa` - Checks whether the document claims and conforms to a PDF/A standard. Returns true or false"
        - "`pdfua_claim` - Checks whether the document claims to conform to a PDF/UA standard. Returns true or false"
        - "`pdfe_claim` - Checks whether the document claims to conform to a PDF/E standard. Returns true or false"
        - "`pdfx_claim` - Checks whether the document claims to conform to a PDF/X standard. Returns true or false"
        - "`requires_password_to_open` - Checks whether the document requires a password to open. Returns true or false. *Note* A document requiring a password cannot be opened by this route and will not be able to return much other information"
      example: "tagged,image_only,creation_date,modified_date,doc_language"
      default: "None"

Responses


POST /extracted-images

Summary

Extract all embedded images from a PDF file, or from a specified range of pages, and save them as separate image files. Each image will be saved in its original format (JPG, PNG, or TIFF), preserving its original compression and properties.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/extracted-images" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf"
curl -X POST "YOUR_DOMAIN_HERE/extracted-images" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "pages=14-last"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
output
string
Prefix of the generated output file name(s), without extension. The suffix "-img###-page###" will always be appended to the file name, where "img###" represents the incremental number of the extracted image file, and "page###" indicates the page number where the image first appeared.
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_extracted-images
pages
string
Page or range of pages to process
Accepts: Any mix of individual pages and/or ranges seperated by commas. last can be used to represent the number of the last page of the document.
Example:
  • 14-last
  • 2-9
  • 1,2,5-10,12-last

Default:1-last (all pages)
endpoint: POST /extracted-images
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Prefix of the generated output file name(s), without extension. The suffix \"-img###-page###\" will always be appended to the file name, where \"img###\" represents the incremental number of the extracted image file, and \"page###\" indicates the page number where the image first appeared."
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_extracted-images"
    - name: "pages"
      location: "body"
      type: "string"
      required: false
      description: "Page or range of pages to process"
      accepts: "Any mix of individual pages and/or ranges seperated by commas. `last` can be used to represent the number of the last page of the document."
      example:
        - "14-last"
        - "2-9"
        - "1,2,5-10,12-last"
      default:
        - "1-last"
        - "(all pages)"

Responses


POST /extracted-text

Summary

Extract all text from a PDF, optionally including style and/or position information.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/extracted-text" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf"
curl -X POST "YOUR_DOMAIN_HERE/extracted-text" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "full_text=document" -F "word_style=on" -F "word_coordinates=on"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
full_text
string
Returns all text from the document without metadata, optionally split by page
Accepts:
  • off
  • by_page
  • document

Default:document
preserve_line_breaks
boolean
When enabled, this feature identifies and maintains the original line breaks within the text, inserting a newline character ("\n") at each break point for full_text output.
Accepts:
  • off
  • on

Default:off
word_style
boolean
Adds a JSON-formatted list of each word in the document with style information for each word, including font, size, color, and color-space. NOTE: Turning on word_style and word_coordinates will add both types of metadata to the same word list
Accepts:
  • off
  • on

Default:off
word_coordinates
boolean
Adds a JSON-formatted list of each word in the document, including page and coordinates of all 4 corners of each word's bounding box. NOTE: Turning on word_style and word_coordinates will add both types of metadata to the same word list
Accepts:
  • off
  • on

Default:off
output_type
string
Specify whether to save output as a file with .json extension or return output directly in the JSON response
Accepts:
  • json
  • file

Default:json
output
string
Name of the generated output file (when output_type is set to file), without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_extracted-text
endpoint: POST /extracted-text
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "full_text"
      location: "body"
      type: "string"
      required: false
      description: "Returns all text from the document without metadata, optionally split by page"
      accepts:
        - "off"
        - "by_page"
        - "document"
      default: "document"
    - name: "preserve_line_breaks"
      location: "body"
      type: "boolean"
      required: false
      description: "When enabled, this feature identifies and maintains the original line breaks within the text, inserting a newline character (\"\\n\") at each break point for full_text output."
      accepts:
        - "off"
        - "on"
      default: "off"
    - name: "word_style"
      location: "body"
      type: "boolean"
      required: false
      description: "Adds a JSON-formatted list of each word in the document with style information for each word, including font, size, color, and color-space."
      accepts:
        - "off"
        - "on"
      default: "off"
    - name: "word_coordinates"
      location: "body"
      type: "boolean"
      required: false
      description: "Adds a JSON-formatted list of each word in the document, including page and coordinates of all 4 corners of each word's bounding box."
      accepts:
        - "off"
        - "on"
      default: "off"
    - name: "output_type"
      location: "body"
      type: "string"
      required: false
      description: "Specify whether to save output as a file with .json extension or return output directly in the JSON response"
      accepts:
        - "json"
        - "file"
      default: "json"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file (when output_type is set to file), without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_extracted-text"

Responses


POST /markdown

Summary

Convert PDF documents into clean, structured Markdown format, facilitating content repurposing, easy text manipulation, and LLM training.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/markdown" \
 -H "Accept: application/json" \
 -H "Content-Type: multipart/form-data" \
 -F "file=@/path/to/file"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
pages
string
Page or range of pages to include
Accepts: Any mix of individual pages and/or ranges seperated by commas. last can be used to represent the number of the last page of the document.
Example:
  • 14-last
  • 2-9
  • 1,2,5-10,12-last

Default:1-last (all pages)
page_break_comments
boolean
Applies page breaks in the Markdown as HTML comments in the format . This can provide useful contextual information for LLMs and other machine processing, as these comments are not rendered in the final visible output. However, be aware that these comments might conceptually break up the flow of the document in the raw Markdown file.
Accepts:
  • on
  • off

Example:on
Default:off
output_type
string
Specify whether to save output as a file with .md extension or return output directly in the JSON response
Accepts:
  • json
  • file

Default:json
output
string
Name of the generated output file (when output_type is set to file), without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_markdown
endpoint: POST /markdown
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "pages"
      location: "body"
      type: "string"
      required: false
      description: "Page or range of pages to include"
      accepts: "Any mix of individual pages and/or ranges seperated by commas. `last` can be used to represent the number of the last page of the document."
      example:
        - "14-last"
        - "2-9"
        - "1,2,5-10,12-last"
      default:
        - "1-last"
        - "(all pages)"
    - name: "page_break_comments"
      location: "body"
      type: "boolean"
      required: false
      description: "Applies page breaks in the Markdown as HTML comments in the format <!--Page 1-->. This can provide useful contextual information for LLMs and other machine processing, as these comments are not rendered in the final visible output. However, be aware that these comments might conceptually break up the flow of the document in the raw Markdown file."
      accepts:
        - "on"
        - "off"
      example: "on"
      default: "off"
    - name: "output_type"
      location: "body"
      type: "string"
      required: false
      description: "Specify whether to save output as a file with .md extension or return output directly in the JSON response"
      accepts:
        - "json"
        - "file"
      default: "json"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file (when output_type is set to file), without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_markdown"

Responses


POST /pdf-with-ocr-text

Summary

Uses Optical Character Recognition (OCR) technology to identify text within images embedded in PDFs. The detected text is then strategically placed behind the image within the PDF document.

This process results in a PDF with searchable and extractable text. Also works well as a pre-processing step before passing the PDF to the /extracted-text endpoint to extract PDF image text along with other document text.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/pdf-with-ocr-text" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_out"
curl -X POST "YOUR_DOMAIN_HERE/pdf-with-ocr-text" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=pdf_out"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
languages
string
Comma-separated list specifying the languages the OCR engine should recognize within the documentNOTE: Including many languages may effect performance, particularly CJK languages (Chinese, Japanese, Korean).
Accepts:
  • ChineseSimplified
  • ChineseTraditional
  • Dutch
  • English
  • French
  • German
  • Italian
  • Japanese
  • Korean
  • Portuguese
  • Spanish

Example:English,German,French
Default:English
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_pdf-with-ocr-text
endpoint: POST /pdf-with-ocr-text
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "languages"
      location: "body"
      type: "string"
      required: false
      description: "Comma-separated list specifying the languages the OCR engine should recognize within the document"
      accepts:
        - "ChineseSimplified"
        - "ChineseTraditional"
        - "Dutch"
        - "English"
        - "French"
        - "German"
        - "Italian"
        - "Japanese"
        - "Korean"
        - "Portuguese"
        - "Spanish"
      example: "English,German,French"
      default: "English"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_pdf-with-ocr-text"

Responses


POST /pdf

Summary

Convert many types of files to PDF

Accepts all of the following input file types:

  • Microsoft Word (.doc, .docx)
  • Microsoft Excel (.xls, .xlsx)
  • Microsoft PowerPoint (.ppt, .pptx)
  • PostScript and Encapsulated PostScript (.ps, .eps)
  • Email (.eml)
  • JPEG (.jpg, .jpeg)
  • TIF (.tif, .tiff)
  • BMP (.bmp)
  • PNG (.png)
  • HTML (.html)
  • HTML (from URL)

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.jpg" -F "output=example_out"
curl -X POST "YOUR_DOMAIN_HERE/pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/index.html" -F "output=pdf_out" -F "compression=lossless" -F "downsample=600" -F "page_size=A5" -F "page_margin=15mm" -F "page_orientation=landscape" -F "web_layout=mobile"
curl -X POST "YOUR_DOMAIN_HERE/pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=pdf_out" -F "tagged_pdf=on"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any file of supported type
Example:@PATH_TO_FILE/example_file.html
Default:None
Requirement: One of:
  • file
  • id
  • url
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
  • url
url
url
URL of web page to process
Accepts: Any valid URL
Example:https://en.wikipedia.org/wiki/Datalogics
Default:None
Requirement: One of:
  • file
  • id
  • url
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_pdf
compression
string
Image compression for PostScript, Microsoft Office, HTML conversion
Accepts:
  • lossy
  • lossless

Default:lossy
downsample
string
Downsample images during PostScript, Microsoft Office, HTML conversion or preserve original resolutions with the 'off' option
Accepts:
  • off
  • 75
  • 150
  • 300
  • 600
  • 1200

Default:300
tagged_pdf
boolean
Microsoft Office file conversion only: Create a tagged PDF document, required for accessibility compliance
Accepts:
  • on
  • off

Default:off
locale
string
Microsoft Excel file conversion only: Set the UTF-8 Locale used for correctly displaying regional numerical and monetary values, time and date formats, and other locale-specific standards.
Accepts:
  • US - applies en_US
  • Germany - applies de_DE

Example:Germany
Default:US
page_size
string
HTML conversion only: Select a page size for the PDF file. Options correspond to standard paper sizes
Accepts:
  • letter
  • legal
  • ledger
  • A3
  • A4
  • A5

Default:letter
page_margin
string
HTML conversion only: Set margins for a PDF file in inches or millimeters
Accepts: A number followed by either 'in' or 'mm'
Example:
  • 8mm
  • 2.5in
  • 10.25mm
  • 0in

Default:1in
page_orientation
string
HTML conversion only: Set the page orientation
Accepts:
  • portrait
  • landscape

Default:portrait
web_layout
string
HTML conversion only: For web pages with responsive design, select the intended web layout
Accepts:
  • desktop
  • tablet
  • mobile

Default:desktop
endpoint: POST /pdf
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any file of supported type"
      example: "@PATH_TO_FILE/example_file.html"
      default: "None"
      requirement:
        - "file"
        - "id"
        - "url"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
        - "url"
    - name: "url"
      location: "body"
      type: "url"
      required: conditional
      description: "URL of web page to process"
      accepts: "Any valid URL"
      example: "https://en.wikipedia.org/wiki/Datalogics"
      default: "None"
      requirement:
        - "file"
        - "id"
        - "url"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_pdf"
    - name: "compression"
      location: "body"
      type: "string"
      required: false
      description: "Image compression for PostScript, Microsoft Office, HTML conversion"
      accepts:
        - "lossy"
        - "lossless"
      default: "lossy"
    - name: "downsample"
      location: "body"
      type: "string"
      required: false
      description: "Downsample images during PostScript, Microsoft Office, HTML conversion or preserve original resolutions with the 'off' option"
      accepts:
        - "off"
        - "75"
        - "150"
        - "300"
        - "600"
        - "1200"
      default: "300"
    - name: "tagged_pdf"
      location: "body"
      type: "boolean"
      required: false
      description: "Microsoft Office file conversion only: Create a tagged PDF document, required for accessibility compliance"
      accepts:
        - "on"
        - "off"
      default: "off"
    - name: "locale"
      location: "body"
      type: "string"
      required: false
      description: "Microsoft Excel file conversion only: Set the UTF-8 Locale used for correctly displaying regional numerical and monetary values, time and date formats, and other locale-specific standards."
      accepts:
        - "`US` - applies en_US"
        - "`Germany` - applies de_DE"
      example: "Germany"
      default: "US"
    - name: "page_size"
      location: "body"
      type: "string"
      required: false
      description: "HTML conversion only: Select a page size for the PDF file. Options correspond to standard paper sizes"
      accepts:
        - "letter"
        - "legal"
        - "ledger"
        - "A3"
        - "A4"
        - "A5"
      default: "letter"
    - name: "page_margin"
      location: "body"
      type: "string"
      required: false
      description: "HTML conversion only: Set margins for a PDF file in inches or millimeters"
      accepts: "A number followed by either 'in' or 'mm'"
      example:
        - "8mm"
        - "2.5in"
        - "10.25mm"
        - "0in"
      default: "1in"
    - name: "page_orientation"
      location: "body"
      type: "string"
      required: false
      description: "HTML conversion only: Set the page orientation"
      accepts:
        - "portrait"
        - "landscape"
      default: "portrait"
    - name: "web_layout"
      location: "body"
      type: "string"
      required: false
      description: "HTML conversion only: For web pages with responsive design, select the intended web layout"
      accepts:
        - "desktop"
        - "tablet"
        - "mobile"
      default: "desktop"

Responses


POST /pdfa

Summary

Converts PDF to any of the following PDF/A versions:

  • PDF/A-1b - Basic conformance with visual appearance.
  • PDF/A-2b - Basic conformance with archival standards but revised for later versions of the PDF format. PDF/A-2 includes options for OpenType fonts, layers, attachments (which must also be PDF/A compliant) and JPEG 2000 image compression.
  • PDF/A-2u - Matches PDF/A-2b but also requires that all text in the document have Unicode mappings.
  • PDF/A-3b - Matches PDF/A-2b, except that it is possible to embed any kind of file in the PDF document. For example, with PDF/A-3 a user can save a XML, CSV, CAD, spreadsheet, or other type of file in the PDF document and be compliant. The file embedded in the PDF/A-3 does not need to PDF/A compliant.
  • PDF/A-3u - Matches PDF/A-3b, but also requires that all text in the document have Unicode mapping.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/pdfa" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_out" -F "output_type=PDF/A-2u"
curl -X POST "YOUR_DOMAIN_HERE/pdfa" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=file_out" -F "output_type=PDF/A-2u" -F "rasterize_if_errors_encountered=on"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
output_type
string required
Desired PDF/A version for the output PDF
Accepts:
  • PDF/A-1b
  • PDF/A-2b
  • PDF/A-2u
  • PDF/A-3b
  • PDF/A-3u

Default:None
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_pdfa
rasterize_if_errors_encountered
boolean
When set to ON, if the API finds errors when converting a PDF document, it will rasterize the page with the problem into a graphic image and continue to save the document as a PDF/A document. If set to OFF it will instead return an error in such cases.
Accepts:
  • on
  • off

Default:off
endpoint: POST /pdfa
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "output_type"
      location: "body"
      type: "string"
      required: true
      description: "Desired PDF/A version for the output PDF"
      accepts:
        - "PDF/A-1b"
        - "PDF/A-2b"
        - "PDF/A-2u"
        - "PDF/A-3b"
        - "PDF/A-3u"
      default: "None"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_pdfa"
    - name: "rasterize_if_errors_encountered"
      location: "body"
      type: "boolean"
      required: false
      description: "When set to ON, if the API finds errors when converting a PDF document, it will rasterize the page with the problem into a graphic image and continue to save the document as a PDF/A document. If set to OFF it will instead return an error in such cases."
      accepts:
        - "on"
        - "off"
      default: "off"

Responses


POST /pdfx

Summary

Converts PDF to any of the following PDF/X versions:

  • PDF/X-1a
  • PDF/X-3
  • PDF/X-4
  • PDF/X-6

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/pdfx" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_out" -F "output_type=PDF/X-4"
curl -X POST "YOUR_DOMAIN_HERE/pdfx" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=file_out" -F "output_type=PDF/X-1a"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
output_type
string required
Desired PDF/X version for the output PDF
Accepts:
  • PDF/X-1a
  • PDF/X-3
  • PDF/X-4
  • PDF/X-6

Default:None
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_pdfx
endpoint: POST /pdfx
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "output_type"
      location: "body"
      type: "string"
      required: true
      description: "Desired PDF/X version for the output PDF"
      accepts:
        - "PDF/X-1a"
        - "PDF/X-3"
        - "PDF/X-4"
        - "PDF/X-6"
      default: "None"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_pdfx"

Responses


POST /word

Summary

Converts a PDF to a Microsoft Word document

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/word" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@/path/to/file"
curl -X POST "YOUR_DOMAIN_HERE/word" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_output"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_word
endpoint: POST /word
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_word"

Responses


POST /excel

Summary

Converts a PDF to a Microsoft Excel document

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/excel" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@/path/to/file"
curl -X POST "YOUR_DOMAIN_HERE/excel" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_output"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_excel
endpoint: POST /excel
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_excel"

Responses


POST /powerpoint

Summary

Converts a PDF to a Microsoft PowerPoint document

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/powerpoint" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@/path/to/file"
curl -X POST "YOUR_DOMAIN_HERE/powerpoint" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_output"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_powerpoint
endpoint: POST /powerpoint
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_powerpoint"

Responses


POST /compressed-pdf

Summary

Compresses a PDF to maximally reduce file size while maintaining usable content. Three preset compression levels are offered: low, medium, and high. These produce progressively smaller files with a tradeoff between fidelity and size reduction. Compression options may also be customized via a configurable JSON profile.

Learn More Try in API Lab

Examples

# Example of using a preset compression_level
 curl -X POST "YOUR_DOMAIN_HERE/compressed-pdf" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_output" -F "compression_level=high"
# Example of a using a custom json profile with compression_level
 curl -X POST "YOUR_DOMAIN_HERE/compressed-pdf" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_output" -F "compression_level=custom" -F "profile=@PATH_TO_FILE/example_profile.json"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
compression_level
string required
Degree of compression with a tradeoff between preserving fidelity (low) and maximizing file size reduction (high) NOTE: When custom is selected, profile parameter is required
Accepts:
  • low
  • medium
  • high
  • custom

Default:None
profile
uuid
JSON profile to be uploaded with specifications for configurable compression settingsCreate a JSON profile with custom settings
Accepts: Any valid JSON profile
Example:@PATH_TO_FILE/example_profile.json
Default:None
Requirement: When compression_level is set to custom, one of:
  • profile
  • profile_id
profile_id
uuid
Submit a resource ID for JSON profile to be uploaded with specifications for configurable compression settingsCreate a JSON profile with custom settings
Accepts: Any valid resource ID returned by a POST request
Example:138aadb71-ee34-4621-9098-9686441e84e2
Default:None
Requirement: When compression_level is set to custom, one of:
  • profile
  • profile_id
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_compressed-pdf
endpoint: POST /compressed-pdf
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "compression_level"
      location: "body"
      type: "string"
      required: true
      description: "Degree of compression with a tradeoff between preserving fidelity (low) and maximizing file size reduction (high)"
      accepts:
        - "low"
        - "medium"
        - "high"
        - "custom"
      default: "None"
    - name: "profile"
      location: "body"
      type: "uuid"
      required: conditional
      description: "JSON profile to be uploaded with specifications for configurable compression settings"
      accepts: "Any valid JSON profile"
      example: "@PATH_TO_FILE/example_profile.json"
      default: "None"
      requirement:
        - "When compression_level is set to custom, one of:"
        - "profile"
        - "profile_id"
    - name: "profile_id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Submit a resource ID for JSON profile to be uploaded with specifications for configurable compression settings"
      accepts: "Any valid resource ID returned by a POST request"
      example: "138aadb71-ee34-4621-9098-9686441e84e2"
      default: "None"
      requirement:
        - "When compression_level is set to custom, one of:"
        - "profile"
        - "profile_id"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_compressed-pdf"

Responses


POST /signed-pdf

Summary

Digitally sign PDF documents programmatically, ensuring authenticity and integrity. This tool allows for the application of digital signatures with various configurations, including visual representations.

Learn More Try in API Lab

Examples

SIGNATURE_CONFIG='{"type": "new","name": "esignature","logo_opacity": "0.25","location": {"bottom_left": { "x": "0", "y": "0" },"top_right": { "x": "216", "y": "72" },"page": 1},"display": {"include_distinguished_name": "true","include_datetime": "true","contact": "My contact info","location": "My location","name": "John Doe","reason": "My reason for signing"}}'
curl -X POST "YOUR_DOMAIN_HERE/signed-pdf" \
 -H "Accept: application/json" \
 -H "Content-Type: multipart/form-data" \
 -F "file=@/path/to/file" \
 -F "pfx_credential_file=@/path/to/file" \
 -F "pfx_passphrase_file=@/path/to/file" \
 -F "logo_file=@/path/to/file" \
 -F "signature_configuration=$SIGNATURE_CONFIG" \
 -F "output=example_out"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
signature_configuration
string required
JSON string defining the signature properties, including type, name, logo opacity, location, and display settings.
Accepts: A JSON object with the following properties:
  • type (string, required): Type of signature, e.g., "new".
  • name (string, optional): Name of the signature, e.g., "esignature".
  • logo_opacity (number, optional): Opacity of the signature logo (0.0 to 1.0).
  • location (object, optional): Defines the signature's bounding box and page, including bottom_left (x, y), top_right (x, y), and page.
  • display (object, optional): Defines what information to display in the signature, including include_distinguished_name, include_datetime, contact, location, name, and reason.

Example:{"type": "new", "name": "esignature", "logo_opacity": "0.5", "location": {"bottom_left": {"x": "0", "y": "0"}, "top_right": {"x": "216", "y": "72"}, "page": "1"}, "display": {"include_distinguished_name": "true", "include_datetime": "true", "contact": "My contact information", "location": "My signing location", "name": "John Doe", "reason": "My reason for signing"}}
Default:None
pfx_credential_file
file
A .pfx or .p12 formatted file containing the digital certificate and private key for PFX credentials.
Accepts: A PKCS#12 (.pfx or .p12) file
Example:@PATH_TO_FILE/credentials.pfx
Default:None
Requirement: One of:
  • pfx_credential_file
  • pfx_credential_id (if using PFX credentials)
pfx_credential_id
uuid
Resource ID of a .pfx or .p12 formatted file containing the digital certificate and private key for PFX credentials.
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • pfx_credential_file
  • pfx_credential_id (if using PFX credentials)
pfx_passphrase_file
file
A .txt file with a passphrase for the PFX credential file.
Accepts: A text file containing the passphrase
Example:@PATH_TO_FILE/passphrase.txt
Default:None
Requirement: One of:
  • pfx_passphrase_file
  • pfx_passphrase_id (if using PFX credentials)
pfx_passphrase_id
uuid
Resource ID of a .txt file with a passphrase for the PFX credential file.
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • pfx_passphrase_file
  • pfx_passphrase_id (if using PFX credentials)
certificate_file
file
A .der or .pem formatted certificate file for non-PFX credentials.
Accepts: A .der or .pem certificate file
Example:@PATH_TO_FILE/certificate.pem
Default:None
Requirement: One of:
  • certificate_file
  • certificate_id (if using non-PFX credentials)
certificate_id
uuid
Resource ID of a .der or .pem formatted certificate file for non-PFX credentials.
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • certificate_file
  • certificate_id (if using non-PFX credentials)
private_key_file
file
A .der or .pem formatted private key file for non-PFX credentials.
Accepts: A .der or .pem private key file
Example:@PATH_TO_FILE/private_key.pem
Default:None
Requirement: One of:
  • private_key_file
  • private_key_id (if using non-PFX credentials)
private_key_id
uuid
Resource ID of a .der or .pem formatted private key file for non-PFX credentials.
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • private_key_file
  • private_key_id (if using non-PFX credentials)
logo_file
file
An image file (JPG, PNG, TIFF, BMP) to be used as a visual logo for the signature.
Accepts: Any JPG, PNG, TIFF, or BMP image file
Example:@PATH_TO_FILE/logo.png
Default:None
Requirement: One of:
  • logo_file
  • logo_id (Optional)
logo_id
uuid
Resource ID of an image file (JPG, PNG, TIFF, BMP) to be displayed on the signature as a logo.
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • logo_file
  • logo_id (Optional)
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_signed_doc
Default:[INPUT_FILE_NAME]_pdfrest_signed_pdf
endpoint: POST /signed-pdf
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "signature_configuration"
      location: "body"
      type: "string"
      required: true
      description: "JSON string defining the signature properties, including type, name, logo opacity, location, and display settings."
      accepts:
        - "A JSON object with the following properties:"
        - "type (string, required): Type of signature, e.g., \"new\"."
        - "name (string, optional): Name of the signature, e.g., \"esignature\"."
        - "logo_opacity (number, optional): Opacity of the signature logo (0.0 to 1.0)."
        - "location (object, optional): Defines the signature's bounding box and page, including `bottom_left` (`x`, `y`), `top_right` (`x`, `y`), and `page`."
        - "display (object, optional): Defines what information to display in the signature, including `include_distinguished_name`, `include_datetime`, `contact`, `location`, `name`, and `reason`."
      schema:
        type: "object"
        properties:
          type:
            type: "string"
            required: true
            description: "Type of signature, e.g., \"new\"."
          name:
            type: "string"
            required: false
            description: "Name of the signature, e.g., \"esignature\"."
          logo_opacity:
            type: "number"
            required: false
            description: "Opacity of the signature logo (0.0 to 1.0)."
          location:
            type: "object"
            required: false
            description: "Defines the signature bounding box and page."
            properties:
              bottom_left:
                type: "object"
                required: true
                properties:
                  x:
                    type: "string"
                    required: true
                  y:
                    type: "string"
                    required: true
              top_right:
                type: "object"
                required: true
                properties:
                  x:
                    type: "string"
                    required: true
                  y:
                    type: "string"
                    required: true
              page:
                type: "string"
                required: true
          display:
            type: "object"
            required: false
            description: "Defines what information to display in the signature."
            properties:
              include_distinguished_name:
                type: "string"
                required: false
                accepts:
                  - "true"
                  - "false"
              include_datetime:
                type: "string"
                required: false
                accepts:
                  - "true"
                  - "false"
              contact:
                type: "string"
                required: false
              location:
                type: "string"
                required: false
              name:
                type: "string"
                required: false
              reason:
                type: "string"
                required: false
      example: "{\"type\": \"new\", \"name\": \"esignature\", \"logo_opacity\": \"0.5\", \"location\": {\"bottom_left\": {\"x\": \"0\", \"y\": \"0\"}, \"top_right\": {\"x\": \"216\", \"y\": \"72\"}, \"page\": \"1\"}, \"display\": {\"include_distinguished_name\": \"true\", \"include_datetime\": \"true\", \"contact\": \"My contact information\", \"location\": \"My signing location\", \"name\": \"John Doe\", \"reason\": \"My reason for signing\"}}"
      default: "None"
    - name: "pfx_credential_file"
      location: "body"
      type: "file"
      required: conditional
      description: "A .pfx or .p12 formatted file containing the digital certificate and private key for PFX credentials."
      accepts: "A PKCS#12 (.pfx or .p12) file"
      example: "@PATH_TO_FILE/credentials.pfx"
      default: "None"
      requirement:
        - "pfx_credential_file"
        - "pfx_credential_id"
        - "(if using PFX credentials)"
    - name: "pfx_credential_id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Resource ID of a .pfx or .p12 formatted file containing the digital certificate and private key for PFX credentials."
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "pfx_credential_file"
        - "pfx_credential_id"
        - "(if using PFX credentials)"
    - name: "pfx_passphrase_file"
      location: "body"
      type: "file"
      required: conditional
      description: "A .txt file with a passphrase for the PFX credential file."
      accepts: "A text file containing the passphrase"
      example: "@PATH_TO_FILE/passphrase.txt"
      default: "None"
      requirement:
        - "pfx_passphrase_file"
        - "pfx_passphrase_id"
        - "(if using PFX credentials)"
    - name: "pfx_passphrase_id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Resource ID of a .txt file with a passphrase for the PFX credential file."
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "pfx_passphrase_file"
        - "pfx_passphrase_id"
        - "(if using PFX credentials)"
    - name: "certificate_file"
      location: "body"
      type: "file"
      required: conditional
      description: "A .der or .pem formatted certificate file for non-PFX credentials."
      accepts: "A .der or .pem certificate file"
      example: "@PATH_TO_FILE/certificate.pem"
      default: "None"
      requirement:
        - "certificate_file"
        - "certificate_id"
        - "(if using non-PFX credentials)"
    - name: "certificate_id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Resource ID of a .der or .pem formatted certificate file for non-PFX credentials."
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "certificate_file"
        - "certificate_id"
        - "(if using non-PFX credentials)"
    - name: "private_key_file"
      location: "body"
      type: "file"
      required: conditional
      description: "A .der or .pem formatted private key file for non-PFX credentials."
      accepts: "A .der or .pem private key file"
      example: "@PATH_TO_FILE/private_key.pem"
      default: "None"
      requirement:
        - "private_key_file"
        - "private_key_id"
        - "(if using non-PFX credentials)"
    - name: "private_key_id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Resource ID of a .der or .pem formatted private key file for non-PFX credentials."
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "private_key_file"
        - "private_key_id"
        - "(if using non-PFX credentials)"
    - name: "logo_file"
      location: "body"
      type: "file"
      required: conditional
      description: "An image file (JPG, PNG, TIFF, BMP) to be used as a visual logo for the signature."
      accepts: "Any JPG, PNG, TIFF, or BMP image file"
      example: "@PATH_TO_FILE/logo.png"
      default: "None"
      requirement:
        - "logo_file"
        - "logo_id"
        - "(Optional)"
    - name: "logo_id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Resource ID of an image file (JPG, PNG, TIFF, BMP) to be displayed on the signature as a logo."
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "logo_file"
        - "logo_id"
        - "(Optional)"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_signed_doc"
      default: "[INPUT_FILE_NAME]_pdfrest_signed_pdf"

Responses


POST /pdf-with-redacted-text-preview

Summary

Generates a visual preview of redactions to be applied to a PDF document, highlighting the areas to be redacted with red rectangles based on the specified JSON redaction parameters. This step is required before applying the final redactions, allowing users to review and verify the redactions for accuracy and completeness. To apply redactions, send the output from this endpoint to the /pdf-with-redacted-text-applied endpoint.

Learn More Try in API Lab

Example

REDACTIONS='{"type":"preset","value":"email"},{"type":"regex","value":"(\+\d{1,2}\s)?\(?\d{3}\)?\s.-\d{3}\s.-\d{4}"},{"type":"literal","value":"word"}' curl -X POST "YOUR_DOMAIN_HERE/pdf-with-redacted-text-preview"
-H "Accept: application/json"
-H "Content-Type: multipart/form-data"
-F "file=@/path/to/file"
-F "redactions=$REDACTIONS"
-F "output=example_out"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
PDF file to be uploaded for redaction.
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing PDF file on server for redaction.
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
redactions
string required
Specifies the redactions to be applied to a PDF document. Each redaction entry in the array defines the type of redaction and the value to search for and redact.
Accepts: Types of Redactions:
  • literal - The value is the exact string to search for and redact. This type is useful for removing specific names, words, or phrases.
  • regex - The value is a regular expression used to search for pattern matches and redact them. This type is ideal for identifying and removing patterns such as sequences of numbers or specific text formats.
  • preset - The value can be set to one of the following predefined types to automatically redact common patterns using a predefined regex:
  • email - Email addresses
  • phone_number - Phone numbers
  • date - Dates
  • us_ssn - US Social Security numbers
  • url - URLs
  • credit_card - Credit card numbers
  • credit_debit_pin - Credit/Debit PIN numbers
  • bank_routing_number - Bank routing numbers
  • international_bank_account_number - International bank account numbers
  • swift_bic_number - SWIFT/BIC numbers
  • ipv4 - IPv4 addresses
  • ipv6 - IPv6 addresses

Example:[ { "type": "literal", "value": "John Doe" }, { "type": "regex", "value": "(\$|USD)\s*\d{1,3}(,\d{3})*(\.\d{2})?" }, { "type": "preset", "value": "credit_card" }, { "type": "preset", "value": "email" } ]
Default:None
output
string
Name of the generated output file, without extension.
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_pdf-with-redacted-text-preview
endpoint: POST /pdf-with-redacted-text-preview
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "PDF file to be uploaded for redaction."
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing PDF file on server for redaction."
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "redactions"
      location: "body"
      type: "string"
      required: true
      description: "Specifies the redactions to be applied to a PDF document. Each redaction entry in the array defines the type of redaction and the value to search for and redact."
      accepts:
        - "Types of Redactions:"
        - "`literal` - The value is the exact string to search for and redact. This type is useful for removing specific names, words, or phrases."
        - "`regex` - The value is a regular expression used to search for pattern matches and redact them. This type is ideal for identifying and removing patterns such as sequences of numbers or specific text formats."
        - "`preset` - The value can be set to one of the following predefined types to automatically redact common patterns using a predefined regex:"
        - "`email` - Email addresses"
        - "`phone_number` - Phone numbers"
        - "`date` - Dates"
        - "`us_ssn` - US Social Security numbers"
        - "`url` - URLs"
        - "`credit_card` - Credit card numbers"
        - "`credit_debit_pin` - Credit/Debit PIN numbers"
        - "`bank_routing_number` - Bank routing numbers"
        - "`international_bank_account_number` - International bank account numbers"
        - "`swift_bic_number` - SWIFT/BIC numbers"
        - "`ipv4` - IPv4 addresses"
        - "`ipv6` - IPv6 addresses"
      example:
        - "["
        - "{"
        - "\"type\": \"literal\","
        - "\"value\": \"John Doe\""
        - "},"
        - "{"
        - "\"type\": \"regex\","
        - "\"value\": \"(\\\\$|USD)\\\\s*\\\\d{1,3}(,\\\\d{3})*(\\\\.\\\\d{2})?\""
        - "},"
        - "{"
        - "\"type\": \"preset\","
        - "\"value\": \"credit_card\""
        - "},"
        - "{"
        - "\"type\": \"preset\","
        - "\"value\": \"email\""
        - "}"
        - "]"
      default: "None"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension."
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_pdf-with-redacted-text-preview"

Responses


POST /pdf-with-redacted-text-applied

Summary

Finalizes the redaction process by applying the specified redactions to a PDF document. This endpoint takes the redaction preview generated by /pdf-with-redacted-text-preview and permanently removes the identified sensitive information from the document. Users can automate this step following a manual review or execute it in succession with the preview step for a fully automated redaction workflow. This ensures that all sensitive data is securely and irreversibly redacted, safeguarding against unauthorized access and ensuring compliance with data protection regulations.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/pdf-with-redacted-text-applied" \
 -H "Accept: application/json" \
 -H "Content-Type: multipart/form-data" \
 -F "file=@/path/to/file" \
 -F "rgb_color=255,255,255" \

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
PDF file to be uploaded for redaction.
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing PDF file on server for redaction.
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
rgb_color
string
Set the RGB color for the redaction blocks when they are applied.
Accepts: 3 comma-separated integers from 0 to 255
Example:255, 255, 255
Default:0, 0, 0 (black)
output
string
Name of the generated output file, without extension.
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_pdf-with-redacted-text-applied
endpoint: POST /pdf-with-redacted-text-applied
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "PDF file to be uploaded for redaction."
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing PDF file on server for redaction."
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "rgb_color"
      location: "body"
      type: "string"
      required: false
      description: "Set the RGB color for the redaction blocks when they are applied."
      accepts: "3 comma-separated integers from 0 to 255"
      example: "255, 255, 255"
      default: "0, 0, 0 (black)"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension."
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_pdf-with-redacted-text-applied"

Responses


POST /watermarked-pdf

Summary

Apply either a text-based or an image-based watermark to all pages of a PDF with customizable font, text size, color, opacity, scale, positioning, and rotation.

Learn More Try in API Lab

Examples

# Example of adding a text watermark
 curl -X POST "YOUR_DOMAIN_HERE/watermarked-pdf" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "watermark_text=This is a Watermark" -F "output=watermarked_output" -F "font=arialbold" -F "text_size=82" -F "text_color_rgb=20,26,215" -F "opacity=0.75" -F "x=72" -F "y=-72" -F "rotation=45"
# Example of adding an image watermark from file
 curl -X POST "YOUR_DOMAIN_HERE/watermarked-pdf" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "watermark_file=@PATH_TO_FILE/output_watermarked.pdf" -F "output=watermarked_output" -F "watermark_file_scale=2.5" -F "opacity=0.5" -F "x=0" -F "y=144" -F "rotation=30"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
PDF file to be uploaded and watermarked
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
watermark_text
string
The text to apply to the input document as a watermark
Accepts: Any text string
Example:Property of ABC Company
Default:None
Requirement: One of:
  • watermark_text
  • watermark_file
  • watermark_file_id
watermark_file
file
PDF file to apply to the input document as a watermark
Accepts: Any PDF file (NOTE: to apply another graphic image format as a watermark, first convert that format to PDF with the /pdf endpoint)
Example:@PATH_TO_FILE/watermark_image.pdf
Default:None
Requirement: One of:
  • watermark_text
  • watermark_file
  • watermark_file_id
watermark_file_id
uuid
Alphanumeric ID (UUID) of existing PDF file on server to be applied as a watermark
Accepts: Any valid resource ID returned by a POST request
Example:1f50b5bdf-0425-7d3f-1ea3-v2894f1ae833
Default:None
Requirement: One of:
  • watermark_text
  • watermark_file
  • watermark_file_id
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_watermarked-pdf
font
string
Font to use for a text watermark
Accepts: See Font List for a complete list
Example:CourierStd
Default:Arial
text_size
integer
Size of text for a text watermark
Accepts: 5-100
Example:20
Default:72
text_color_rgb
string
Comma separated Red, Green, Blue values for a text watermark NOTE: cannot be used with text_color_cmyk
Accepts: Each value must be between 0 and 255
Example:255,0,0
Default:0,0,0
text_color_cmyk
string
Comma separated Cyan, Magenta, Yellow, Key (Black) values for a text watermark NOTE: cannot be used with text_color_rgb
Accepts: Each value must be between 0 and 100
Example:100,0,0,0
Default:None
watermark_file_scale
number
Scale applied to resize the content of a pdf watermark file
Accepts: Any non-negative number
Example:2.25
Default:0.5
opacity
number
Opacity value for both text and file watermarks
Accepts: Any decimal value from 0 to 1, where 0 is fully transparent and 1 is fully opaque
Example:0.75
Default:0.5
x
integer
Horizontal offset in PDF units from the center of page for both text and file watermarks (72 units = 1 inch)
Accepts: Any integer value
Example:-72
Default:0 (horizontal center of page)
y
integer
Vertical offset in PDF units from the center of page for both text and file watermarks (72 units = 1 inch)
Accepts: Any integer value
Example:150
Default:0 (vertical center of page)
rotation
number
Rotation in degrees to be applied to both text and file watermarks
Accepts: Any integer value
Example:45
Default:0
pages
string
Page or range of pages on which to apply watermark
Accepts: Any mix of individual pages and/or ranges seperated by commas. last can be used to represent the number of the last page of the document.
Example:
  • 14-last
  • 2-9
  • 1,2,5-10,12-last

Default:1-last (all pages)
behind_page
string
When true, places watermark behind all page content instead of on top of all page content.
Accepts:
  • true
  • false

Default:false
endpoint: POST /watermarked-pdf
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "PDF file to be uploaded and watermarked"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "watermark_text"
      location: "body"
      type: "string"
      required: conditional
      description: "The text to apply to the input document as a watermark"
      accepts: "Any text string"
      example: "Property of ABC Company"
      default: "None"
      requirement:
        - "watermark_text"
        - "watermark_file"
        - "watermark_file_id"
    - name: "watermark_file"
      location: "body"
      type: "file"
      required: conditional
      description: "PDF file to apply to the input document as a watermark"
      accepts: "Any PDF file (NOTE: to apply another graphic image format as a watermark, first convert that format to PDF with the /pdf endpoint)"
      example: "@PATH_TO_FILE/watermark_image.pdf"
      default: "None"
      requirement:
        - "watermark_text"
        - "watermark_file"
        - "watermark_file_id"
    - name: "watermark_file_id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing PDF file on server to be applied as a watermark"
      accepts: "Any valid resource ID returned by a POST request"
      example: "1f50b5bdf-0425-7d3f-1ea3-v2894f1ae833"
      default: "None"
      requirement:
        - "watermark_text"
        - "watermark_file"
        - "watermark_file_id"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_watermarked-pdf"
    - name: "font"
      location: "body"
      type: "string"
      required: false
      description: "Font to use for a text watermark"
      accepts: "See [Font List](https://pdfrest.com/documentation/fontlist) for a complete list"
      example: "CourierStd"
      default: "Arial"
    - name: "text_size"
      location: "body"
      type: "integer"
      required: false
      description: "Size of text for a text watermark"
      accepts: "5-100"
      example: "20"
      default: "72"
    - name: "text_color_rgb"
      location: "body"
      type: "string"
      required: false
      description: "Comma separated Red, Green, Blue values for a text watermark"
      accepts: "Each value must be between 0 and 255"
      example: "255,0,0"
      default: "0,0,0"
    - name: "text_color_cmyk"
      location: "body"
      type: "string"
      required: false
      description: "Comma separated Cyan, Magenta, Yellow, Key (Black) values for a text watermark"
      accepts: "Each value must be between 0 and 100"
      example: "100,0,0,0"
      default: "None"
    - name: "watermark_file_scale"
      location: "body"
      type: "number"
      required: false
      description: "Scale applied to resize the content of a pdf watermark file"
      accepts: "Any non-negative number"
      example: "2.25"
      default: "0.5"
    - name: "opacity"
      location: "body"
      type: "number"
      required: false
      description: "Opacity value for both text and file watermarks"
      accepts: "Any decimal value from 0 to 1, where 0 is fully transparent and 1 is fully opaque"
      example: "0.75"
      default: "0.5"
    - name: "x"
      location: "body"
      type: "integer"
      required: false
      description: "Horizontal offset in PDF units from the center of page for both text and file watermarks (72 units = 1 inch)"
      accepts: "Any integer value"
      example: "-72"
      default: "0 (horizontal center of page)"
    - name: "y"
      location: "body"
      type: "integer"
      required: false
      description: "Vertical offset in PDF units from the center of page for both text and file watermarks (72 units = 1 inch)"
      accepts: "Any integer value"
      example: "150"
      default: "0 (vertical center of page)"
    - name: "rotation"
      location: "body"
      type: "number"
      required: false
      description: "Rotation in degrees to be applied to both text and file watermarks"
      accepts: "Any integer value"
      example: "45"
      default: "0"
    - name: "pages"
      location: "body"
      type: "string"
      required: false
      description: "Page or range of pages on which to apply watermark"
      accepts: "Any mix of individual pages and/or ranges seperated by commas. `last` can be used to represent the number of the last page of the document."
      example:
        - "14-last"
        - "2-9"
        - "1,2,5-10,12-last"
      default:
        - "1-last"
        - "(all pages)"
    - name: "behind_page"
      location: "body"
      type: "string"
      required: false
      description: "When true, places watermark behind all page content instead of on top of all page content."
      accepts:
        - "true"
        - "false"
      default: "false"

Responses


POST /encrypted-pdf

Summary

Encrypt a PDF using 256-bit AES encryption with a 32-bit key. Encrypted PDFs cannot be viewed without first providing the open password.

Use "current_open_password" with "new_open_password" to change the open password on a document that was already encrypted. Use "current_permissions_password" if the input document has a permissions password.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/encrypted-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_out" -F "new_open_password=password"
curl -X POST "YOUR_DOMAIN_HERE/encrypted-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=encrypted_out" -F "current_open_password=oldpassword" -F "new_open_password=newpassword"
curl -X POST "YOUR_DOMAIN_HERE/encrypted-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_out" -F "new_open_password=openpassword" -F "current_permissions_password=permspassword"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
new_open_password
string required
New open password
Accepts: A string between 6 and 128 characters long
Example:1234567890qwertyuiop
Default:None
current_open_password
string
Existing open password
Accepts: A valid password
Example:OpenUp
Default:None
current_permissions_password
string
Existing permissions password
Accepts: A valid password
Example:oahfoufdo99
Default:None
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_encrypted-pdf
endpoint: POST /encrypted-pdf
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "new_open_password"
      location: "body"
      type: "string"
      required: true
      description: "New open password"
      accepts: "A string between 6 and 128 characters long"
      example: "1234567890qwertyuiop"
      default: "None"
    - name: "current_open_password"
      location: "body"
      type: "string"
      required: false
      description: "Existing open password"
      accepts: "A valid password"
      example: "OpenUp"
      default: "None"
    - name: "current_permissions_password"
      location: "body"
      type: "string"
      required: false
      description: "Existing permissions password"
      accepts: "A valid password"
      example: "oahfoufdo99"
      default: "None"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_encrypted-pdf"

Responses


POST /decrypted-pdf

Summary

Remove encryption from a PDF. Use "current_permissions_password" if the input document has a permissions password.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/decrypted-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_out" -F "current_open_password=password"
curl -X POST "YOUR_DOMAIN_HERE/decrypted-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_out" -F "current_open_password=openpassword" -F "current_permissions_password=permspassword"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
current_open_password
string required
Existing open password
Accepts: A valid password
Example:OpenUp
Default:None
current_permissions_password
string
Existing permissions password
Accepts: A valid password
Example:oahfoufdo99
Default:None
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_decrypted-pdf
endpoint: POST /decrypted-pdf
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "current_open_password"
      location: "body"
      type: "string"
      required: true
      description: "Existing open password"
      accepts: "A valid password"
      example: "OpenUp"
      default: "None"
    - name: "current_permissions_password"
      location: "body"
      type: "string"
      required: false
      description: "Existing permissions password"
      accepts: "A valid password"
      example: "oahfoufdo99"
      default: "None"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_decrypted-pdf"

Responses


POST /restricted-pdf

Summary

Apply one or more document security restrictions to PDF with a permissions password. At minimum, a permissions password prevents the security settings of a document from being modified. Use "restrictions" to add additional security restrictions.

Use "current_permissions_password" with "new_permissions_password" to change the permissions password on a document.

NOTE: Setting a new permissions password will normally overwrite existing security data, including the open password. Use "current_open_password" to keep encryption with an already applied open password.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/restricted-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_out" -F "new_permissions_password=password"
curl -X POST "YOUR_DOMAIN_HERE/restricted-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=restricted_out" -F "new_permissions_password=password" -F "restrictions[]=print_low" -F "restrictions[]=edit_content"
curl -X POST "YOUR_DOMAIN_HERE/restricted-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_out" -F "new_permissions_password=mypermspassword" -F "current_open_password=myopenpassword" -F "restrictions[]=accessibility_off"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
new_permissions_password
string required
New permissions password
Accepts: A string between 6 and 128 characters long
Example:igy4e5ds7g87646fYFtfTFdh78g6DR
Default:None
current_permissions_password
string
Existing permissions password
Accepts: A valid password
Example:passwordpassword123
Default:None
restrictions[]
array
Document restrictions to be applied. Restricted operations are locked behind the permissions password when interacting with a restricted document.
Accepts:
  • print_low
  • print_high
  • edit_document_assembly
  • edit_fill_and_sign_form_fields
  • edit_annotations
  • edit_content
  • copy_content
  • accessibility_off

Example:edit_content
Default:None
current_open_password
string
Existing open password
Accepts: A valid password
Example:openfileplease
Default:None
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_restricted-pdf
endpoint: POST /restricted-pdf
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "new_permissions_password"
      location: "body"
      type: "string"
      required: true
      description: "New permissions password"
      accepts: "A string between 6 and 128 characters long"
      example: "igy4e5ds7g87646fYFtfTFdh78g6DR"
      default: "None"
    - name: "current_permissions_password"
      location: "body"
      type: "string"
      required: false
      description: "Existing permissions password"
      accepts: "A valid password"
      example: "passwordpassword123"
      default: "None"
    - name: "restrictions[]"
      location: "body"
      type: "array"
      required: false
      description: "Document restrictions to be applied. Restricted operations are locked behind the permissions password when interacting with a restricted document."
      accepts:
        - "print_low"
        - "print_high"
        - "edit_document_assembly"
        - "edit_fill_and_sign_form_fields"
        - "edit_annotations"
        - "edit_content"
        - "copy_content"
        - "accessibility_off"
      example: "edit_content"
      default: "None"
    - name: "current_open_password"
      location: "body"
      type: "string"
      required: false
      description: "Existing open password"
      accepts: "A valid password"
      example: "openfileplease"
      default: "None"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_restricted-pdf"

Responses


POST /unrestricted-pdf

Summary

Remove all document security restrictions from a PDF.

NOTE: Removing the permissions password will normally remove all existing security data, including the open password. Use "current_open_password" to keep encryption with an already applied open password.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/unrestricted-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_out" -F "current_permissions_password=password"
curl -X POST "YOUR_DOMAIN_HERE/unrestricted-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_out" -F "current_permissions_password=password"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
current_permissions_password
string required
Existing permissions password
Accepts: A valid password
Example:kugdi9785gudw242FGdfdh
Default:None
current_open_password
string
Existing open password
Accepts: A valid password
Example:thisIsThePassword
Default:None
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_unrestricted-pdf
endpoint: POST /unrestricted-pdf
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "current_permissions_password"
      location: "body"
      type: "string"
      required: true
      description: "Existing permissions password"
      accepts: "A valid password"
      example: "kugdi9785gudw242FGdfdh"
      default: "None"
    - name: "current_open_password"
      location: "body"
      type: "string"
      required: false
      description: "Existing open password"
      accepts: "A valid password"
      example: "thisIsThePassword"
      default: "None"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_unrestricted-pdf"

Responses


POST /merged-pdf

Summary

Merges multiple PDF documents or specified pages from PDF documents into a single PDF document. Any number of PDFs may be merged by specifying "file" and/or "id" paramaters multiple times. Files will be merged in the order they are specified.

NOTE: For each included "file" or "id" a corresponding "pages" and "type" must also be included to correspond to the type and desired page(s) for that input file.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/merged-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file1.pdf" -F "pages[]=1-7" -F "type[]=file" -F "file=@PATH_TO_FILE/example_file.pdf2" -F "pages[]=2-last" -F "type[]=file" -F "file=@PATH_TO_FILE/example_file3.pdf" -F "pages[]=2,4,6,8" -F "type[]=file" -F "output=example_out"
curl -X POST "YOUR_DOMAIN_HERE/merged-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "id[]=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "pages[]=1,5-8" -F "type[]=id" -F "id[]=0kd720sdh-3756-s92j-lg0s-0z9m31js68c9" -F "pages[]=last-1" -F "type[]=id" -F "output=file_out"
curl -X POST "YOUR_DOMAIN_HERE/merged-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file1.pdf" -F "pages[]=1-7" -F "type[]=file" -F "id[]=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "pages[]=1,5-8" -F "type[]=id" -F "id[]=0kd720sdh-3756-s92j-lg0s-0z9m31js68c9" -F "pages[]=last-1" -F "type[]=id" "file=@PATH_TO_FILE/example_file.pdf2" -F "pages[]=2-last" -F "type[]=file" -F "output=file_out"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and merged with other files. This parameter may be included multiple times to specify multiple files to be merged.
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One or more of:
  • file
  • id[]
id[]
uuid[]
Alphanumeric ID (UUID) of existing file on server to be merged with other files. This parameter may be included multiple times to specify multiple files to be merged.
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One or more of:
  • file
  • id[]
pages[]
array required
Page or range of pages to include in merged file. This parameter must be specified for each "file" and "id" specified.
Accepts: Any mix of individual pages and/or ranges seperated by commas. last can be used to represent the number of the last page of the document. Page order can be reversed using ranges with the higher number specified before the lower number.
Example:
  • 14-last
  • 9-2
  • 1,2,5-10,12-last
  • even
  • odd

Default:None
type[]
array required
This parameter must be specified for each "file" and "id" specified and indicates whether a document is a new file to upload or an id for an existing file on the server. This is required to maintain the order of documents to merge.
Accepts:
  • file
  • id

Default:None
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:pdfrest_merged-pdf
endpoint: POST /merged-pdf
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and merged with other files. This parameter may be included multiple times to specify multiple files to be merged."
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "One or more of:"
        - "file"
        - "id[]"
    - name: "id[]"
      location: "body"
      type: "uuid[]"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be merged with other files. This parameter may be included multiple times to specify multiple files to be merged."
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "One or more of:"
        - "file"
        - "id[]"
    - name: "pages[]"
      location: "body"
      type: "array"
      required: true
      description: "Page or range of pages to include in merged file. This parameter must be specified for each \"file\" and \"id[]\" specified."
      accepts: "Any mix of individual pages and/or ranges seperated by commas. `last` can be used to represent the number of the last page of the document. Page order can be reversed using ranges with the higher number specified before the lower number."
      example:
        - "14-last"
        - "9-2"
        - "1,2,5-10,12-last"
        - "even"
        - "odd"
      default: "None"
    - name: "type[]"
      location: "body"
      type: "array"
      required: true
      description: "This parameter must be specified for each \"file\" and \"id[]\" specified and indicates whether a document is a new file to upload or an id for an existing file on the server. This is required to maintain the order of documents to merge."
      accepts:
        - "file"
        - "id"
      default: "None"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "pdfrest_merged-pdf"

Responses


POST /split-pdf

Summary

Splits a single PDF document into one or more PDF documents with specified pages. Any number of PDFs may be split out from the original PDF by including "pages" multiple times. Output files will be returned in the order they are included.

NOTE: If "pages" is not specified, an output file will be created for each page of the input file containing only that page. A ten page PDF would be split into ten single-page PDFs.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/split-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf"
curl -X POST "YOUR_DOMAIN_HERE/split-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "pages[]=3-last" -F "pages[]=2,4,6,9" -F "output=file_out"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and split into new files.
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be split into new files.
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
pages[]
array
Page or range of pages to include in output file. This parameter may be specified multiple times to create multiple output files. If this paramater is not specified, an output file will be created for each page of the input file containing only that page.
Accepts: Any mix of individual pages and/or ranges seperated by commas. last can be used to represent the number of the last page of the document. Page order can be reversed using ranges with the higher number specified before the lower number.
Example:
  • 14-last
  • 2-9
  • 1,2,10-5,12-last
  • even
  • odd

Default:None
output
string
Prefix of the generated output file name(s), without extension. A sequentially incremented number will be appended to the end of this prefix for each output file name along with a .pdf extension.
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_split-pdf
endpoint: POST /split-pdf
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and split into new files."
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be split into new files."
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "pages[]"
      location: "body"
      type: "array"
      required: false
      description: "Page or range of pages to include in output file. This parameter may be specified multiple times to create multiple output files. If this paramater is not specified, an output file will be created for each page of the input file containing only that page."
      accepts: "Any mix of individual pages and/or ranges seperated by commas. `last` can be used to represent the number of the last page of the document. Page order can be reversed using ranges with the higher number specified before the lower number."
      example:
        - "14-last"
        - "2-9"
        - "1,2,10-5,12-last"
        - "even"
        - "odd"
      default: "None"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Prefix of the generated output file name(s), without extension. A sequentially incremented number will be appended to the end of this prefix for each output file name along with a .pdf extension."
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_split-pdf"

Responses


POST /blank-pdf

Summary

Creates a new, blank PDF document with precisely defined page size, page count, and orientation. This tool is the foundational first step for programmatic PDF generation.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/blank-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "page_size=letter" -F "page_count=5" -F "page_orientation=portrait" -F "output=new_document"
curl -X POST "YOUR_DOMAIN_HERE/blank-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "page_size=custom" -F "custom_height=792" -F "custom_width=612" -F "page_count=12"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

page_size
string required
Standard or custom size for the pages in the new document.
Accepts: Choose from: letter, legal, ledger, A3, A4, A5, custom
Example:letter
Default:None
page_count
integer required
Number of pages within the output document (max: 1000).
Accepts: Integer between 1 and 1000
Example:5
Default:None
page_orientation
string
Page orientation for standard sizes. Required only if page_size is not custom.
Accepts: Choose from: portrait, landscape
Example:landscape
Default:None
custom_height
number
Document page height in PDF units (72 PDF units = 1 inch). Required only if page_size is custom.
Accepts: Any positive number
Example:792
Default:None
custom_width
number
Document page width in PDF units (72 PDF units = 1 inch). Required only if page_size is custom.
Accepts: Any positive number
Example:612
Default:None
output
string
Output name of the new file, without extension.
Accepts: Any valid file name
Example:new_custom_document
Default:pdfrest_blank-pdf
endpoint: POST /blank-pdf
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "page_size"
      location: "body"
      type: "string"
      required: true
      description: "Standard or custom size for the pages in the new document."
      accepts: "Choose from: letter, legal, ledger, A3, A4, A5, custom"
      example: "letter"
      default: "None"
    - name: "page_count"
      location: "body"
      type: "integer"
      required: true
      description: "Number of pages within the output document (max: 1000)."
      accepts: "Integer between 1 and 1000"
      example: "5"
      default: "None"
    - name: "page_orientation"
      location: "body"
      type: "string"
      required: false
      description: "Page orientation for standard sizes. Required only if page_size is not custom."
      accepts: "Choose from: portrait, landscape"
      example: "landscape"
      default: "None"
    - name: "custom_height"
      location: "body"
      type: "number"
      required: false
      description: "Document page height in PDF units (72 PDF units = 1 inch). Required only if page_size is custom."
      accepts: "Any positive number"
      example: "792"
      default: "None"
    - name: "custom_width"
      location: "body"
      type: "number"
      required: false
      description: "Document page width in PDF units (72 PDF units = 1 inch). Required only if page_size is custom."
      accepts: "Any positive number"
      example: "612"
      default: "None"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Output name of the new file, without extension."
      accepts: "Any valid file name"
      example: "new_custom_document"
      default: "pdfrest_blank-pdf"

Responses


POST /pdf-with-added-text

Summary

Inserts text blocks into a PDF at specified locations with custom settings for font and styling. NOTE: The PDF coordinate system places the origin in the lower-left corner. Coordinates are in PDF units (1 in. = 72 PDF units). Please note that PDFs with offset origins may create an offset in the placement of the text.

Learn More Try in API Lab

Examples

TEXT_OPTIONS='[{"font":"Times New Roman","max_width":"175","opacity":"1","page":"1","rotation":"0","text":"sample text in PDF","text_color_rgb":"0,0,0","text_size":"30","x":"72","y":"144"}]'
curl -X POST "YOUR_DOMAIN_HERE/pdf-with-added-text" \
 -H "Accept: application/json" \
 -H "Content-Type: multipart/form-data" \
 -F "file=@/path/to/file" \
 -F "text_objects=$TEXT_OPTIONS" \
 -F "output=example_out"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
PDF file to be uploaded for text to be added.
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing PDF file on server for text to be added.
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
text_objects
string required
JSON-formatted string consisting of an array of one or more objects containing options to add and format text.
Accepts:
  • font - String | Required | Specify the font of the given string. See Font List for a complete list.
  • max_width - String | Required | The maximum width of the text column in PDF Units (72 PDF Units = 1 inch). The text will wrap to conform to this width.
  • opacity - String | Required | Text opacity (0.0 - 1.0)
  • page - String | Required | Page number on which to add text. You can provide a page number, or you can use "all" to add the text to every page at the same X/Y position.
  • rotation - String | Required | Rotation in degrees of the text block
  • text - String | Required | String of text to add
  • text_color_cmyk or text_color_rgb - String | Required | Comma-delineated string of color values (RGB example - "53,5,102", CMYK example - "0,100,100,0"). Use one of these to set the text color.
  • text_size - String | Required | Font size of the text (5 - 100)
  • x - String | Required | Horizontal starting position of the text in PDF Units (72 PDF Units = 1 inch)
  • y - String | Required | Vertical starting position of the text in PDF Units (72 PDF Units = 1 inch)
  • is_rtl - String | Optional | Set to "true" to insert right-to-left (RTL) language text

Example:[ { "font":"Arial", "max_width":"100", "opacity":"1", "page":"all", "rotation":"80", "text":"Hello, PDF world!", "text_color_rgb":"0,0,0", "text_size":"12", "x":"144", "y":"144" }, { "font":"Times New Roman", "max_width":"100", "opacity":"1", "page":"all", "rotation":"0", "text":"שלום עולם", "text_color_rgb":"128,0,2", "text_size":"72", "x":"144", "y":"720", "is_rtl":"true" } ]
Default:None
output
string
Name of the generated output file, without extension.
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_pdf-with-added-text
endpoint: POST /pdf-with-added-text
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "PDF file to be uploaded for text to be added."
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing PDF file on server for text to be added."
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "text_objects"
      location: "body"
      type: "string"
      required: true
      description: "JSON-formatted string consisting of an array of one or more objects containing options to add and format text."
      accepts:
        - "`font` - String | Required | Specify the font of the given string. See [Font List](https://pdfrest.com/documentation/fontlist/) for a complete list."
        - "`max_width` - String | Required | The maximum width of the text column in PDF Units (72 PDF Units = 1 inch). The text will wrap to conform to this width."
        - "`opacity` - String | Required | Text opacity (0.0 - 1.0)"
        - "`page` - String | Required | Page number on which to add text. You can provide a page number, or you can use \"all\" to add the text to every page at the same X/Y position."
        - "`rotation` - String | Required | Rotation in degrees of the text block"
        - "`text` - String | Required | String of text to add"
        - "`text_color_cmyk` or `text_color_rgb` - String | Required | Comma-delineated string of color values (RGB example - \"53,5,102\", CMYK example - \"0,100,100,0\"). Use one of these to set the text color."
        - "`text_size` - String | Required | Font size of the text (5 - 100)"
        - "`x` - String | Required | Horizontal starting position of the text in PDF Units (72 PDF Units = 1 inch)"
        - "`y` - String | Required | Vertical starting position of the text in PDF Units (72 PDF Units = 1 inch)"
        - "`is_rtl` - String | Optional | Set to \"true\" to insert right-to-left (RTL) language text"
      example:
        - "["
        - "{"
        - "\"font\":\"Arial\","
        - "\"max_width\":\"100\","
        - "\"opacity\":\"1\","
        - "\"page\":\"all\","
        - "\"rotation\":\"80\","
        - "\"text\":\"Hello, PDF world!\","
        - "\"text_color_rgb\":\"0,0,0\","
        - "\"text_size\":\"12\","
        - "\"x\":\"144\","
        - "\"y\":\"144\""
        - "},"
        - "{"
        - "\"font\":\"Times New Roman\","
        - "\"max_width\":\"100\","
        - "\"opacity\":\"1\","
        - "\"page\":\"all\","
        - "\"rotation\":\"0\","
        - "\"text\":\"שלום עולם\","
        - "\"text_color_rgb\":\"128,0,2\","
        - "\"text_size\":\"72\","
        - "\"x\":\"144\","
        - "\"y\":\"720\","
        - "\"is_rtl\":\"true\""
        - "}"
        - "]"
      default: "None"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension."
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_pdf-with-added-text"

Responses


POST /pdf-with-added-image

Summary

Inserts an image into one page of a PDF at a specified location. Accepted image formats:

  • JPEG (.jpg, .jpeg)
  • TIF (.tif, .tiff)
  • PNG (.png)
  • GIF (.gif)

NOTE: The PDF coordinate system places the origin in the lower-left corner. Coordinates are in PDF units (1 in. = 72 PDF units). Please note that PDFs with offset origins may create an offset in the placement of the image.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/pdf-with-added-image" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "image_file=@PATH_TO_FILE/example_file.jpg" -F "output=example_output" -F "page=1" -F "x=72" -F "y=72"
curl -X POST "YOUR_DOMAIN_HERE/pdf-with-added-image" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "image_id=01983abb7-ef44-ffaa-01ee-0b892f14a456" -F "output=example_output" -F "page=3" -F "x=144" -F "y=36"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
PDF file to be uploaded for an image to be added.
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing PDF file on server for an image to be added.
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
image_file
file
Image file to be uploaded and added to the PDF.
Accepts: Any image file of supported format (JPEG, TIFF, PNG, GIF).
Example:@PATH_TO_FILE/add_this.jpg
Default:None
Requirement: One of:
  • image_file
  • image_id
image_id
uuid
Alphanumeric ID (UUID) of existing image file on server to be added to the PDF.
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • image_file
  • image_id
x
integer required
Horizontal position of the image (by its lower-left corner) in PDF units (72 PDF units = 1 inch)
Accepts: Any integer value
Example:72
Default:None
y
integer required
Vertical position of the image (by its lower-left corner) in PDF units (72 PDF units = 1 inch)
Accepts: Any integer value
Example:144
Default:None
page
integer required
Page of the PDF to add the image into
Accepts: Any valid page number for the PDF file being processed
Example:1
Default:None
output
string
Name of the generated output file, without extension.
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_pdf-with-added-image
endpoint: POST /pdf-with-added-image
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "PDF file to be uploaded for an image to be added."
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing PDF file on server for an image to be added."
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "image_file"
      location: "body"
      type: "file"
      required: conditional
      description: "Image file to be uploaded and added to the PDF."
      accepts: "Any image file of supported format (JPEG, TIFF, PNG, GIF)."
      example: "@PATH_TO_FILE/add_this.jpg"
      default: "None"
      requirement:
        - "image_file"
        - "image_id"
    - name: "image_id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing image file on server to be added to the PDF."
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "image_file"
        - "image_id"
    - name: "x"
      location: "body"
      type: "integer"
      required: true
      description: "Horizontal position of the image (by its lower-left corner) in PDF units (72 PDF units = 1 inch)"
      accepts: "Any integer value"
      example: "72"
      default: "None"
    - name: "y"
      location: "body"
      type: "integer"
      required: true
      description: "Vertical position of the image (by its lower-left corner) in PDF units (72 PDF units = 1 inch)"
      accepts: "Any integer value"
      example: "144"
      default: "None"
    - name: "page"
      location: "body"
      type: "integer"
      required: true
      description: "Page of the PDF to add the image into"
      accepts: "Any valid page number for the PDF file being processed"
      example: "1"
      default: "None"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension."
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_pdf-with-added-image"

Responses


POST /pdf-with-added-attachment

Summary

Attaches a file to a PDF document.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/pdf-with-added-attachment" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "file_to_attach=@PATH_TO_FILE/example_file.jpg" -F "output=example_output"
curl -X POST "YOUR_DOMAIN_HERE/pdf-with-added-attachment" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "file_to_attach=01983abb7-ef44-ffaa-01ee-0b892f14a456" -F "output=example_output"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
PDF file to be uploaded for an attachment to be added.
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing PDF file on server for an attachment to be added.
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
file_to_attach
file
File to be uploaded and attached to the PDF.
Accepts: Any file that can be attached to a PDF
Example:@PATH_TO_FILE/add_this.jpg
Default:None
Requirement: One of:
  • file_to_attach
  • id_to_attach
id_to_attach
uuid
Alphanumeric ID (UUID) of existing file on server to be attached to the PDF.
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file_to_attach
  • id_to_attach
output
string
Name of the generated output file, without extension.
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_pdf-with-added-attachment
endpoint: POST /pdf-with-added-attachment
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "PDF file to be uploaded for an attachment to be added."
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing PDF file on server for an attachment to be added."
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "file_to_attach"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and attached to the PDF."
      accepts: "Any file that can be attached to a PDF"
      example: "@PATH_TO_FILE/add_this.jpg"
      default: "None"
      requirement:
        - "file_to_attach"
        - "id_to_attach"
    - name: "id_to_attach"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be attached to the PDF."
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file_to_attach"
        - "id_to_attach"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension."
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_pdf-with-added-attachment"

Responses


POST /bmp

Summary

Convert PDF to BMP image files, one per PDF page

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/bmp" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_out"
curl -X POST "YOUR_DOMAIN_HERE/bmp" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=bmp_out" -F "pages=2-9" -F "resolution=900" -F "color_model=gray"
curl -X POST "YOUR_DOMAIN_HERE/bmp" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=bmp_out" -F "pages=2-9" -F "resolution=900" -F "color_model=gray"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF File
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
output
string
Prefix of the generated output file name(s), without extension. A sequentially incremented number will be appended to the end of this prefix for each output file name along with a .bmp extension.
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_bmp
pages
string
Page or range of pages to process
Accepts: Any mix of individual pages and/or ranges seperated by commas. last can be used to represent the number of the last page of the document.
Example:
  • 14-last
  • 2-9
  • 1,2,5-10,12-last

Default:1-last (all pages)
resolution
integer
Output image resolution in Dots Per Inch (DPI)
Accepts: 12 to 2400
Default:300
color_model
string
Color model of the output file
Accepts:
  • rgb
  • gray

Default:rgb
endpoint: POST /bmp
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF File"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Prefix of the generated output file name(s), without extension. A sequentially incremented number will be appended to the end of this prefix for each output file name along with a .bmp extension."
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_bmp"
    - name: "pages"
      location: "body"
      type: "string"
      required: false
      description: "Page or range of pages to process"
      accepts: "Any mix of individual pages and/or ranges seperated by commas. `last` can be used to represent the number of the last page of the document."
      example:
        - "14-last"
        - "2-9"
        - "1,2,5-10,12-last"
      default:
        - "1-last"
        - "(all pages)"
    - name: "resolution"
      location: "body"
      type: "integer"
      required: false
      description: "Output image resolution in Dots Per Inch (DPI)"
      accepts: "12 to 2400"
      default: "300"
    - name: "color_model"
      location: "body"
      type: "string"
      required: false
      description: "Color model of the output file"
      accepts:
        - "rgb"
        - "gray"
      default: "rgb"

Responses


POST /jpg

Summary

Convert PDF to JPEG image files, one per PDF page

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/jpg" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_out"
curl -X POST "YOUR_DOMAIN_HERE/jpg" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=jpg_out" -F "pages=2-9" -F "resolution=900" -F "color_model=gray" -F "jpeg_quality=100"
curl -X POST "YOUR_DOMAIN_HERE/jpg" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_out" -F "pages=1,3-last" -F "jpeg_quality=25" -F "color_model=cmyk"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF File
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
output
string
Prefix of the generated output file name(s), without extension. A sequentially incremented number will be appended to the end of this prefix for each output file name along with a .jpg extension.
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_jpg
pages
string
Page or range of pages to process
Accepts: Any mix of individual pages and/or ranges seperated by commas. last can be used to represent the number of the last page of the document.
Example:
  • 14-last
  • 2-9
  • 1,2,5-10,12-last

Default:1-last (all pages)
resolution
integer
Output image resolution in Dots Per Inch (DPI)
Accepts: 12 to 2400
Default:300
color_model
string
Color model of the output file
Accepts:
  • rgb
  • cmyk
  • gray

Default:rgb
jpeg_quality
integer
JPEG compression quality. Higher values produce a higher quality image but also a larger output file size.
Accepts: 1 to 100
Default:75
endpoint: POST /jpg
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF File"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Prefix of the generated output file name(s), without extension. A sequentially incremented number will be appended to the end of this prefix for each output file name along with a .jpg extension."
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_jpg"
    - name: "pages"
      location: "body"
      type: "string"
      required: false
      description: "Page or range of pages to process"
      accepts: "Any mix of individual pages and/or ranges seperated by commas. `last` can be used to represent the number of the last page of the document."
      example:
        - "14-last"
        - "2-9"
        - "1,2,5-10,12-last"
      default:
        - "1-last"
        - "(all pages)"
    - name: "resolution"
      location: "body"
      type: "integer"
      required: false
      description: "Output image resolution in Dots Per Inch (DPI)"
      accepts: "12 to 2400"
      default: "300"
    - name: "color_model"
      location: "body"
      type: "string"
      required: false
      description: "Color model of the output file"
      accepts:
        - "rgb"
        - "cmyk"
        - "gray"
      default: "rgb"
    - name: "jpeg_quality"
      location: "body"
      type: "integer"
      required: false
      description: "JPEG compression quality. Higher values produce a higher quality image but also a larger output file size."
      accepts: "1 to 100"
      default: "75"

Responses


POST /png

Summary

Convert PDF to PNG image files, one per PDF page

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/png" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_out"
curl -X POST "YOUR_DOMAIN_HERE/png" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=png_out" -F "pages=2-9" -F "resolution=900" -F "color_model=gray"
curl -X POST "YOUR_DOMAIN_HERE/png" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_out" -F "pages=2-last" -F "color_model=rgba"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF File
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
output
string
Prefix of the generated output file name(s), without extension. A sequentially incremented number will be appended to the end of this prefix for each output file name along with a .png extension.
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_png
pages
string
Page or range of pages to process
Accepts: Any mix of individual pages and/or ranges seperated by commas. last can be used to represent the number of the last page of the document.
Example:
  • 14-last
  • 2-9
  • 1,2,5-10,12-last

Default:1-last (all pages)
resolution
integer
Output image resolution in Dots Per Inch (DPI)
Accepts: 12 to 2400
Default:300
color_model
string
Color model of the output file
Accepts:
  • rgb
  • rgba
  • gray

Default:rgb
endpoint: POST /png
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF File"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Prefix of the generated output file name(s), without extension. A sequentially incremented number will be appended to the end of this prefix for each output file name along with a .png extension."
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_png"
    - name: "pages"
      location: "body"
      type: "string"
      required: false
      description: "Page or range of pages to process"
      accepts: "Any mix of individual pages and/or ranges seperated by commas. `last` can be used to represent the number of the last page of the document."
      example:
        - "14-last"
        - "2-9"
        - "1,2,5-10,12-last"
      default:
        - "1-last"
        - "(all pages)"
    - name: "resolution"
      location: "body"
      type: "integer"
      required: false
      description: "Output image resolution in Dots Per Inch (DPI)"
      accepts: "12 to 2400"
      default: "300"
    - name: "color_model"
      location: "body"
      type: "string"
      required: false
      description: "Color model of the output file"
      accepts:
        - "rgb"
        - "rgba"
        - "gray"
      default: "rgb"

Responses


POST /gif

Summary

Convert PDF to GIF image files, one per PDF page

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/gif" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_out"
curl -X POST "YOUR_DOMAIN_HERE/gif" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=gif_out" -F "pages=2-9,20" -F "resolution=1200" -F "color_model=rgb"
curl -X POST "YOUR_DOMAIN_HERE/gif" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_out" -F "pages=2-last" -F "color_model=gray"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF File
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
output
string
Prefix of the generated output file name(s), without extension. A sequentially incremented number will be appended to the end of this prefix for each output file name along with a .gif extension.
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_gif
pages
string
Page or range of pages to process
Accepts: Any mix of individual pages and/or ranges seperated by commas. last can be used to represent the number of the last page of the document.
Example:
  • 14-last
  • 2-9
  • 1,2,5-10,12-last

Default:1-last (all pages)
resolution
integer
Output image resolution in Dots Per Inch (DPI)
Accepts: 12 to 2400
Default:300
color_model
string
Color model of the output file
Accepts:
  • rgb
  • gray

Default:rgb
endpoint: POST /gif
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF File"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Prefix of the generated output file name(s), without extension. A sequentially incremented number will be appended to the end of this prefix for each output file name along with a .gif extension."
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_gif"
    - name: "pages"
      location: "body"
      type: "string"
      required: false
      description: "Page or range of pages to process"
      accepts: "Any mix of individual pages and/or ranges seperated by commas. `last` can be used to represent the number of the last page of the document."
      example:
        - "14-last"
        - "2-9"
        - "1,2,5-10,12-last"
      default:
        - "1-last"
        - "(all pages)"
    - name: "resolution"
      location: "body"
      type: "integer"
      required: false
      description: "Output image resolution in Dots Per Inch (DPI)"
      accepts: "12 to 2400"
      default: "300"
    - name: "color_model"
      location: "body"
      type: "string"
      required: false
      description: "Color model of the output file"
      accepts:
        - "rgb"
        - "gray"
      default: "rgb"

Responses


POST /tif

Summary

Convert PDF to TIFF image files, one per PDF page

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/tif" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_out"
curl -X POST "YOUR_DOMAIN_HERE/tif" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=tif_out" -F "pages=3,5,7" -F "resolution=2400" -F "color_model=cmyk"
curl -X POST "YOUR_DOMAIN_HERE/tif" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_out" -F "pages=1,9-last" -F "color_model=lab"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF File
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
output
string
Prefix of the generated output file name(s), without extension. A sequentially incremented number will be appended to the end of this prefix for each output file name along with a .tif extension.
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_tif
pages
string
Page or range of pages to process
Accepts: Any mix of individual pages and/or ranges seperated by commas. last can be used to represent the number of the last page of the document.
Example:
  • 14-last
  • 2-9
  • 1,2,5-10,12-last

Default:1-last (all pages)
resolution
integer
Output image resolution in Dots Per Inch (DPI)
Accepts: 12 to 2400
Default:300
color_model
string
Color model of the output file
Accepts:
  • rgb
  • rgba
  • cmyk
  • lab
  • gray

Default:rgb
endpoint: POST /tif
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF File"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Prefix of the generated output file name(s), without extension. A sequentially incremented number will be appended to the end of this prefix for each output file name along with a .tif extension."
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_tif"
    - name: "pages"
      location: "body"
      type: "string"
      required: false
      description: "Page or range of pages to process"
      accepts: "Any mix of individual pages and/or ranges seperated by commas. `last` can be used to represent the number of the last page of the document."
      example:
        - "14-last"
        - "2-9"
        - "1,2,5-10,12-last"
      default:
        - "1-last"
        - "(all pages)"
    - name: "resolution"
      location: "body"
      type: "integer"
      required: false
      description: "Output image resolution in Dots Per Inch (DPI)"
      accepts: "12 to 2400"
      default: "300"
    - name: "color_model"
      location: "body"
      type: "string"
      required: false
      description: "Color model of the output file"
      accepts:
        - "rgb"
        - "rgba"
        - "cmyk"
        - "lab"
        - "gray"
      default: "rgb"

Responses


POST /pdf-with-page-boxes-set

Summary

Set one or more PDF page boundary boxes, including the MediaBox (page size), CropBox (visible content area for cropping PDF and removing white space), BleedBox (extra margin for professional printing with bleed), TrimBox (final printed page dimensions), and ArtBox (boundary of the artwork or content).

Learn More Try in API Lab

Example

BOXES='{"boxes":{"box":"media","pages":{"range":"1","left":100,"top":100,"bottom":100,"right":100}}}' curl -X POST "YOUR_DOMAIN_HERE/pdf-with-page-boxes-set"
-H "Accept: application/json"
-H "Content-Type: multipart/form-data"
-F "file=@/path/to/file"
-F "boxes=$BOXES"
-F "output=example_out.pdf"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
boxes
string required
JSON string structured to define the page boundary boxes to be set.This JSON string should contain a top-level "boxes" key, whose value is an array of box definition objects. Each of these objects requires a "box" key, specifying the type of box to modify (e.g., "media", "crop", "bleed", "trim", "art"), and a "pages" key. The "pages" key holds an array of page specifications, allowing you to target specific page ranges with corresponding margin adjustments.Each page specification object within the "pages" array must include a "range" key, which can accept a single page number ("1"), a page range ("1-3"), "all", "even", "odd", or include "last" (e.g., "2-last"). Additionally, each page specification object should contain "top", "bottom", "left", and "right" keys, defining the margin values (in PDF Units, where 72 PDF Units = 1 inch) to apply for the specified box type and page range. Margins are relative to the current MediaBox and must be positive values. For MediaBox only, negative values can be used to increase the page size.
Accepts:
boxes - String | Required | A JSON string containing an array of box definition objects. Each object defines a specific page boundary box to modify.
boxes.box - String | Required | Specifies the type of page boundary box to modify. Accepted values are "media", "crop", "bleed", "trim", and "art".
boxes.pages - String | Required | An array of page specification objects. Each object defines the page range and the corresponding margin adjustments for the specified box type.
boxes.pages.range - String | Required | Specifies the page or range of pages to which the margin adjustments will be applied. Accepts a single page number ("1"), a page range ("1-3"), "all" to apply to every page, "even" for even-numbered pages, "odd" for odd-numbered pages, or ranges including "last" (e.g., "2-last").
boxes.pages.top - Number | Required | The top margin adjustment to apply, in positive PDF Units (72 PDF Units = 1 inch) relative to the current MediaBox. For MediaBox only, negative values can be used to increase the page size.
boxes.pages.bottom - Number | Required | The bottom margin adjustment to apply, in positive PDF Units (72 PDF Units = 1 inch) relative to the current MediaBox. For MediaBox only, negative values can be used to increase the page size.
boxes.pages.left - Number | Required | The left margin adjustment to apply, in positive PDF Units (72 PDF Units = 1 inch) relative to the current MediaBox. For MediaBox only, negative values can be used to increase the page size.
boxes.pages.right - Number | Required | The right margin adjustment to apply, in positive PDF Units (72 PDF Units = 1 inch) relative to the current MediaBox. For MediaBox only, negative values can be used to increase the page size.
Example:{ "boxes": { "box": "crop", "pages": [ { "range": "1-10", "left": 72, "top": 36, "bottom": 36, "right": 72 }, { "range": "11-last", "left": 72, "top": 72, "bottom": 72, "right": 72 } ] }, { "box": "bleed", "pages": [ { "range": "1-last", "left": 144, "top": 144, "bottom": 144, "right": 144 } ] } }
Default:None
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_pdf-with-page-boxes-set
endpoint: POST /pdf-with-page-boxes-set
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "boxes"
      location: "body"
      type: "string"
      required: true
      description: "JSON string structured to define the page boundary boxes to be set."
      accepts:
        - "-"
        - "**boxes** - String | Required | A JSON string containing an array of box definition objects. Each object defines a specific page boundary box to modify."
        - "-"
        - "**boxes[].box** - String | Required | Specifies the type of page boundary box to modify. Accepted values are \"media\", \"crop\", \"bleed\", \"trim\", and \"art\"."
        - "-"
        - "**boxes[].pages** - String | Required | An array of page specification objects. Each object defines the page range and the corresponding margin adjustments for the specified box type."
        - "-"
        - "**boxes[].pages[].range** - String | Required | Specifies the page or range of pages to which the margin adjustments will be applied. Accepts a single page number (\"1\"), a page range (\"1-3\"), \"all\" to apply to every page, \"even\" for even-numbered pages, \"odd\" for odd-numbered pages, or ranges including \"last\" (e.g., \"2-last\")."
        - "-"
        - "**boxes[].pages[].top** - Number | Required | The top margin adjustment to apply, in positive PDF Units (72 PDF Units = 1 inch) relative to the current MediaBox. For MediaBox only, negative values can be used to increase the page size."
        - "-"
        - "**boxes[].pages[].bottom** - Number | Required | The bottom margin adjustment to apply, in positive PDF Units (72 PDF Units = 1 inch) relative to the current MediaBox. For MediaBox only, negative values can be used to increase the page size."
        - "-"
        - "**boxes[].pages[].left** - Number | Required | The left margin adjustment to apply, in positive PDF Units (72 PDF Units = 1 inch) relative to the current MediaBox. For MediaBox only, negative values can be used to increase the page size."
        - "-"
        - "**boxes[].pages[].right** - Number | Required | The right margin adjustment to apply, in positive PDF Units (72 PDF Units = 1 inch) relative to the current MediaBox. For MediaBox only, negative values can be used to increase the page size."
      example:
        - "{"
        - "\"boxes\": ["
        - "{"
        - "\"box\": \"crop\","
        - "\"pages\": ["
        - "{"
        - "\"range\": \"1-10\","
        - "\"left\": 72,"
        - "\"top\": 36,"
        - "\"bottom\": 36,"
        - "\"right\": 72"
        - "},"
        - "{"
        - "\"range\": \"11-last\","
        - "\"left\": 72,"
        - "\"top\": 72,"
        - "\"bottom\": 72,"
        - "\"right\": 72"
        - "}"
        - "]"
        - "},"
        - "{"
        - "\"box\": \"bleed\","
        - "\"pages\": ["
        - "{"
        - "\"range\": \"1-last\","
        - "\"left\": 144,"
        - "\"top\": 144,"
        - "\"bottom\": 144,"
        - "\"right\": 144"
        - "}"
        - "]"
        - "}"
        - "]"
        - "}"
      default: "None"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_pdf-with-page-boxes-set"

Responses


POST /pdf-with-converted-colors

Summary

Convert PDF colors with precise document color control through custom ICC profiles and a library of print, screen, web, and grayscale presets.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/pdf-with-converted-colors" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=bw_out" -F "color_profile=dot-gain-10"
curl -X POST "YOUR_DOMAIN_HERE/pdf-with-converted-colors" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=cmyk_out" -F "color_profile=acrobat5-cmyk"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
color_profile
string required
Choose from any of the preset color profiles, or select custom to supply an ICC color profile
Accepts:
  • lab-d50 - Lab color specification with a D50 white point. The Lab color space is based on the CIE XYZ color space, but it includes a dimension L, for lightness, along with a and b coordinates, to define the color. This is Adobe Systems’ standard Lab profile.
  • srgb - Standard RGB, the default profile for Windows monitors.
  • apple-rgb - Apple RGB, the default profile for Mac monitors
  • color-match-rgb - Color Match RGB. This is a simpler version of the Radius ColorMatch RGB space, without the non-zero black point.
  • gamma-18 - Gray Gamma 1.8, grayscale display profile, used for content viewed on a monitor
  • gamma-22 - Gray Gamma 2.2
  • dot-gain-10 - Grayscale printer profile, with dot gain 10%. Dot gain is commonly used in offset printing to define the increase in size in halftone dots in the printing process, making a printed document look darker than intended.
  • dot-gain-15 - Dot gain 15%
  • dot-gain-20 - Dot gain 20%
  • dot-gain-25 - Dot gain 25%
  • dot-gain-30 - Dot gain 30%
  • monitor-rgb - RGB Monitor, referring to a monitor that requires separate signals for the three primary colors.
  • acrobat5-cmyk - Adobe Reader 5 CMYK
  • acrobat9-cmyk - Adobe Reader 9 CMYK
  • custom - supply a custom ICC color profile with either the profile or profile_id parameter

Example:acrobat9-cmyk
Default:None
profile
string
Select a local ICC color profile document to upload for processing.NOTE: If color_profile is set to custom then a custom ICC color profile must be supplied with either the profile or profile_id paramater.
Accepts: Any valid ICC color profile
Example:@PATH_TO_FILE/example_profile.icc
Default:None
Requirement: When color_profile is set to custom, one of:
  • profile
  • profile_id
profile_id
uuid
Submit a resource ID for an ICC color profile document that already exists on the processing server.NOTE: If color_profile is set to custom then a custom ICC color profile must be supplied with either the profile or profile_id paramater.
Accepts: Any valid resource ID returned by a POST request
Example:138aadb71-ee34-4621-9098-9686441e84e2
Default:None
Requirement: When color_profile is set to custom, one of:
  • profile
  • profile_id
preserve_black
boolean
To keep black elements consistent during color conversion, this option maintains their original definition (CMYK, RGB, or grayscale). Particularly useful for preventing RGB black text from inadvertently becoming a rich black in CMYK.
Accepts:
  • false
  • true

Default:false
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_pdf-with-converted-colors
endpoint: POST /pdf-with-converted-colors
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "color_profile"
      location: "body"
      type: "string"
      required: true
      description: "Choose from any of the preset color profiles, or select custom to supply an ICC color profile"
      accepts:
        - "lab-d50 - L*a*b color specification with a D50 white point. The Lab color space is based on the CIE XYZ color space, but it includes a dimension L, for lightness, along with a and b coordinates, to define the color. This is Adobe Systems’ standard Lab profile."
        - "srgb - Standard RGB, the default profile for Windows monitors."
        - "apple-rgb - Apple RGB, the default profile for Mac monitors"
        - "color-match-rgb - Color Match RGB. This is a simpler version of the Radius ColorMatch RGB space, without the non-zero black point."
        - "gamma-18 - Gray Gamma 1.8, grayscale display profile, used for content viewed on a monitor"
        - "gamma-22 - Gray Gamma 2.2"
        - "dot-gain-10 - Grayscale printer profile, with dot gain 10%. Dot gain is commonly used in offset printing to define the increase in size in halftone dots in the printing process, making a printed document look darker than intended."
        - "dot-gain-15 - Dot gain 15%"
        - "dot-gain-20 - Dot gain 20%"
        - "dot-gain-25 - Dot gain 25%"
        - "dot-gain-30 - Dot gain 30%"
        - "monitor-rgb - RGB Monitor, referring to a monitor that requires separate signals for the three primary colors."
        - "acrobat5-cmyk - Adobe Reader 5 CMYK"
        - "acrobat9-cmyk - Adobe Reader 9 CMYK"
        - "custom - supply a custom ICC color profile with either the profile or profile_id parameter"
      example: "acrobat9-cmyk"
      default: "None"
    - name: "profile"
      location: "body"
      type: "string"
      required: conditional
      description: "Select a local ICC color profile document to upload for processing."
      accepts: "Any valid ICC color profile"
      example: "@PATH_TO_FILE/example_profile.icc"
      default: "None"
      requirement:
        - "When color_profile is set to custom, one of:"
        - "profile"
        - "profile_id"
    - name: "profile_id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Submit a resource ID for an ICC color profile document that already exists on the processing server."
      accepts: "Any valid resource ID returned by a POST request"
      example: "138aadb71-ee34-4621-9098-9686441e84e2"
      default: "None"
      requirement:
        - "When color_profile is set to custom, one of:"
        - "profile"
        - "profile_id"
    - name: "preserve_black"
      location: "body"
      type: "boolean"
      required: false
      description: "To keep black elements consistent during color conversion, this option maintains their original definition (CMYK, RGB, or grayscale). Particularly useful for preventing RGB black text from inadvertently becoming a rich black in CMYK."
      accepts:
        - "false"
        - "true"
      default: "false"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_pdf-with-converted-colors"

Responses


POST /rasterized-pdf

Summary

Rasterize each page of a PDF to a flattened image, removing dependencies on fonts or other vector elements to support consistent rendering and printing. The output file is a single PDF in which all pages of the input PDF have been rasterized.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/rasterized-pdf" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_output"
curl -X POST "YOUR_DOMAIN_HERE/rasterized-pdf" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_output"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_rasterized-pdf
endpoint: POST /rasterized-pdf
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_rasterized-pdf"

Responses


POST /linearized-pdf

Summary

Linearize a PDF to optimize the document for fast web view. This restructures the document to be loaded one page at a time from web servers.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/linearized-pdf" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_output"
curl -X POST "YOUR_DOMAIN_HERE/linearized-pdf" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_output"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_linearized-pdf
endpoint: POST /linearized-pdf
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_linearized-pdf"

Responses


POST /pdf-with-imported-form-data

Summary

Import data from a file into an Acroform or XFA-based PDF form. This will find matching form fields in the PDF and fill those fields with the corresponding data from the data file.

Accepted data file formats vary, depending on the form type in the input PDF:

  • Acroform: .fdf, .xfdf, .xml
  • XFA: .xdp, .xfd, .xml

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/pdf-with-imported-form-data" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@/path/to/file" -F "output=example_out" -F "data_file=@/path/to/datafile"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file containing forms with edit permissions active
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
data_file
file required
Data file to be uploaded in order to import its data to an input PDF file
Accepts: Accepted data file formats vary, depending on the form type in the input PDF:
  • Acroform: .fdf, .xfdf, .xml
  • XFA: .xdp, .xfd, .xml

Example:@PATH_TO_FILE/example_file.xml
Default:None
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_pdf-with-imported-form-data
endpoint: POST /pdf-with-imported-form-data
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file containing forms with edit permissions active"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "data_file"
      location: "body"
      type: "file"
      required: true
      description: "Data file to be uploaded in order to import its data to an input PDF file"
      accepts:
        - "Accepted data file formats vary, depending on the form type in the input PDF:"
        - "`Acroform`: .fdf, .xfdf, .xml"
        - "`XFA`: .xdp, .xfd, .xml"
      example: "@PATH_TO_FILE/example_file.xml"
      default: "None"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_pdf-with-imported-form-data"

Responses


POST /exported-form-data

Summary

Export form field data from an Acroform or XFA-based PDF form to an external data file.

Supported data file formats vary, depending on the form type in the input PDF:

  • Acroform: .fdf, .xfdf, .xml
  • XFA: .xdp, .xfd, .xml

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/exported-form-data" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@/path/to/file" -F "data_format=xml" -F "output=example_out"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file containing forms
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
data_format
string required
Data file format for the exported form data
Accepts: Supported data file formats vary, depending on the form type in the input PDF:
  • Acroform: fdf, xfdf, xml
  • XFA: xdp, xfd, xml

Example:xml
Default:None
output
string
Name of the generated output data file, without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_exported-form-data
endpoint: POST /exported-form-data
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file containing forms"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "data_format"
      location: "body"
      type: "string"
      required: true
      description: "Data file format for the exported form data"
      accepts:
        - "Supported data file formats vary, depending on the form type in the input PDF:"
        - "`Acroform`: fdf, xfdf, xml"
        - "`XFA`: xdp, xfd, xml"
      example: "xml"
      default: "None"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output data file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_exported-form-data"

Responses


POST /pdf-with-acroforms

Summary

Convert XFA forms to Acroforms. This significantly improves compatibility, allowing forms to be accessed and edited across a wide range of PDF readers and applications.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/pdf-with-acroforms" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@/path/to/file" -F "output=example_out"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_pdf-with-acroforms
endpoint: POST /pdf-with-acroforms
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_pdf-with-acroforms"

Responses


POST /flattened-forms-pdf

Summary

Flatten all forms in a PDF, including both static and dynamic XFA and AcroForms. This makes form fields no longer editable while preserving form field data. It also ensures that PDFs with forms are compatible with all standard PDF viewers and processing tools.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/flattened-forms-pdf" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@/path/to/file" -F "output=example_out"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_flattened-forms-pdf
endpoint: POST /flattened-forms-pdf
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_flattened-forms-pdf"

Responses


POST /flattened-transparencies-pdf

Summary

Flatten all transparent objects in a PDF to increase RIP speed in a prepress workflow and to enable compatibility for workflows in which transparency is not supported.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/flattened-transparencies-pdf" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_output"
curl -X POST "YOUR_DOMAIN_HERE/flattened-transparencies-pdf" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_output" -F "quality=high"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_flattened-transparencies-pdf
quality
string
Set the quality to define the resolution level to use when flattening transparent objects in your PDF.
  • low - ideal for proofs that will be printed on black-and-white desktop printers and for documents that will be published on the web
  • medium - best for desktop proofs and documents that will be printed on color printers
  • high - ideal for final press outputs when high quality separations-based color proofs are needed

Accepts:
  • low
  • medium
  • high

Default:medium
endpoint: POST /flattened-transparencies-pdf
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_flattened-transparencies-pdf"
    - name: "quality"
      location: "body"
      type: "string"
      required: false
      description: "Set the quality to define the resolution level to use when flattening transparent objects in your PDF."
      accepts:
        - "low"
        - "medium"
        - "high"
      default: "medium"

Responses


POST /flattened-annotations-pdf

Summary

Flatten all annotations in a PDF to collapse their appearances into page content and make them no longer editable.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/flattened-annotations-pdf" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_output"
curl -X POST "YOUR_DOMAIN_HERE/flattened-annotations-pdf" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_output"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_flattened-annotations-pdf
endpoint: POST /flattened-annotations-pdf
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_flattened-annotations-pdf"

Responses


POST /flattened-layers-pdf

Summary

Flatten all layers in a PDF to collapse content from multiple layers onto a single layer.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/flattened-layers-pdf" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_output"
curl -X POST "YOUR_DOMAIN_HERE/flattened-layers-pdf" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "output=example_output"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and processed
Accepts: Any PDF file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be processed
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:[INPUT_FILE_NAME]_pdfrest_flattened-layers-pdf
endpoint: POST /flattened-layers-pdf
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and processed"
      accepts: "Any PDF file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be processed"
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "[INPUT_FILE_NAME]_pdfrest_flattened-layers-pdf"

Responses


POST /upload

Summary

Upload any number of files from local storage or via public URL by specifying "file" or "url" paramaters one or more times.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/upload" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file1.pdf" -F "file=@PATH_TO_FILE/example_file2.png"
curl -X POST "YOUR_DOMAIN_HERE/upload" -H "Accept: application/json" -H "Content-Type: multipart/form-data" -F "url=https://cms.example.com/path/to/file/input1.pdf" -F "url=https://cms.example.com/path/to/file/input2.jpg"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded. This parameter may be included multiple times to upload multiple files but may not be combined with 'url' parameter.
Accepts: Any file of supported type
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One or more: file
  • OR - One or more: url
url
url
Public URL address for a file. This parameter may be included multiple times to upload multiple files from different URLs but may not be combined with 'file' parameter.
Accepts: Any valid file accessible via public URL
Example:https://cms.example.com/path/to/file/input.pdf
Default:None
Requirement: One or more: file
  • OR - One or more: url
endpoint: POST /upload
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded. This parameter may be included multiple times to upload multiple files but may not be combined with 'url' parameter."
      accepts: "Any file of supported type"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "One or more: **file**"
        - "OR -"
        - "One or more: **url**"
    - name: "url"
      location: "body"
      type: "url"
      required: conditional
      description: "Public URL address for a file. This parameter may be included multiple times to upload multiple files from different URLs but may not be combined with 'file' parameter."
      accepts: "Any valid file accessible via public URL"
      example: "https://cms.example.com/path/to/file/input.pdf"
      default: "None"
      requirement:
        - "One or more: **file**"
        - "OR -"
        - "One or more: **url**"

Responses


POST /zip

Summary

Compress any number of files into a .zip by specifying "file" and/or "id" paramaters multiple times.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/zip" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "output=example_out"
curl -X POST "YOUR_DOMAIN_HERE/zip" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf" -F "file=@PATH_TO_FILE/example_file_2.pdf" "id[]=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" "output=example_out"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and zipped with other files. This parameter may be included multiple times to compress multiple files to a .zip file.
Accepts: Any file of supported type
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One or more of:
  • file
  • id[]
id[]
uuid[]
Alphanumeric ID (UUID) of existing file on server to be zipped with other files. This parameter may be included multiple times to compress multiple files to a .zip file.
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One or more of:
  • file
  • id[]
output
string
Name of the generated output file, without extension
Accepts: Any valid file name
Example:example_out
Default:pdfrest_zip
endpoint: POST /zip
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and zipped with other files. This parameter may be included multiple times to compress multiple files to a .zip file."
      accepts: "Any file of supported type"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "One or more of:"
        - "file"
        - "id[]"
    - name: "id[]"
      location: "body"
      type: "uuid[]"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be zipped with other files. This parameter may be included multiple times to compress multiple files to a .zip file."
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "One or more of:"
        - "file"
        - "id[]"
    - name: "output"
      location: "body"
      type: "string"
      required: false
      description: "Name of the generated output file, without extension"
      accepts: "Any valid file name"
      example: "example_out"
      default: "pdfrest_zip"

Responses


POST /unzip

Summary

Extract files from a compressed .zip archive, providing resource IDs for each unzipped file, which can then be processed or downloaded individually. Optionally accepts a password to support unzipping password-protected .zip archives.

Learn More Try in API Lab

Examples

curl -X POST "YOUR_DOMAIN_HERE/unzip" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@PATH_TO_FILE/example_file.pdf"
curl -X POST "YOUR_DOMAIN_HERE/unzip" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "id=0950b9bdf-0465-4d3f-8ea3-d2894f1ae839" -F "password=example-pw"

Required Headers

Accept
header required
application/json
Content-Type
header required
multipart/form-data

Body Parameters

file
file
File to be uploaded and unzipped.
Accepts: Any .zip file
Example:@PATH_TO_FILE/example_file.pdf
Default:None
Requirement: One of:
  • file
  • id
id
uuid
Alphanumeric ID (UUID) of existing file on server to be unzipped.
Accepts: Any valid resource ID returned by a POST request
Example:0950b9bdf-0465-4d3f-8ea3-d2894f1ae839
Default:None
Requirement: One of:
  • file
  • id
password
string
Optional password to unlock protected .zip archives
Accepts: Any valid password
Example:Password123
Default:None
endpoint: POST /unzip
endpoint_parameters:
  headers:
    - name: "Accept"
      location: "header"
      type: "header"
      required: true
      value: "application/json"
    - name: "Content-Type"
      location: "header"
      type: "header"
      required: true
      value: "multipart/form-data"
  body:
    - name: "file"
      location: "body"
      type: "file"
      required: conditional
      description: "File to be uploaded and unzipped."
      accepts: "Any .zip file"
      example: "@PATH_TO_FILE/example_file.pdf"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "id"
      location: "body"
      type: "uuid"
      required: conditional
      description: "Alphanumeric ID (UUID) of existing file on server to be unzipped."
      accepts: "Any valid resource ID returned by a POST request"
      example: "0950b9bdf-0465-4d3f-8ea3-d2894f1ae839"
      default: "None"
      requirement:
        - "file"
        - "id"
    - name: "password"
      location: "body"
      type: "string"
      required: false
      description: "Optional password to unlock protected .zip archives"
      accepts: "Any valid password"
      example: "Password123"
      default: "None"

Responses