PDF.co API v.1.00
- PDF.co Web API (Application Programming Interface)
- Key Benefits
- How to use API with large files and with 100+ pages documents
- Asynchronious mode and background jobs: step by step
- How to Upload Files
- Source Code Samples
- Known Issues
- Free Customer Support
PDF.co API Benefits
- Security: API runs on the secure Amazon AWS infrastructure. All data transfers are encrypted by SSL/TLS encryption.
- Asynchronous mode is supported so you can process large files and documents with hundreds of pages in the cloud.
- Battle tested by thousands of production user. Our engines are tested in production by thousands of enterprise user.
- Credits based system. For evert page/image processed credits are reduced on your account. You get monthly amount of credits based on your subscription, also you may always purchase additional credits. Separate methods like uploading, background job also consumes credits. You may always see how may credits are left using
remainingCredits
property in the returned result or by exploring your API logs On-Premise API Server and SDKs are available
- Not a developer? Zapier, UiPath, Integromat and hundreds of other integrations are available
Status Errors Returned by PDF.co Web API
Code | Description |
---|---|
200 | The request has succeeded |
400 | bad input parameters |
401 | unauthorized |
403 | not enough credits |
408 | Timeout error. To process large documents or files please use asynchronous mode ( set async parameter to true) and then check the status using /job/check endpoint. If file contains many pages then specify a page range using pages parameter. The number of pages of the document can be obtained using the endpoint /pdf/info |
! Don’t forget to set x-api-key
url param or http header param (preferred) to API key, get yours here
How to use API with large files and with 100+ pages documents
We’ve designed special async
that is available for almost all endpioints. With async mode you can process large files and documents with hundreds of pages.
- Default timeout for all API calls without
async
mode is no more than25
seconds. If your call to API (for example, if you run text recognition on 100+ pages scanned document) takes more time then you should useasync
mode by settingasync
totrue
. - Enable
async
mode by settingasync
input parameter totrue
. This will tell API method to reate background job and immediately return unique id of this new background job injobId
property in the output along with the finalurl
. Use this url to access output file (if any) once the job is finished. - Now use Check status of that new background job using
/job/check
. Wait until it returnsstatus
assuccess
Asynchronious mode and background jobs: step by step
- Request a temporary URL for upload using
/file/upload/get-presigned-url
. This will returnpresignedUrl
to be used for uploading andurl
that must be used to access uploaded file. - Upload your file using
PUT
to thispresignedUrl
generated on the previous step. Once finished, your file can be accessed using theurl
link from step1
- Call API method wuth input set in
url
param. Setasync
param totrue
so API method will return immediately and will send you output URL (or set of URLs) along withjobId
immediately.jobId
is the unique identificator of the background job that will be running on the server. - Now check
status
of this background job using/job/check
API method withjobId
param. It will return executionstatus
. - Once
/job/check
returnsstatus
param assuccess
you may use the previously generated output URL (or set of URLs) to download generated data.
Source Code Samples
We have hundreds of ready to copy Explore Source Code Samples on Github available for Javascript, Node.js, PHP, Java, C# and Visual Basic NET.
Known Issues
- PHP language: if you are getting
SSL certificate error: unable to get local issuer certificate
error then please check this solution on Stackoverflow
Free Tech Support
Our team of engineers is happy to help with the integration, coding of proof of concept projects and any other questions. To contact us please:
- Submit a Ticket (recommended)
- or send email to pdfco@bytescout.zendesk.com
Indices
Background Jobs
Checks status of background job that was previously created with PDF.co API.
1. /job/check
jobId
required. Id of background that was started asynchronously. Must be a String. To start new async background job, you should setasync
totrue
for API methods.force
optional. Set totrue
to forcely check the status of the background job. Intended to be used with really long and heavy background jobs only.
Returns JSON with status of the background job.
Available status values:
working
background job is currently in work or does not exist.success
background job was successfully finished.failed
background job failed for some reason (seemessage
for more details).aborted
background job was aborted.unknown
unknown background job id. Available only whenforce
is set totrue
for input request.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/job/check
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"jobid": "12345"
}
More example Requests/Responses:
I. Example Request: /job/check
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"jobid": "12345"
}
I. Example Response: /job/check
{
"status": "working",
"remainingCredits": 60227
}
Status Code: 200
Barcode Generator
Generate high quality barcode images. Supports QR Code, Datamatrix, Code 39, Code 128, PDF417 and many other barcode types.
1. /barcode/generate
type
optional. Sets barcode type.QRCode
is default. Available values:Code128
,Code39
,Postnet
,UPCA
,EAN8
,ISBN
,Codabar
,I2of5
,Code93
,EAN13
,JAN13
,Bookland
,UPCE
,PDF417
,PDF417Truncated
,DataMatrix
,QRCode
,Aztec
,Planet
,EAN128
,GS1_128
,USPSSackLabel
,USPSTrayLabel
,DeutschePostIdentcode
,DeutschePostLeitcode
,Numly
,PZN
,OpticalProduct
,SwissPostParcel
,RoyalMail
,DutchKix
,SingaporePostalCode
,EAN2
,EAN5
,EAN14
,MacroPDF417
,MicroPDF417
,GS1_DataMatrix
,Telepen
,IntelligentMail
,GS1_DataBar_Omnidirectional
,GS1_DataBar_Truncated
,GS1_DataBar_Stacked
,GS1_DataBar_Stacked_Omnidirectional
,GS1_DataBar_Limited
,GS1_DataBar_Expanded
,GS1_DataBar_Expanded_Stacked
,MaxiCode
,Plessey
,MSI
,ITF14
,GTIN12
,GTIN8
,GTIN13
,GTIN14
.inline
. optional. Set to true to generatedatauri
url instead of file.decorationImage
optional. works for QR Code only. Set this to the image that you want to be inserted logo inside QR Code barcode. To use your file please upload it first to the temporary storage, seeUpload and Manage Files
section below to learn how to do it.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/barcode/generate
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"name": "barcode.png",
"value": "abcdef123456",
"type": "QRCode",
"inline": false,
"decorationImage": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/barcode-generator/logo.png"
}
More example Requests/Responses:
I. Example Request: /barcode/generate
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"name": "barcode.png",
"value": "abcdef123456",
"type": "QRCode",
"inline": false,
"decorationImage": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/barcode-generator/logo.png"
}
I. Example Response: /barcode/generate
{
"url": "https://pdf-temp-files.s3.amazonaws.com/9a87556a8b9e4f4eae60843e697250d4/barcode.png",
"error": false,
"status": 200,
"name": "barcode.png",
"remainingCredits": 60631
}
Status Code: 200
Barcode Reader
Read barcodes from images and PDF. Can read all popular barcode types from QR Code
and Code 128
, EAN
to Datamatrix
, PDF417
, GS1
and many other barcodes.
1. /barcode/read/from/url
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.type
. optional. Comma-separated list of barcode types to decode. Barcode types supported:AustralianPostCode
,Aztec
,CircularI2of5
,Codabar
,CodablockF
,Code128
,Code16K
,Code39
,Code39Extended
,Code39Mod43
,Code39Mod43Extended
,Code93
,DataMatrix
,EAN13
,EAN2
,EAN5
,EAN8
,GS1
,GS1DataBarExpanded
,GS1DataBarExpandedStacked
,GS1DataBarLimited
,GS1DataBarOmnidirectional
,GS1DataBarStacked
,GTIN12
,GTIN13
,GTIN14
,GTIN8
,IntelligentMail
,Interleaved2of5
,ITF14
,MaxiCode
,MICR
,MicroPDF
,MSI
,PatchCode
,PDF417
,Pharmacode
,PostNet
,PZN
,QRCode
,RoyalMail
,RoyalMailKIX
,Trioptic
,UPCA
,UPCE
,UPU
. Must be a String.pages
. optional. Comma-separated list of page indices (or ranges) to process. IMPORTANT: the very first page starts at0
(zero). To set a range use the dash-
, for example:0,2-5,7-
. To set a range from index to the last page use range like this:2-
(from page #3 as the index starts at zero and till the of the document). For ALL pages just leave this param empty. Example:0,2-5,7-
means first page, then 3rd page to 6th page, and then the range from 8th (index =7
) page till the end of the document. Must be a String.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/barcode/read/from/url
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/barcode-reader/sample.pdf",
"types": "Code128,Code39,Interleaved2of5,EAN13",
"pages": "0",
"encrypt": false,
"async": false
}
More example Requests/Responses:
I. Example Request: /barcode/read/from/url
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/barcode-reader/sample.pdf",
"types": "Code128,Code39,Interleaved2of5,EAN13",
"pages": "0",
"encrypt": false,
"async": false
}
I. Example Response: /barcode/read/from/url
{
"barcodes": [
{
"Value": "test123",
"RawData": "",
"Type": 2,
"Rect": "{X=111,Y=60,Width=255,Height=37}",
"Page": 0,
"File": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/barcode-reader/sample.pdf",
"Confidence": 0.90625155,
"Metadata": "",
"TypeName": "Code128"
},
{
"Value": "123456",
"RawData": "",
"Type": 4,
"Rect": "{X=111,Y=129,Width=306,Height=37}",
"Page": 0,
"File": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/barcode-reader/sample.pdf",
"Confidence": 0.7710818,
"Metadata": "",
"TypeName": "Code39"
},
{
"Value": "<FNC1>0112345678901231",
"RawData": "",
"Type": 2,
"Rect": "{X=111,Y=198,Width=305,Height=37}",
"Page": 0,
"File": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/barcode-reader/sample.pdf",
"Confidence": 0.9156459,
"Metadata": "",
"TypeName": "Code128"
},
{
"Value": "12345670",
"RawData": [
1,
2,
3,
4,
5,
6,
7,
0
],
"Type": 5,
"Rect": "{X=111,Y=267,Width=182,Height=0}",
"Page": 0,
"File": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/barcode-reader/sample.pdf",
"Confidence": 1,
"Metadata": "",
"TypeName": "I2of5"
},
{
"Value": "1234567890128",
"RawData": "",
"Type": 6,
"Rect": "{X=102,Y=336,Width=71,Height=72}",
"Page": 0,
"File": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/barcode-reader/sample.pdf",
"Confidence": 0.895925164,
"Metadata": "",
"TypeName": "EAN13"
}
],
"pageCount": 1,
"error": false,
"status": 200,
"remainingCredits": 60661
}
Status Code: 200
Document Parser
Document Parser automatically extracts fields, tables, values from invoices, statements, orders and other PDF and scanned documents.
You can use built-in templates like Generic Invoice Parser
(templateId
1
) and others.
Or you can create your own data extraction templates using document parser template editor. Templates support extraction by coordinates, by patterns. Multiple languages are supported inside the same document. Document parser can also extract tables, fields, multipaged tables, text.
1. /pdf/documentparser (custom template code)
Description: Parses and gets data from documents using previously prepared custom data extraction template. With this API method you may extract data from custom areas, by search, form fields, tables, multiple pages and more!
To create parsing templates please use document parser template editor
Parameters
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.templateId
. required. Sets Id of document parser template to be used. View and manage your templates at https://app.pdf.co/document-parsertemplate
. optional. You can pass code of document parser template to be used directly.inline
. optional. Set totrue
to return results inside the response. Otherwise endpoint will return a link to output file generated.outputFormat
. optional. Default isJSON
. You can override default output format toCSV
orXML
to generate CSV or XML output accordingly.storeResult
. optional. Set totrue
if you want to store results generated in PDF.co. You can view stored data extraction results at https://app.pdf.co/document-parserpassword
optional. Password of PDF file. Must be a Stringasync
optional. Runs processing asynchronously. Returns UseJobId
that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.name
optional. File name for generated output. Must be a String.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Example
Sample PDF document with tables and multiple pages: https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/document-parser/MultiPageTable.pdf
Sample Document Parser Template Code (YML or JSON):
---
# Template that demonstrates parsing of multi-page table using only
# regular expressions for the table start, end, and rows.
# If regular expression cannot be written for every table row (for example,
# if the table contains empty cells), try the second method demonstrated
# in `MultiPageTable-template2.yml` template.
templateVersion: 3
templatePriority: 0
sourceId: Multipage Table Test
detectionRules:
keywords:
- Sample document with multi-page table
fields:
total:
type: regex
expression: TOTAL {{DECIMAL}}
dataType: decimal
tables:
- name: table1
start:
# regular expression to find the table start in document
expression: Item\s+Description\s+Price\s+Qty\s+Extended Price
end:
# regular expression to find the table end in document
expression: TOTAL\s+\d+\.\d\d
row:
# regular expression to find table rows
expression: '^\s*(?<itemNo>\d+)\s+(?<description>.+?)\s+(?<price>\d+\.\d\d)\s+(?<qty>\d+)\s+(?<extPrice>\d+\.\d\d)'
columns:
- name: itemNo
type: integer
- name: description
type: string
- name: price
type: decimal
- name: qty
type: integer
- name: extPrice
type: decimal
multipage: true
NOTE: to set custom template code, encode it and put into template
param. You can also save it in PDF.co and refere using templateId
instead.
! Don’t forget to set x-api-key
url param or http header param (preferred) to API key, get yours here
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/documentparser
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/document-parser/MultiPageTable.pdf",
"template": "---\r\n# Template that demonstrates parsing of multi-page table using only\r\n# regular expressions for the table start, end, and rows.\r\n# If regular expression cannot be written for every table row (for example,\r\n# if the table contains empty cells), try the second method demonstrated\r\n# in `MultiPageTable-template2.yml` template.\r\ntemplateVersion: 3\r\ntemplatePriority: 0\r\nsourceId: Multipage Table Test\r\ndetectionRules:\r\n keywords:\r\n - Sample document with multi-page table\r\nfields:\r\n total:\r\n type: regex\r\n expression: TOTAL {{DECIMAL}}\r\n dataType: decimal\r\ntables:\r\n- name: table1\r\n start:\r\n # regular expression to find the table start in document\r\n expression: Item\\s+Description\\s+Price\\s+Qty\\s+Extended Price\r\n end:\r\n # regular expression to find the table end in document\r\n expression: TOTAL\\s+\\d+\\.\\d\\d\r\n row:\r\n # regular expression to find table rows\r\n expression: '^\\s*(?<itemNo>\\d+)\\s+(?<description>.+?)\\s+(?<price>\\d+\\.\\d\\d)\\s+(?<qty>\\d+)\\s+(?<extPrice>\\d+\\.\\d\\d)'\r\n columns:\r\n - name: itemNo\r\n type: integer\r\n - name: description\r\n type: string\r\n - name: price\r\n type: decimal\r\n - name: qty\r\n type: integer\r\n - name: extPrice\r\n type: decimal\r\n multipage: true",
"outputFormat": "JSON",
"async": false,
"encrypt": "false",
"inline": "true",
"profiles": "",
"password": "",
"storeResult": false
}
More example Requests/Responses:
I. Example Request: POST /pdf/documentparser
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
Key | Value | Description |
---|---|---|
inline | true | optional. Must be one of: true , false . |
url | https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/document-parser/sample-invoice.pdf | required. URL of the source PDF file. Must be a String. To use your file please upload it first to the temporary storage, see Upload and Manage Files section below to learn how to do it. |
templateId | 1 | optional. ID of the template to be used. Add, manage templates at https://app.pdf.co/document-parser-templates |
I. Example Response: POST /pdf/documentparser
{
"body": {
"objects": [
{
"name": "companyName",
"objectType": "field",
"value": "Amazon Web Services, Inc",
"rectangle": [
0,
0,
0,
0
]
},
{
"name": "companyName2",
"objectType": "field",
"value": "Amazon Web Services, Inc",
"rectangle": [
0,
0,
0,
0
]
},
{
"name": "invoiceId",
"objectType": "field",
"value": "123456789",
"pageIndex": 0,
"rectangle": [
0,
0,
0,
0
]
},
{
"name": "dateIssued",
"objectType": "field",
"value": "2018-04-03T00:00:00",
"pageIndex": 0,
"rectangle": [
0,
0,
0,
0
]
},
{
"name": "dateDue",
"objectType": "field",
"value": "2018-04-03T00:00:00",
"pageIndex": 0,
"rectangle": [
0,
0,
0,
0
]
},
{
"name": "total",
"objectType": "field",
"value": 6.58,
"pageIndex": 0,
"rectangle": [
0,
0,
0,
0
]
},
{
"name": "subTotal",
"objectType": "field",
"value": ""
},
{
"name": "tax",
"objectType": "field",
"value": 1.01,
"pageIndex": 0,
"rectangle": [
0,
0,
0,
0
]
},
{
"objectType": "table",
"name": "table",
"rows": []
}
],
"templateName": "Generic Invoice [en]",
"templateVersion": "4",
"timestamp": "2020-07-16T22:04:25"
},
"pageCount": 1,
"error": false,
"status": 200,
"name": "sample-invoice.json",
"remainingCredits": 77731
}
Status Code: 200
2. /pdf/documentparser (output as CSV)
Description: Parses and gets data from documents using previously prepared custom data extraction template. With this API method you may extract data from custom areas, by search, form fields, tables, multiple pages and more!
To create parsing templates please use document parser template editor
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.templateId
. required. Sets Id of document parser template to be used. View and manage your templates at https://app.pdf.co/document-parsertemplate
. optional. You can pass code of document parser template to be used directly.inline
. optional. Set totrue
to return results inside the response. Otherwise endpoint will return a link to output file generated.outputFormat
. optional. Default isJSON
. You can override default output format toCSV
orXML
to generate CSV or XML output accordingly.storeResult
. optional. Set totrue
if you want to store results generated in PDF.co. You can view stored data extraction results at https://app.pdf.co/document-parserpassword
optional. Password of PDF file. Must be a Stringasync
optional. Runs processing asynchronously. Returns UseJobId
that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.name
optional. File name for generated output. Must be a String.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Example
Sample PDF document with tables and multiple pages: https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/document-parser/MultiPageTable.pdf
SampleTemplate.yml:
---
# Template that demonstrates parsing of multi-page table using only
# regular expressions for the table start, end, and rows.
# If regular expression cannot be written for every table row (for example,
# if the table contains empty cells), try the second method demonstrated
# in `MultiPageTable-template2.yml` template.
templateVersion: 3
templatePriority: 0
sourceId: Multipage Table Test
detectionRules:
keywords:
- Sample document with multi-page table
fields:
total:
type: regex
expression: TOTAL {{DECIMAL}}
dataType: decimal
tables:
- name: table1
start:
# regular expression to find the table start in document
expression: Item\s+Description\s+Price\s+Qty\s+Extended Price
end:
# regular expression to find the table end in document
expression: TOTAL\s+\d+\.\d\d
row:
# regular expression to find table rows
expression: '^\s*(?<itemNo>\d+)\s+(?<description>.+?)\s+(?<price>\d+\.\d\d)\s+(?<qty>\d+)\s+(?<extPrice>\d+\.\d\d)'
columns:
- name: itemNo
type: integer
- name: description
type: string
- name: price
type: decimal
- name: qty
type: integer
- name: extPrice
type: decimal
multipage: true
NOTE: this template should be set as template
param. Also you see Template Creation Guide and download Document Parser Template Editor for Windows Desktop for full experience.
Sample Request:
! Don’t forget to set x-api-key
url param or http header param (preferred) to API key, get yours here
POST
{
"url" : "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/document-parser/MultiPageTable.pdf",
"inline": "true",
"template": "---
detectionRules:
keywords:
- "Sample document with multi-page table"
fields:
total:
dataType: decimal
expression: "TOTAL {{DECIMAL}}"
type: regex
sourceId: "Multipage Table Test"
tables:
-
columns:
-
name: itemNo
type: integer
-
name: description
type: string
-
name: price
type: decimal
-
name: qty
type: integer
-
name: extPrice
type: decimal
end:
expression: TOTAL\s+\d+\.\d\d
multipage: true
name: table1
row:
expression: ^\s*(?<itemNo>\d+)\s+(?<description>.+?)\s+(?<price>\d+\.\d\d)\s+(?<qty>\d+)\s+(?<extPrice>\d+\.\d\d)
start:
expression: "Item\\s+Description\\s+Price\\s+Qty\\s+Extended Price"
templatePriority: 0
templateVersion: 3
"
}
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/documentparser
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/document-parser/sample-invoice.pdf",
"templateId": "1",
"outputFormat": "CSV",
"generateCsvHeaders": true,
"async": false,
"encrypt": "false",
"inline": "true",
"password": "",
"storeResult": false
}
More example Requests/Responses:
I. Example Request: /pdf/documentparser (output as CSV)
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/document-parser/sample-invoice.pdf",
"templateId": "1",
"outputFormat": "CSV",
"generateCsvHeaders": true,
"async": false,
"encrypt": "false",
"inline": "true",
"password": ""
}
I. Example Response: /pdf/documentparser (output as CSV)
{
"body": "companyName,companyName2,invoiceId,dateIssued,dateDue,bankAccount,total,subTotal,tax,tableNames,tables\r\n\"Amazon Web Services, Inc\",\"Amazon Web Services, Inc\",123456789,2018-04-03T00:00:00,2018-04-03T00:00:00,123456789012,6.58,,1.01,table,\r\n\r\n",
"pageCount": 1,
"error": false,
"status": 200,
"name": "sample-invoice.csv",
"remainingCredits": 60804
}
Status Code: 200
3. /pdf/documentparser (output as JSON)
Description: Parses and gets data from documents using previously prepared custom data extraction template. With this API method you may extract data from custom areas, by search, form fields, tables, multiple pages and more!
To create parsing templates please use document parser template editor
Parameters
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.templateId
. required. Sets Id of document parser template to be used. View and manage your templates at https://app.pdf.co/document-parsertemplate
. optional. You can pass code of document parser template to be used directly.inline
. optional. Set totrue
to return results inside the response. Otherwise endpoint will return a link to output file generated.outputFormat
. optional. Default isJSON
. You can override default output format toCSV
orXML
to generate CSV or XML output accordingly.storeResult
. optional. Set totrue
if you want to store results generated in PDF.co. You can view stored data extraction results at https://app.pdf.co/document-parserpassword
optional. Password of PDF file. Must be a Stringasync
optional. Runs processing asynchronously. Returns UseJobId
that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.name
optional. File name for generated output. Must be a String.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/documentparser
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/document-parser/sample-invoice.pdf",
"outputFormat": "JSON",
"templateId": "1",
"async": false,
"encrypt": "false",
"inline": "true",
"password": "",
"profiles": "",
"storeResult": false
}
More example Requests/Responses:
I. Example Request: /pdf/documentparser (output as JSON)
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/document-parser/sample-invoice.pdf",
"outputFormat": "JSON",
"templateId": "1",
"async": false,
"encrypt": "false",
"inline": "true",
"password": "",
"profiles": ""
}
I. Example Response: /pdf/documentparser (output as JSON)
{
"body": {
"objects": [
{
"name": "companyName",
"objectType": "field",
"value": "Amazon Web Services, Inc",
"rectangle": [
0,
0,
0,
0
]
},
{
"name": "companyName2",
"objectType": "field",
"value": "Amazon Web Services, Inc",
"rectangle": [
0,
0,
0,
0
]
},
{
"name": "invoiceId",
"objectType": "field",
"value": "123456789",
"pageIndex": 0,
"rectangle": [
0,
0,
0,
0
]
},
{
"name": "dateIssued",
"objectType": "field",
"value": "2018-04-03T00:00:00",
"pageIndex": 0,
"rectangle": [
0,
0,
0,
0
]
},
{
"name": "dateDue",
"objectType": "field",
"value": "2018-04-03T00:00:00",
"pageIndex": 0,
"rectangle": [
0,
0,
0,
0
]
},
{
"name": "bankAccount",
"objectType": "field",
"value": "123456789012",
"pageIndex": 0,
"rectangle": [
0,
0,
0,
0
]
},
{
"name": "total",
"objectType": "field",
"value": 6.58,
"pageIndex": 0,
"rectangle": [
0,
0,
0,
0
]
},
{
"name": "subTotal",
"objectType": "field",
"value": ""
},
{
"name": "tax",
"objectType": "field",
"value": 1.01,
"pageIndex": 0,
"rectangle": [
0,
0,
0,
0
]
},
{
"objectType": "table",
"name": "table",
"rows": []
}
],
"templateName": "Generic Invoice [en]",
"templateVersion": "4",
"timestamp": "2020-08-21T19:23:31"
},
"pageCount": 1,
"error": false,
"status": 200,
"name": "sample-invoice.json",
"remainingCredits": 60803
}
Status Code: 200
4. /pdf/documentparser (output as XML)
Description: Parses and gets data from documents using previously prepared custom data extraction template. With this API method you may extract data from custom areas, by search, form fields, tables, multiple pages and more!
To create parsing templates please use document parser template editor
Parameters
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.templateId
. required. Sets Id of document parser template to be used. View and manage your templates at https://app.pdf.co/document-parsertemplate
. optional. You can pass code of document parser template to be used directly.inline
. optional. Set totrue
to return results inside the response. Otherwise endpoint will return a link to output file generated.outputFormat
. optional. Default isJSON
. You can override default output format toCSV
orXML
to generate CSV or XML output accordingly.storeResult
. optional. Set totrue
if you want to store results generated in PDF.co. You can view stored data extraction results at https://app.pdf.co/document-parserpassword
optional. Password of PDF file. Must be a Stringasync
optional. Runs processing asynchronously. Returns UseJobId
that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.name
optional. File name for generated output. Must be a String.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/documentparser
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/document-parser/sample-invoice.pdf",
"outputFormat": "JSON",
"templateId": "1",
"async": false,
"encrypt": "false",
"inline": "true",
"password": "",
"profiles": "",
"storeResult": false
}
More example Requests/Responses:
I. Example Request: /pdf/documentparser (output as JSON)
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/document-parser/sample-invoice.pdf",
"outputFormat": "JSON",
"templateId": "1",
"async": false,
"encrypt": "false",
"inline": "true",
"password": "",
"profiles": ""
}
I. Example Response: /pdf/documentparser (output as JSON)
{
"body": {
"objects": [
{
"name": "companyName",
"objectType": "field",
"value": "Amazon Web Services, Inc",
"rectangle": [
0,
0,
0,
0
]
},
{
"name": "companyName2",
"objectType": "field",
"value": "Amazon Web Services, Inc",
"rectangle": [
0,
0,
0,
0
]
},
{
"name": "invoiceId",
"objectType": "field",
"value": "123456789",
"pageIndex": 0,
"rectangle": [
0,
0,
0,
0
]
},
{
"name": "dateIssued",
"objectType": "field",
"value": "2018-04-03T00:00:00",
"pageIndex": 0,
"rectangle": [
0,
0,
0,
0
]
},
{
"name": "dateDue",
"objectType": "field",
"value": "2018-04-03T00:00:00",
"pageIndex": 0,
"rectangle": [
0,
0,
0,
0
]
},
{
"name": "bankAccount",
"objectType": "field",
"value": "123456789012",
"pageIndex": 0,
"rectangle": [
0,
0,
0,
0
]
},
{
"name": "total",
"objectType": "field",
"value": 6.58,
"pageIndex": 0,
"rectangle": [
0,
0,
0,
0
]
},
{
"name": "subTotal",
"objectType": "field",
"value": ""
},
{
"name": "tax",
"objectType": "field",
"value": 1.01,
"pageIndex": 0,
"rectangle": [
0,
0,
0,
0
]
},
{
"objectType": "table",
"name": "table",
"rows": []
}
],
"templateName": "Generic Invoice [en]",
"templateVersion": "4",
"timestamp": "2020-08-21T19:23:31"
},
"pageCount": 1,
"error": false,
"status": 200,
"name": "sample-invoice.json",
"remainingCredits": 60803
}
Status Code: 200
5. /pdf/documentparser/results
Return all document parser results for this user. Please use GET request.
Endpoint:
Method: GET
Type:
URL: https://api.pdf.co/v1/pdf/documentparser/results
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Query params:
Key | Value | Description |
---|---|---|
templateId | 1 | optional. Return all results for this document parser template id. Must be a String. |
More example Requests/Responses:
I. Example Request: JSON pdf/documentparser/results
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Query:
Key | Value | Description |
---|---|---|
templateId | 40 | optional. Return all results for this document parser template id. Must be a String. |
I. Example Response: JSON pdf/documentparser/results
{
"results": [
{
"id": 74,
"templateId": 40,
"body": {
"fields": {
"date": {
"value": ""
},
"amount": {
"value": "2",
"pageIndex": 0
}
},
"sourceId": null,
"templateId": null,
"templateVersion": "3"
},
"createdAt": "2020-03-23T11:17:30.152Z",
"filename": "EINPresswire-Report-512260784-bytescout-announces-release-of-its-data-extraction-tools-for-on-cloud-deployments.pdf"
}
],
"remainingCredits": 94220
}
Status Code: 200
6. /pdf/documentparser/results
Description Create document parser result for this user. Please use POST request.
Input Parameters
Param | Description |
---|---|
templateId | optional. Create document parser result with this template id. Must be a String. |
result | optional. JSONB storage for storing document parser result. Must be a String. |
resultType | optional. Result format. Valid values: JSON, YAML, XML, CSV. Must be a String. |
fileUrl | optional. URL to source PDF File. Must be a String. |
Status Errors
Code | Description |
---|---|
200 | The request has succeeded |
400 | bad input parameters |
401 | unauthorized |
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/documentparser/results
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"fileUrl": "https://github.com/bytescout/ByteScout-SDK-SourceCode/raw/master/Document%20Parser%20SDK/DigitalOcean.pdf",
"templateId": 48,
"formatType": "CSV",
"result": "companyName,companyName2,invoiceId,dateIssued,dateDue,total,subTotal,tax\r\n,,,,,450.00,,\r\n\r\n"
}
7. /pdf/documentparser/results/:id
DELETE document parser result with given id. Please use DELETE request.
Endpoint:
Method: DELETE
Type:
URL: https://api.pdf.co/v1/pdf/documentparser/results/:id
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
URL variables:
Key | Value | Description |
---|---|---|
id | Required. ID of result to delete. |
8. /pdf/documentparser/templates
Return all YAML formatted templates for document parser for this user. Please use GET request.
Endpoint:
Method: GET
Type:
URL: https://api.pdf.co/v1/pdf/documentparser/templates
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
More example Requests/Responses:
I. Example Request: pdf/documentparser/templates
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
I. Example Response: pdf/documentparser/templates
{
"templates": [
{
"id": 40,
"type": "user",
"title": "Untitled",
"description": "Untitled"
},
{
"id": 1,
"type": "system",
"title": "Invoice Parser",
"description": "Parses invoices and extracts invoice number, company name, due date, amount, tax"
}
],
"remainingCredits": 94229
}
Status Code: 0
9. /pdf/documentparser/templates/:id
Return detailed information for document parser template by template’s id. Please use GET request.
Endpoint:
Method: GET
Type: RAW
URL: https://api.pdf.co/v1/pdf/documentparser/templates/:id
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
URL variables:
Key | Value | Description |
---|---|---|
id | 1 |
Files Upload
Files Storage
You can upload files as temporary files into PDF.co. Temporary files are stored for 1 hour by default and then auto removed.
To store files permanently (pdf templates, images you want to re-use) please use PDF.co built-in files storage at https://app.pdf.co/files instead.
You can also use 3rd party cloud services:
- Dropbox: you can use
public link
to a file from Dropbox - Google Drive: you can use link to a file that was shared as
anyone with a link
- Google Docs/Sheets/Slides: you can use a link to a document in Google Docs that was shared as
anyone with a link
- Any other cloud service that can store a file and provide a link to uploaded file.
IMPORTANT NOTE FOR GOOGLE DRIVE/DOCS users: free Google Drive/Docs limits number of requests to their files. If you use link to file or document from Google Drive or Google Drive then make sure you have no more than 5-10 requests per minute. Otherwise Google Drive returns no file or error page.
Temporary Files Upload
You can upload temporary files up to 2GB in size. Please note that to process these files you should use async=true
mode with data extraction and tools endpoints along with /job/check
to check status of background jobs you create.
Steps to Upload File:
1) First, call /file/upload/get-presigned-url
. It will generate link for uploading (presignedUrl
) and final link (url
) 2) Now send your file to the presignedUrl
link using PUT
method within next 30 minutes. 3) Oncce finished, use url
to access the file you have just uploaded.
Note: all uploaded files are considered to be temporary files and are automatically permanently removed after 1 hour.
Status Errors
Code | Description |
---|---|
200 | The request has succeeded |
400 | bad input parameters |
401 | unauthorized |
403 | not enough credits |
405 | Timeout error. To process large documents or files please use asynchronous mode ( set async parameter to true) and then check the status using /job/check endpoint. If file contains many pages then specify a page range using pages parameter. The number of pages of the document can be obtained using the endpoint /pdf/info |
Example: Uploading a Temporary File
Sample Request:
! Don’t forget to set x-api-key
url param or http header param (preferred) to API key, get yours here
GET
https://api.pdf.co/v1/file/upload/get-presigned-url?name=test.pdf&encrypt=true
200
{
"presignedUrl": "https://pdf-temp-files.s3-us-west-2.amazonaws.com/28e191b14f3a4f43b16fcef1d53d191e/test.pdf?X-Amz-Expires=900&....",
"url": "https://pdf-temp-files.s3-us-west-2.amazonaws.com/28e191b14f3a4f43b16fcef1d53d191e/test.pdf?X-Amz-Expires=....",
"error": false,
"status": 200,
"name": "test.pdf",
"remainingCredits": 93574
}
PUT
https://pdf-temp-files.s3-us-west-2.amazonaws.com/28e191b14f3a4f43b16fcef1d53d191e/test.pdf?X-Amz-Expires=900&....
--form 'file=@/path/to/file'
200
{
}
Now you can access your file using link from "url" param to from the first step.
1. /file/delete
Description: Deletes temp file (that was uploaded by you or generated by API)
IMPORTANT: All temp files are autoremoved after 1 hour. You may use /file/delete
methods to explicitely force remove temp files once you don’t need them.
Parameters
url
required. URL of previously uploaded temporary file or output file that was generated by API method.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/file/delete
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"file": "https://pdf-temp-files.s3.amazonaws.com/b5c1e67d98ab438292ff1fea0c7cdc9d/sample.pdf"
}
More example Requests/Responses:
I. Example Request: POST /file/delete
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
Key | Value | Description |
---|---|---|
file | https://pdf-temp-files.s3-us-west-2.amazonaws.com/63f7f641a3144f84ac209b4f514bc0df/myFile.png?X-Amz-Expires=3600&x-amz-security-token=FwoGZXIvYXdzECMaDC5PzTA618EQiHoskyKBAeYQcVKbK%2B0F5nnjBV6MKbPNvueaFlSBSPxPi31BdtFzw1jAIXjAvATkBwTPRx%2FVwhszDtYQRVkbhsZF6HLotVUedrcdGHOrsWV5DpN2xKgnX7xRcJrvUu0wieaJHDmHzFL1eNzFwj2927L%2BtadEfmz1a0SiEImJZujcLF78lJZ5mSj7s8D4BTIok4Xja8wyqnBBp2EOcZw8qrUxeR7Ufd0aw4bf7Z1Cur1f0PFg8hlrYQ%3D%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIA4NRRSZPHAPA4HUJS/20200716/us-west-2/s3/aws4_request&X-Amz-Date=20200716T091225Z&X-Amz-SignedHeaders=host;x-amz-security-token&X-Amz-Signature=26e27b48c5284665914fdd981d7b0b5b6e70e64839f28621f3dc82256e492879 | required. URL of the file to delete. Must be a String. |
I. Example Response: POST /file/delete
{
"error": false,
"status": 200,
"remainingCredits": 77778
}
Status Code: 200
II. Example Request: /file/delete
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
Key | Value | Description |
---|---|---|
file | https://pdf-temp-files.s3.amazonaws.com/b5c1e67d98ab438292ff1fea0c7cdc9d/sample.pdf | required. URL of the file to calculate hash. Must be a String. |
II. Example Response: /file/delete
{
"error": false,
"status": 200,
"remainingCredits": 9999986
}
Status Code: 200
2. /file/hash
Description: Calculate and return MD5 hash of file by url. Commonly used to control if source document has been changed or not because every little change will cause hash string to differ as well. GET
or POST
request.
Parameters
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/file/hash
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Body:
{
"url": "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-split/sample.pdf"
}
More example Requests/Responses:
I. Example Request: /file/hash
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Body:
{
"url": "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-split/sample.pdf"
}
I. Example Response: /file/hash
{
"hash": "d942e5becdcb0386598cce15e9e56deb1ca9d893b8578a88eca4a62f02c4000b",
"remainingCredits": 98143
}
Status Code: 200
3. /file/upload (Uploading small file)
Description: Uploads a small (up to 100KB) local file as a temporary file in PDF.co storage. Note: temporary files are automatically permanently removed after 1 hour.
Status Errors
Code | Description |
---|---|
200 | The request has succeeded |
400 | bad input parameters |
401 | unauthorized |
403 | not enough credits |
405 | Timeout error. To upload large documents or files please use /file/upload/get-presigned-url instead to get url that you should upload into (see source code samples |
Example
Sample Request:
! Don’t forget to set x-api-key
url param or http header param (preferred) to API key, get yours here
Endpoint:
Method: POST
Type: POST params, JSON or FORMDATA
URL: https://api.pdf.co/v1/file/upload
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. Your API key for PDF.co. Get your API key at https://app.pdf.co/ |
Body:
Key | Value | Description |
---|---|---|
file | required. Local file should be selected |
More example Requests/Responses:
I. Example Request: /file/upload/url
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
Key | Value | Description |
---|---|---|
name | optional. The name the file will be stored with. Must be a String. | |
url | https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-split/sample.pdf | required. URL of the file to upload. Must be a String. |
I. Example Response: /file/upload/url
{
"url": "https://pdf-temp-files.s3.amazonaws.com/1a4a92ac805c41c28ef75a24e0f35ba5/sample.pdf",
"error": false,
"status": 200,
"name": "sample.pdf",
"remainingCredits": 98145
}
Status Code: 200
II. Example Request: POST Upload small file: /file/upload
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
Key | Value | Description |
---|---|---|
file | required. Local file should be selected |
II. Example Response: POST Upload small file: /file/upload
{
"url": "https://pdf-temp-files.s3.amazonaws.com/28b6041bcfe34c469ed44f15f0594d5f/logo.dat",
"error": false,
"status": 200,
"name": "logo",
"remainingCredits": 77772
}
Status Code: 200
4. /file/upload/base64 (Upload small file as Base64)
Description: Creates temporary file using base64 source data. You may use this temporary file URL with other API methods. Temporary files are automatically permanently removed after 1 hour. GET
or POST
request.
Status Errors
Code | Description |
---|---|
200 | The request has succeeded |
400 | bad input parameters |
401 | unauthorized |
403 | not enough credits |
405 | Timeout error. To process large documents or files please use asynchronous mode ( set async parameter to true) and then check the status using /job/check endpoint. If file contains many pages then specify a page range using pages parameter. The number of pages of the document can be obtained using the endpoint /pdf/info |
Example
Sample Request:
! Don’t forget to set x-api-key
url param or http header param (preferred) to API key, get yours here
POST
{
"file" : "data:image/gif;base64,R0lGODlhEAAQAPUtACIiIScnJigoJywsLDIyMjMzMzU1NTc3Nzg4ODk5OTs7Ozw8PEJCQlBQUFRUVFVVVVhYWG1tbXt7fInDRYvESYzFSo/HT5LJVJPJVJTKV5XKWJbKWZbLWpfLW5jLXJrMYaLRbaTScKXScKXScafTdIGBgYODg6alprLYhbvekr3elr3el9Dotf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAAAAAAIf8LSW1hZ2VNYWdpY2sNZ2FtbWE9MC40NTQ1NQAsAAAAABAAEAAABpJAFGgkKhpFIRHpw2qBLJiLdCrNTFKt0wjD2Xi/G09l1ZIwRJeNZs3uUFQtEwCCVrM1bnhJYHDU73ktJQELBH5pbW+CAQoIhn94ioMKB46HaoGTB5WPaZmMm5wOIRcekqChliIZFXqoqYYkE2SaoZuWH1gmAgsIvr8ICQUPTRIABgTJyskFAw1ZDBAO09TUDw0RQQA7"
}
Endpoint:
Method: POST
Type: POST params, JSON or FORMDATA
URL: https://api.pdf.co/v1/file/upload/base64
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
Key | Value | Description |
---|---|---|
file | data:image/gif;base64,R0lGODlhEAAQAPUtACIiIScnJigoJywsLDIyMjMzMzU1NTc3Nzg4ODk5OTs7Ozw8PEJCQlBQUFRUVFVVVVhYWG1tbXt7fInDRYvESYzFSo/HT5LJVJPJVJTKV5XKWJbKWZbLWpfLW5jLXJrMYaLRbaTScKXScKXScafTdIGBgYODg6alprLYhbvekr3elr3el9Dotf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAAAAAAIf8LSW1hZ2VNYWdpY2sNZ2FtbWE9MC40NTQ1NQAsAAAAABAAEAAABpJAFGgkKhpFIRHpw2qBLJiLdCrNTFKt0wjD2Xi/G09l1ZIwRJeNZs3uUFQtEwCCVrM1bnhJYHDU73ktJQELBH5pbW+CAQoIhn94ioMKB46HaoGTB5WPaZmMm5wOIRcekqChliIZFXqoqYYkE2SaoZuWH1gmAgsIvr8ICQUPTRIABgTJyskFAw1ZDBAO09TUDw0RQQA7 | required. Base64-encoded file bytes. Must be a String. |
More example Requests/Responses:
I. Example Request: https://api.pdf.co/v1/file/upload/base64
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
Key | Value | Description |
---|---|---|
file | data:image/gif;base64,R0lGODlhEAAQAPUtACIiIScnJigoJywsLDIyMjMzMzU1NTc3Nzg4ODk5OTs7Ozw8PEJCQlBQUFRUVFVVVVhYWG1tbXt7fInDRYvESYzFSo/HT5LJVJPJVJTKV5XKWJbKWZbLWpfLW5jLXJrMYaLRbaTScKXScKXScafTdIGBgYODg6alprLYhbvekr3elr3el9Dotf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAAAAAAIf8LSW1hZ2VNYWdpY2sNZ2FtbWE9MC40NTQ1NQAsAAAAABAAEAAABpJAFGgkKhpFIRHpw2qBLJiLdCrNTFKt0wjD2Xi/G09l1ZIwRJeNZs3uUFQtEwCCVrM1bnhJYHDU73ktJQELBH5pbW+CAQoIhn94ioMKB46HaoGTB5WPaZmMm5wOIRcekqChliIZFXqoqYYkE2SaoZuWH1gmAgsIvr8ICQUPTRIABgTJyskFAw1ZDBAO09TUDw0RQQA7 | required. Base64-encoded file bytes. Must be a String. |
I. Example Response: https://api.pdf.co/v1/file/upload/base64
{
"url": "https://pdf-temp-files.s3.amazonaws.com/a8ac8a3cec3344f08f556bfd2d678b2f/uploadfile.txt",
"error": false,
"status": 200,
"remainingCredits": 98145
}
Status Code: 200
II. Example Request: POST Upload small file as Base64: /file/upload/base64
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
Key | Value | Description |
---|---|---|
file | data:image/gif;base64,R0lGODlhEAAQAPUtACIiIScnJigoJywsLDIyMjMzMzU1NTc3Nzg4ODk5OTs7Ozw8PEJCQlBQUFRUVFVVVVhYWG1tbXt7fInDRYvESYzFSo/HT5LJVJPJVJTKV5XKWJbKWZbLWpfLW5jLXJrMYaLRbaTScKXScKXScafTdIGBgYODg6alprLYhbvekr3elr3el9Dotf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAAAAAAIf8LSW1hZ2VNYWdpY2sNZ2FtbWE9MC40NTQ1NQAsAAAAABAAEAAABpJAFGgkKhpFIRHpw2qBLJiLdCrNTFKt0wjD2Xi/G09l1ZIwRJeNZs3uUFQtEwCCVrM1bnhJYHDU73ktJQELBH5pbW+CAQoIhn94ioMKB46HaoGTB5WPaZmMm5wOIRcekqChliIZFXqoqYYkE2SaoZuWH1gmAgsIvr8ICQUPTRIABgTJyskFAw1ZDBAO09TUDw0RQQA7 | required. Base64-encoded file bytes. Must be a String. |
II. Example Response: POST Upload small file as Base64: /file/upload/base64
{
"url": "https://pdf-temp-files.s3.amazonaws.com/7588d614c9ad41eb98ec317a02abda63/uploadfile.txt",
"error": false,
"status": 200,
"remainingCredits": 77769
}
Status Code: 200
5. /file/upload/get-presigned-url (GET generate secure URL for upload)
Description: This method generates links to upload your local file to. Use this presignedUrl
from the response to upload your file. Once you upload your file to this presignedUrl
using PUT
, you can use url
link to access the uploaded file.
With this method you can upload files up to 2GB in size. Please note that to process these files you should use async=true
mode with data extraction and tools endpoints along with /job/check
to check status of background jobs you create.
Steps to Upload File:
- First, call
/file/upload/get-presigned-url
. It will generate link for uploading (presignedUrl
) and final link (url
) - Now send your file to the
presignedUrl
link usingPUT
method within next 30 minutes. - Oncce finished, use
url
to access the file you have just uploaded.
Important: all uploaded files are considered to be temporary files and are automatically permanently removed after 1 hour.
Status Errors
Code | Description |
---|---|
200 | The request has succeeded |
400 | bad input parameters |
401 | unauthorized |
403 | not enough credits |
405 | Timeout error. To process large documents or files please use asynchronous mode ( set async parameter to true) and then check the status using /job/check endpoint. If file contains many pages then specify a page range using pages parameter. The number of pages of the document can be obtained using the endpoint /pdf/info |
Example
Sample Request:
! Don’t forget to set x-api-key
url param or http header param (preferred) to API key, get yours here
GET
https://api.pdf.co/v1/file/upload/get-presigned-url?name=test.pdf&encrypt=true
200
{
"presignedUrl": "https://pdf-temp-files.s3-us-west-2.amazonaws.com/28e191b14f3a4f43b16fcef1d53d191e/test.pdf?X-Amz-Expires=900&....",
"url": "https://pdf-temp-files.s3-us-west-2.amazonaws.com/28e191b14f3a4f43b16fcef1d53d191e/test.pdf?X-Amz-Expires=....",
"error": false,
"status": 200,
"name": "test.pdf",
"remainingCredits": 93574
}
PUT
https://pdf-temp-files.s3-us-west-2.amazonaws.com/28e191b14f3a4f43b16fcef1d53d191e/test.pdf?X-Amz-Expires=900&....
--form 'file=@/path/to/file'
200
{
}
Now you can access your file using link from "url" param to from the first step.
Endpoint:
Method: GET
Type: POST params, JSON or FORMDATA
URL: https://api.pdf.co/v1/file/upload/get-presigned-url
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Query params:
Key | Value | Description |
---|---|---|
name | test.pdf | The name the file will be stored with. Must be a String. |
encrypt | true | Enable encryption for output file. Must be one of: true , false . |
More example Requests/Responses:
I. Example Request: Generate URL for upload: /file/upload/get-presigned-url
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Query:
Key | Value | Description |
---|---|---|
name | myFile.png | The filename for your future file that will be uploaded. Must be a String. |
encrypt | true | Enable encryption for output file. Must be one of: true , false . |
I. Example Response: Generate URL for upload: /file/upload/get-presigned-url
{
"presignedUrl": "https://pdf-temp-files.s3-us-west-2.amazonaws.com/63f7f641a3144f84ac209b4f514bc0df/myFile.png?X-Amz-Expires=900&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIZJDPLX6D7EHVCKA/20200716/us-west-2/s3/aws4_request&X-Amz-Date=20200716T091225Z&X-Amz-SignedHeaders=host&X-Amz-Signature=14d3eb91305d96804deccb6985cbbd4552705f5ddb2144b901a97c8e7abc1ac3",
"url": "https://pdf-temp-files.s3-us-west-2.amazonaws.com/63f7f641a3144f84ac209b4f514bc0df/myFile.png?X-Amz-Expires=3600&x-amz-security-token=FwoGZXIvYXdzECMaDC5PzTA618EQiHoskyKBAeYQcVKbK%2B0F5nnjBV6MKbPNvueaFlSBSPxPi31BdtFzw1jAIXjAvATkBwTPRx%2FVwhszDtYQRVkbhsZF6HLotVUedrcdGHOrsWV5DpN2xKgnX7xRcJrvUu0wieaJHDmHzFL1eNzFwj2927L%2BtadEfmz1a0SiEImJZujcLF78lJZ5mSj7s8D4BTIok4Xja8wyqnBBp2EOcZw8qrUxeR7Ufd0aw4bf7Z1Cur1f0PFg8hlrYQ%3D%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIA4NRRSZPHAPA4HUJS/20200716/us-west-2/s3/aws4_request&X-Amz-Date=20200716T091225Z&X-Amz-SignedHeaders=host;x-amz-security-token&X-Amz-Signature=26e27b48c5284665914fdd981d7b0b5b6e70e64839f28621f3dc82256e492879",
"error": false,
"status": 200,
"name": "myFile.png",
"remainingCredits": 77779
}
Status Code: 200
II. Example Request: /file/upload/get-presigned-url
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Query:
Key | Value | Description |
---|---|---|
name | test.pdf | The name the file will be stored with. Must be a String. |
encrypt | true | Enable encryption for output file. Must be one of: true , false . |
II. Example Response: /file/upload/get-presigned-url
{
"presignedUrl": "https://pdf-temp-files.s3-us-west-2.amazonaws.com/0c72bf56341142ba83c8f98b47f14d62/test.pdf?X-Amz-Expires=900&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIZJDPLX6D7EHVCKA/20200302/us-west-2/s3/aws4_request&X-Amz-Date=20200302T143951Z&X-Amz-SignedHeaders=host&X-Amz-Signature=8650913644b6425ba8d52b78634698e5fc8970157d971a96f0279a64f4ba87fc",
"url": "https://pdf-temp-files.s3-us-west-2.amazonaws.com/0c72bf56341142ba83c8f98b47f14d62/test.pdf?X-Amz-Expires=3600&x-amz-security-token=FwoGZXIvYXdzEGgaDA9KaTOXRjkCdCqSTCKBAW9tReCLk1fVTZBH9exl9VIbP8Gfp1pE9hg6et94IBpNamOaBJ6%2B9Vsa5zxfiddlgA%2BxQ4tpd9gprFAxMzjN7UtjU%2B2gf%2FKbUKc2lfV18D2wXKd1FEhC6kkGJVL5UaoFONG%2Fw2jXfLxe3nCfquMEDo12XzcqIQtNFWXjKPWBkQEvmii4tfTyBTIot4Na%2BAUqkLshH0R7HVKlEBV8btqa0ctBjwzwpWkoU%2BF%2BCtnm8Lm4Eg%3D%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIA4NRRSZPHEGHTOA4W/20200302/us-west-2/s3/aws4_request&X-Amz-Date=20200302T143951Z&X-Amz-SignedHeaders=host;x-amz-security-token&X-Amz-Signature=243419ac4a9a315eebc2db72df0817de6a261a684482bbc897f0e7bb5d202bb9",
"error": false,
"status": 200,
"name": "test.pdf",
"remainingCredits": 98145
}
Status Code: 200
6. /file/upload/url (Upload file from URL)
Description: Downloads file from a source url and uploads it as a temporary file. Temporary files are automatically permanently removed after 1 hour.
Status Errors
Code | Description |
---|---|
200 | The request has succeeded |
400 | bad input parameters |
401 | unauthorized |
403 | not enough credits |
405 | Timeout error. To process large documents or files please use asynchronous mode ( set async parameter to true) and then check the status using /job/check endpoint. If file contains many pages then specify a page range using pages parameter. The number of pages of the document can be obtained using the endpoint /pdf/info |
Example
Sample Request:
! Don’t forget to set x-api-key
url param or http header param (preferred) to API key, get yours here
POST
{
"url" : "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-split/sample.pdf"
}
Endpoint:
Method: POST
Type: POST params, JSON or FORMDATA
URL: https://api.pdf.co/v1/file/upload/url
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
Key | Value | Description |
---|---|---|
name | sample.pdf | optional. The name the file will be stored with. Must be a String. |
url | https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-split/sample.pdf | required. URL of the file to upload. Must be a String. |
More example Requests/Responses:
I. Example Request: POST Upload from URL: /file/upload/url
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
Key | Value | Description |
---|---|---|
name | sample.pdf | optional. The name the file will be stored with. Must be a String. |
url | https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-split/sample.pdf | required. URL of the file to upload. Must be a String. |
I. Example Response: POST Upload from URL: /file/upload/url
{
"url": "https://pdf-temp-files.s3.amazonaws.com/4e36f2962b7f4248b7167f4389d534d5/sample.pdf",
"error": false,
"status": 200,
"name": "sample.pdf",
"remainingCredits": 77767
}
Status Code: 200
II. Example Request: /file/upload/url
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
Key | Value | Description |
---|---|---|
name | optional. The name the file will be stored with. Must be a String. | |
url | https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-split/sample.pdf | required. URL of the file to upload. Must be a String. |
II. Example Response: /file/upload/url
{
"url": "https://pdf-temp-files.s3.amazonaws.com/1a4a92ac805c41c28ef75a24e0f35ba5/sample.pdf",
"error": false,
"status": 200,
"name": "sample.pdf",
"remainingCredits": 98145
}
Status Code: 200
7. /file/upload/url (Upload from URL)
Description: Downloads file from a source url and uploads it as a temporary file. Temporary files are automatically permanently removed after 1 hour.
Status Errors
Code | Description |
---|---|
200 | The request has succeeded |
400 | bad input parameters |
401 | unauthorized |
403 | not enough credits |
405 | Timeout error. To process large documents or files please use asynchronous mode ( set async parameter to true) and then check the status using /job/check endpoint. If file contains many pages then specify a page range using pages parameter. The number of pages of the document can be obtained using the endpoint /pdf/info |
Example
Sample Request:
! Don’t forget to set x-api-key
url param or http header param (preferred) to API key, get yours here
POST
{
"url" : "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-split/sample.pdf"
}
Endpoint:
Method: GET
Type: POST params, JSON or FORMDATA
URL: https://api.pdf.co/v1/file/upload/url
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Query params:
Key | Value | Description |
---|---|---|
url | https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-split/sample.pdf |
More example Requests/Responses:
I. Example Request: GET Upload from URL: /file/upload/url
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Query:
Key | Value | Description |
---|---|---|
url | https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-split/sample.pdf |
I. Example Response: GET Upload from URL: /file/upload/url
{
"url": "https://pdf-temp-files.s3.amazonaws.com/97415d1c45a04b29ac42c8dc01883316/sample.pdf",
"error": false,
"status": 200,
"name": "sample.pdf",
"remainingCredits": 77765
}
Status Code: 200
II. Example Request: /file/upload/url
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
II. Example Response: /file/upload/url
{
"url": "https://pdf-temp-files.s3.amazonaws.com/703aa298cfe745baa3449fbdaba4d1d7/sample.pdf",
"error": false,
"status": 200,
"name": "sample.pdf",
"remainingCredits": 98145
}
Status Code: 200
8. PUT presignedUrl
–formdata file=..
With this method you can upload files up to 2GB in size. Please note that to process these files you should use async=true
mode with data extraction and tools endpoints along with /job/check
to check status of background jobs you create.
Steps to Upload File:
- First, call
/file/upload/get-presigned-url
. It will generate link for uploading (presignedUrl
) and final link (url
) - Now send your file to the
presignedUrl
link usingPUT
method within next 30 minutes. - Oncce finished, use
url
to access the file you have just uploaded.
Important: all uploaded files are considered to be temporary files and are automatically permanently removed after 1 hour.
Status Errors
Code | Description |
---|---|
200 | The request has succeeded |
400 | bad input parameters |
401 | unauthorized |
403 | not enough credits |
405 | Timeout error. To process large documents or files please use asynchronous mode ( set async parameter to true) and then check the status using /job/check endpoint. If file contains many pages then specify a page range using pages parameter. The number of pages of the document can be obtained using the endpoint /pdf/info |
Workflow
Sample Request:
! Don’t forget to set x-api-key
url param or http header param (preferred) to API key, get yours here
Generate secure link where you will upload your file:
GET
https://api.pdf.co/v1/file/upload/get-presigned-url?name=test.pdf&encrypt=true
200
{
"presignedUrl": "https://pdf-temp-files.s3-us-west-2.amazonaws.com/28e191b14f3a4f43b16fcef1d53d191e/test.pdf?X-Amz-Expires=900&....",
"url": "https://pdf-temp-files.s3-us-west-2.amazonaws.com/28e191b14f3a4f43b16fcef1d53d191e/test.pdf?X-Amz-Expires=....",
}
Now all PUT to upload file to "presignedUrl" you've got:
https://pdf-temp-files.s3-us-west-2.amazonaws.com/28e191b14f3a4f43b16fcef1d53d191e/test.pdf?X-Amz-Expires=900&....
--form 'file=@/path/to/file'
200
{
}
Now your file is available via link from "url" param from the first step
Endpoint:
Method: PUT
Type: POST params, JSON or FORMDATA
URL: <insert presignedUrl generated by https://api.pdf.co/v1/file/upload/get-presigned-url >
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
Key | Value | Description |
---|---|---|
file | Local file to upload. |
More example Requests/Responses:
I. Example Request: /file/upload/get-presigned-url
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Query:
Key | Value | Description |
---|---|---|
name | test.pdf | The name the file will be stored with. Must be a String. |
encrypt | true | Enable encryption for output file. Must be one of: true , false . |
I. Example Response: /file/upload/get-presigned-url
{
"presignedUrl": "https://pdf-temp-files.s3-us-west-2.amazonaws.com/0c72bf56341142ba83c8f98b47f14d62/test.pdf?X-Amz-Expires=900&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIZJDPLX6D7EHVCKA/20200302/us-west-2/s3/aws4_request&X-Amz-Date=20200302T143951Z&X-Amz-SignedHeaders=host&X-Amz-Signature=8650913644b6425ba8d52b78634698e5fc8970157d971a96f0279a64f4ba87fc",
"url": "https://pdf-temp-files.s3-us-west-2.amazonaws.com/0c72bf56341142ba83c8f98b47f14d62/test.pdf?X-Amz-Expires=3600&x-amz-security-token=FwoGZXIvYXdzEGgaDA9KaTOXRjkCdCqSTCKBAW9tReCLk1fVTZBH9exl9VIbP8Gfp1pE9hg6et94IBpNamOaBJ6%2B9Vsa5zxfiddlgA%2BxQ4tpd9gprFAxMzjN7UtjU%2B2gf%2FKbUKc2lfV18D2wXKd1FEhC6kkGJVL5UaoFONG%2Fw2jXfLxe3nCfquMEDo12XzcqIQtNFWXjKPWBkQEvmii4tfTyBTIot4Na%2BAUqkLshH0R7HVKlEBV8btqa0ctBjwzwpWkoU%2BF%2BCtnm8Lm4Eg%3D%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIA4NRRSZPHEGHTOA4W/20200302/us-west-2/s3/aws4_request&X-Amz-Date=20200302T143951Z&X-Amz-SignedHeaders=host;x-amz-security-token&X-Amz-Signature=243419ac4a9a315eebc2db72df0817de6a261a684482bbc897f0e7bb5d202bb9",
"error": false,
"status": 200,
"name": "test.pdf",
"remainingCredits": 98145
}
Status Code: 200
II. Example Request: PUT Upload File PUT presignedUrl
–formdata file=..
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
Key | Value | Description |
---|---|---|
file | Local file to upload. |
Status Code: 200
PDF Add Text and Images to PDF
Add text, images, links to PDF files. You can update or modify PDF and scanned PDF files.
1. /pdf/edit/add
adds text, images, text fields, unchecked checkbox, checked checkbox to existing PDF file. You can fill out out existing PDF forms and documents and create new fillable PDF forms using this method.
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.annotations[]
. optional. Array of text objects to be added on top of pdf. Text objects can be ready-only ("type": "text"
by default), input pdf input fields ("type": "textField"
) or checkboxes ("type": "checkbox"
). Sample:"annotations": [ { "text": "Testing Clickable Links \r\n(CLICK ME!)", "x": 200, "y": 200, "size": 24, "pages": "0-", "color": "CCBBAA", "link": "https://bytescout.com/" }, { "text": "Testing Clickable Links \r\n(CLICK ME!)", "x": 200, "y": 200, "size": 24, "pages": "0-", "color": "CCBBAA", "link": "https://bytescout.com/", "fontName": "Colibri", "fontItalic": true, "fontBold": true, "fontStrikeout": false, "fontUnderline": true, "type": "text" }, { "text": "sample pdf input field with prefilled text", "x": 10, "y": 30, "size": 12, "pages": "0-", "type": "TextField", "id": "textfield1" }, { "x": 100, "y": 150, "size": 12, "pages": "0-", "type": "Checkbox", "id": "checkbox2" } ]
images[]
optional. Array of image objects to be added on top of PDF file. Images can be loaded from URL or from URLs for internal file storage. Sample:"images": [ { "url": "bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png", "x": 200, "y": 250, "pages": "0", "link": "www.pdf.co" } ]
fields[]
optional. Array of values to update filable pdf fields in input pdf. You can create your own automated PDF filler for your pdf forms using this array. Sample:"fields: [ { "fieldName": "topmostSubform[0].Page1[0].FilingStatus[0].c1_01[1]", "pages": "1", "text": "True" }, { "fieldName": "topmostSubform[0].Page1[0].FilingStatus[0].c1_01[1]", "pages": "1", "text": "True" } ]
password
optional. Password of PDF file. Must be a Stringasync
optional. Runs processing asynchronously. Returns UseJobId
that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.name
optional. File name for generated output. Must be a String.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/edit/add
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"async": false,
"encrypt": true,
"name": "newDocument",
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/sample.pdf",
"annotations": [
{
"text": "Testing, one, two, three.",
"x": 10,
"y": 10,
"size": 12,
"pages": "0-"
},
{
"text": "Testing Clickable Links \r\n(CLICK ME!)",
"x": 200,
"y": 200,
"size": 24,
"pages": "0-",
"color": "CCBBAA",
"link": "https://bytescout.com/",
"fontName": "Colibri",
"fontItalic": true,
"fontBold": true,
"fontStrikeout": false,
"fontUnderline": true
},
{
"text": "Simple text label (default type)",
"x": 100,
"y": 100,
"size": 12,
"pages": "0-",
"type": "Text"
},
{
"text": "sample prefilled text",
"x": 10,
"y": 30,
"size": 12,
"pages": "0-",
"type": "TextField",
"id": "textfield1"
},
{
"x": 100,
"y": 150,
"size": 12,
"pages": "0-",
"type": "Checkbox",
"id": "checkbox2"
},
{
"x": 100,
"y": 170,
"size": 12,
"pages": "0-",
"link": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png",
"type": "CheckboxChecked",
"id": "checkbox3"
}
],
"images": [
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png",
"x": 450,
"y": 10,
"pages": "0"
},
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png",
"x": 450,
"y": 100,
"width": 50,
"height": 50,
"pages": "0"
},
{
"url": "bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png",
"x": 200,
"y": 250,
"pages": "0",
"link": "www.pdf.co"
}
]
}
More example Requests/Responses:
I. Example Request: POST /pdf/edit/add
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"async": false,
"encrypt": true,
"name": "newDocument",
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/sample.pdf",
"annotations":[
{
"text":"Testing, one, two, three.",
"x": 10,
"y": 10,
"size": 12,
"pages": "0-"
},
{
"text":"Testing Clickable Links \r\n(CLICK ME!)",
"x": 200,
"y": 200,
"size": 24,
"pages": "0-",
"color": "CCBBAA",
"link": "https://bytescout.com/"
},
{
"text":"Simple text label (default type)",
"x": 100,
"y": 100,
"size": 12,
"pages": "0-",
"type": "Text"
},
{
"text":"sample prefilled text",
"x": 10,
"y": 30,
"size": 12,
"pages": "0-",
"type": "TextField",
"id": "textfield1"
},
{
"x": 100,
"y": 150,
"size": 12,
"pages": "0-",
"type": "Checkbox",
"id": "checkbox2"
},
{
"x": 100,
"y": 170,
"size": 12,
"pages": "0-",
"link": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png",
"type": "CheckboxChecked",
"id":"checkbox3"
}
],
"images": [
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png",
"x": 450,
"y": 10,
"pages": "0"
},
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png",
"x": 450,
"y": 100,
"width": 50,
"height": 50,
"pages": "0"
},
{
"url": "bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png",
"x": 200,
"y": 250,
"pages": "0",
"link": "www.pdf.co"
}
]
}
I. Example Response: POST /pdf/edit/add
{
"url": "https://pdf-temp-files.s3-us-west-2.amazonaws.com/d5c6efa549194ffaacb2eedd318e0320/newDocument.pdf?X-Amz-Expires=3600&x-amz-security-token=FwoGZXIvYXdzECMaDJJV7qKrpnGUrZHrwSKBATR5rxVlQoU0zj3r4jyHPt7yj4HoCIBi65IbMRWVX8qZZtKL9YGUzP%2FcemlqVd4Vi5%2B80Sg%2BymqQtaQ8qSFqKA82JnV%2BNBDatIigZIZha%2BrQM3jSC%2FZhX1zxsfLLsaH3K5nBnkjT3gi%2FZnx%2FgqrlIhf3m2xRFaTlgHrBADlK9KKPIijSusD4BTIo%2FQ433xx%2FQEaGWdX0nu4NuiByyXNPsBCAI3im9LMUCujjqF79ocyLHA%3D%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIA4NRRSZPHCSWKUQ4T/20200716/us-west-2/s3/aws4_request&X-Amz-Date=20200716T092641Z&X-Amz-SignedHeaders=host;x-amz-security-token&X-Amz-Signature=2aa88d39aaf4b5891e4cb42d5675a64486098558d7159b37b75252209bdd6a95",
"pageCount": 1,
"error": false,
"status": 200,
"name": "newDocument",
"remainingCredits": 77762
}
Status Code: 200
2. /pdf/edit/add (with simplified parameters)
You can add text, images, fill pdf fields in existing PDF files and PDF forms. This method uses simplified version of /pdf/edit/add
that allows you to add multiple text, images, fill pdf fields.
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.annotationsString
optional. Add one or more text objects on top of pdf. Each text object to be added can be described asx;y;pages;text;fontsize;fontname;fontcolor;link;transparent
. Sample:20;20;0-;Testing Text;24;Arial;FF0000;www.pdf.co;false
. To separate multiple objects, use|
separator. where24
is the font size. You can also add styles intoto the font size using the following modifiers:+bold
for bold style+italic
for italic style+underline
for underline style+strikeout
for strikeout style
For example, for font size 24 and
bold
,italic
,underline
andstrikeout
styles:
250;20;0-;PDF form filled with PDF.co API;24+bold+italic+underline+strikeout;Arial;FF0000;www.pdf.co;true
imagesString
optional. Adds one or more images on top of pdf. Each image object can be defined asx;y;pages;urltoimage;linkToOpen;width;height
for example:20;80;0-;bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png;www.pdf.co;200;200
. To separate multiple objects, use|
separator.fieldsString
optional. Set values for fillable pdf fields (i.e. fill pdf fields in pdf forms). To fill fields in PDF form, use the following formatpage;fieldName;value
. Sample:0;editbox1;text is here
. To fill checkbox, usetrue
, for example:0;checkbox1;true
. To separate multiple objects, use|
separator. To get the list of all fillable fields in PDF form please use/pdf/info/fields
endpoint.password
optional. Password of PDF file. Must be a Stringasync
optional. Runs processing asynchronously. Returns UseJobId
that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.name
optional. File name for generated output. Must be a String.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/edit/add
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"async": false,
"encrypt": false,
"name": "f1040-form-filled",
"url": "bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-form/f1040.pdf",
"annotationsString": "250;20;0-;PDF form filled with PDF.co API;24+bold+italic+underline+strikeout;Arial;FF0000;www.pdf.co;true",
"imagesString": "100;180;0-;bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png|400;180;0-;bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png;www.pdf.co;200;200",
"fieldsString": "1;topmostSubform[0].Page1[0].f1_02[0];John A. Doe|1;topmostSubform[0].Page1[0].FilingStatus[0].c1_01[1];true|1;topmostSubform[0].Page1[0].YourSocial_ReadOrderControl[0].f1_04[0];123456789"
}
More example Requests/Responses:
I. Example Request: JSON simplified /pdf/edit/add
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"async": false,
"encrypt": false,
"name": "f1040-form-filled",
"url": "bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-form/f1040.pdf",
"annotationsString": "20;20;0-;PDF form filled with PDF.co API;24;Arial;FF0000;www.pdf.co;true",
"imagesString": "100;180;0-;bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png|400;180;0-;bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png;www.pdf.co;200;200",
"fieldsString": "1;topmostSubform[0].Page1[0].f1_02[0];John A. Doe|1;topmostSubform[0].Page1[0].FilingStatus[0].c1_01[1];true|1;topmostSubform[0].Page1[0].YourSocial_ReadOrderControl[0].f1_04[0];123456789"
}
I. Example Response: JSON simplified /pdf/edit/add
{
"url": "https://pdf-temp-files.s3.amazonaws.com/03c5c55183c74f8d94a4ec952e4e32ad/f1040-form-filled.pdf",
"pageCount": 3,
"error": false,
"status": 200,
"name": "f1040-form-filled",
"remainingCredits": 60822
}
Status Code: 200
PDF Create Fillable PDF Forms
Create PDF forms with fillable edit boxes, checkboxes and other fillable fields.
1. /pdf/edit/add
You can create fillable PDF form from existing PDF by adding editable text boxes and checkboxes.
adds text, images, text fields, unchecked checkbox, checked checkbox to existing PDF file. You can fill out out existing PDF forms and documents and create new fillable PDF forms using this method.
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.annotations[]
. optional. Array of text objects to be added on top of pdf. Text objects can be ready-only ("type": "text"
by default), input pdf input fields ("type": "textField"
) or checkboxes ("type": "checkbox"
). Sample:"annotations": [ { "text": "Testing Clickable Links \r\n(CLICK ME!)", "x": 200, "y": 200, "size": 24, "pages": "0-", "color": "CCBBAA", "link": "https://bytescout.com/" }, { "text": "Testing Clickable Links \r\n(CLICK ME!)", "x": 200, "y": 200, "size": 24, "pages": "0-", "color": "CCBBAA", "link": "https://bytescout.com/", "fontName": "Colibri", "fontItalic": true, "fontBold": true, "fontStrikeout": false, "fontUnderline": true, "type": "text" }, { "text": "sample pdf input field with prefilled text", "x": 10, "y": 30, "size": 12, "pages": "0-", "type": "TextField", "id": "textfield1" }, { "x": 100, "y": 150, "size": 12, "pages": "0-", "type": "Checkbox", "id": "checkbox2" } ]
images[]
optional. Array of image objects to be added on top of PDF file. Images can be loaded from URL or from URLs for internal file storage. Sample:"images": [ { "url": "bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png", "x": 200, "y": 250, "pages": "0", "link": "www.pdf.co" } ]
fields[]
optional. Array of values to update filable pdf fields in input pdf. You can create your own automated PDF filler for your pdf forms using this array. Sample:"fields: [ { "fieldName": "topmostSubform[0].Page1[0].FilingStatus[0].c1_01[1]", "pages": "1", "text": "True" }, { "fieldName": "topmostSubform[0].Page1[0].FilingStatus[0].c1_01[1]", "pages": "1", "text": "True" } ]
password
optional. Password of PDF file. Must be a Stringasync
optional. Runs processing asynchronously. Returns UseJobId
that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.name
optional. File name for generated output. Must be a String.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/edit/add
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"async": false,
"encrypt": true,
"name": "newDocument",
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/sample.pdf",
"annotations":[
{
"text":"sample prefilled text",
"x": 10,
"y": 30,
"size": 12,
"pages": "0-",
"type": "TextField",
"id": "textfield1"
},
{
"x": 100,
"y": 150,
"size": 12,
"pages": "0-",
"type": "Checkbox",
"id": "checkbox2"
},
{
"x": 100,
"y": 170,
"size": 12,
"pages": "0-",
"link": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png",
"type": "CheckboxChecked",
"id":"checkbox3"
}
],
"images": [
{
"url": "bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png",
"x": 200,
"y": 250,
"pages": "0",
"link": "www.pdf.co"
}
]
}
More example Requests/Responses:
I. Example Request: POST /pdf/edit/add
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"async": false,
"encrypt": true,
"name": "newDocument",
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/sample.pdf",
"annotations":[
{
"text":"Testing, one, two, three.",
"x": 10,
"y": 10,
"size": 12,
"pages": "0-"
},
{
"text":"Testing Clickable Links \r\n(CLICK ME!)",
"x": 200,
"y": 200,
"size": 24,
"pages": "0-",
"color": "CCBBAA",
"link": "https://bytescout.com/"
},
{
"text":"Simple text label (default type)",
"x": 100,
"y": 100,
"size": 12,
"pages": "0-",
"type": "Text"
},
{
"text":"sample prefilled text",
"x": 10,
"y": 30,
"size": 12,
"pages": "0-",
"type": "TextField",
"id": "textfield1"
},
{
"x": 100,
"y": 150,
"size": 12,
"pages": "0-",
"type": "Checkbox",
"id": "checkbox2"
},
{
"x": 100,
"y": 170,
"size": 12,
"pages": "0-",
"link": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png",
"type": "CheckboxChecked",
"id":"checkbox3"
}
],
"images": [
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png",
"x": 450,
"y": 10,
"pages": "0"
},
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png",
"x": 450,
"y": 100,
"width": 50,
"height": 50,
"pages": "0"
},
{
"url": "bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png",
"x": 200,
"y": 250,
"pages": "0",
"link": "www.pdf.co"
}
]
}
I. Example Response: POST /pdf/edit/add
{
"url": "https://pdf-temp-files.s3-us-west-2.amazonaws.com/d5c6efa549194ffaacb2eedd318e0320/newDocument.pdf?X-Amz-Expires=3600&x-amz-security-token=FwoGZXIvYXdzECMaDJJV7qKrpnGUrZHrwSKBATR5rxVlQoU0zj3r4jyHPt7yj4HoCIBi65IbMRWVX8qZZtKL9YGUzP%2FcemlqVd4Vi5%2B80Sg%2BymqQtaQ8qSFqKA82JnV%2BNBDatIigZIZha%2BrQM3jSC%2FZhX1zxsfLLsaH3K5nBnkjT3gi%2FZnx%2FgqrlIhf3m2xRFaTlgHrBADlK9KKPIijSusD4BTIo%2FQ433xx%2FQEaGWdX0nu4NuiByyXNPsBCAI3im9LMUCujjqF79ocyLHA%3D%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIA4NRRSZPHCSWKUQ4T/20200716/us-west-2/s3/aws4_request&X-Amz-Date=20200716T092641Z&X-Amz-SignedHeaders=host;x-amz-security-token&X-Amz-Signature=2aa88d39aaf4b5891e4cb42d5675a64486098558d7159b37b75252209bdd6a95",
"pageCount": 1,
"error": false,
"status": 200,
"name": "newDocument",
"remainingCredits": 77762
}
Status Code: 200
PDF Delete Pages
Delete pages from PDF document.
1. /pdf/edit/delete-pages
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.pages
optional. Comma-separated list of page indices (or ranges) to remove. IMPORTANT: the very first page starts at1
(one). To set a range use the dash-
, for example:1,2-5,7-
. To set a range from index to the last page use range like this:2-
. For ALL pages just leave this param empty. Must be a String.name
optional. File name for generated output. Must be a String.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/edit/delete-pages
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-split/sample.pdf",
"pages": "1-2",
"name": "result.pdf"
}
More example Requests/Responses:
I. Example Request: /pdf/edit/delete-pages
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-split/sample.pdf",
"pages": "1-2",
"name": "result.pdf"
}
I. Example Response: /pdf/edit/delete-pages
{
"url": "https://pdf-temp-files.s3.amazonaws.com/d15e5b2c89c04484ae6ac7244ac43ac2/result.pdf",
"pageCount": 2,
"error": false,
"status": 200,
"name": "result.pdf",
"remainingCredits": 60100
}
Status Code: 200
PDF Fill PDF Forms
PDF filler for fillable PDF forms using PDF.co. To get a list of all fillable fields inside specific PDF form, please use /pdf/info/fields
endpoint. If you need to create your own fillable form then please check PDF Create Fillable PDF Forms
topic.
1. /pdf/edit/add
adds text, images, text fields, unchecked checkbox, checked checkbox to existing PDF file. You can fill out out existing PDF forms and documents and create new fillable PDF forms using this method.
adds text, images, text fields, unchecked checkbox, checked checkbox to existing PDF file. You can fill out out existing PDF forms and documents and create new fillable PDF forms using this method.
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.annotations[]
. optional. Array of text objects to be added on top of pdf. Text objects can be ready-only ("type": "text"
by default), input pdf input fields ("type": "textField"
) or checkboxes ("type": "checkbox"
). Sample:"annotations": [ { "text": "Testing Clickable Links \r\n(CLICK ME!)", "x": 200, "y": 200, "size": 24, "pages": "0-", "color": "CCBBAA", "link": "https://bytescout.com/" }, { "text": "Testing Clickable Links \r\n(CLICK ME!)", "x": 200, "y": 200, "size": 24, "pages": "0-", "color": "CCBBAA", "link": "https://bytescout.com/", "fontName": "Colibri", "fontItalic": true, "fontBold": true, "fontStrikeout": false, "fontUnderline": true, "type": "text" }, { "text": "sample pdf input field with prefilled text", "x": 10, "y": 30, "size": 12, "pages": "0-", "type": "TextField", "id": "textfield1" }, { "x": 100, "y": 150, "size": 12, "pages": "0-", "type": "Checkbox", "id": "checkbox2" } ]
images[]
optional. Array of image objects to be added on top of PDF file. Images can be loaded from URL or from URLs for internal file storage. Sample:"images": [ { "url": "bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png", "x": 200, "y": 250, "pages": "0", "link": "www.pdf.co" } ]
fields[]
optional. Array of values to update filable pdf fields in input pdf. You can create your own automated PDF filler for your pdf forms using this array. Sample:"fields: [ { "fieldName": "topmostSubform[0].Page1[0].FilingStatus[0].c1_01[1]", "pages": "1", "text": "True" }, { "fieldName": "topmostSubform[0].Page1[0].FilingStatus[0].c1_01[1]", "pages": "1", "text": "True" } ]
password
optional. Password of PDF file. Must be a Stringasync
optional. Runs processing asynchronously. Returns UseJobId
that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.name
optional. File name for generated output. Must be a String.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/edit/add
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"async": false,
"encrypt": false,
"name": "f1040-filled",
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-form/f1040.pdf",
"fields": [
{
"fieldName": "topmostSubform[0].Page1[0].FilingStatus[0].c1_01[1]",
"pages": "1",
"text": "True"
},
{
"fieldName": "topmostSubform[0].Page1[0].f1_02[0]",
"pages": "1",
"text": "John A."
},
{
"fieldName": "topmostSubform[0].Page1[0].f1_03[0]",
"pages": "1",
"text": "Doe"
},
{
"fieldName": "topmostSubform[0].Page1[0].YourSocial_ReadOrderControl[0].f1_04[0]",
"pages": "1",
"text": "123456789"
},
{
"fieldName": "topmostSubform[0].Page1[0].YourSocial_ReadOrderControl[0].f1_05[0]",
"pages": "1",
"text": "Joan B."
},
{
"fieldName": "topmostSubform[0].Page1[0].YourSocial_ReadOrderControl[0].f1_05[0]",
"pages": "1",
"text": "Joan B."
},
{
"fieldName": "topmostSubform[0].Page1[0].YourSocial_ReadOrderControl[0].f1_06[0]",
"pages": "1",
"text": "Doe"
},
{
"fieldName": "topmostSubform[0].Page1[0].YourSocial_ReadOrderControl[0].f1_07[0]",
"pages": "1",
"text": "987654321"
}
],
"annotations":[
{
"text":"Sample Filled with PDF.co API using /pdf/edit/add. Get fields from forms using /pdf/info/fields",
"x": 10,
"y": 10,
"size": 12,
"pages": "0-",
"color": "FFCCCC",
"link": "https://pdf.co"
}
],
"images": [
]
}
More example Requests/Responses:
I. Example Request: POST /pdf/edit/add
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"async": false,
"encrypt": false,
"name": "f1040-filled",
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-form/f1040.pdf",
"fields": [
{
"fieldName": "topmostSubform[0].Page1[0].FilingStatus[0].c1_01[1]",
"pages": "1",
"text": "True"
},
{
"fieldName": "topmostSubform[0].Page1[0].f1_02[0]",
"pages": "1",
"text": "John A."
},
{
"fieldName": "topmostSubform[0].Page1[0].f1_03[0]",
"pages": "1",
"text": "Doe"
},
{
"fieldName": "topmostSubform[0].Page1[0].YourSocial_ReadOrderControl[0].f1_04[0]",
"pages": "1",
"text": "123456789"
},
{
"fieldName": "topmostSubform[0].Page1[0].YourSocial_ReadOrderControl[0].f1_05[0]",
"pages": "1",
"text": "Joan B."
},
{
"fieldName": "topmostSubform[0].Page1[0].YourSocial_ReadOrderControl[0].f1_05[0]",
"pages": "1",
"text": "Joan B."
},
{
"fieldName": "topmostSubform[0].Page1[0].YourSocial_ReadOrderControl[0].f1_06[0]",
"pages": "1",
"text": "Doe"
},
{
"fieldName": "topmostSubform[0].Page1[0].YourSocial_ReadOrderControl[0].f1_07[0]",
"pages": "1",
"text": "987654321"
}
],
"annotations":[
{
"text":"Sample Filled with PDF.co API using /pdf/edit/add. Get fields from forms using /pdf/info/fields",
"x": 10,
"y": 10,
"size": 12,
"pages": "0-",
"color": "FFCCCC",
"link": "https://pdf.co"
}
],
"images": [
]
}
I. Example Response: POST /pdf/edit/add
{
"url": "https://pdf-temp-files.s3.amazonaws.com/6e12bf1e57e347a381e69d626159de92/f1040-filled.pdf",
"pageCount": 3,
"error": false,
"status": 200,
"name": "f1040-filled",
"remainingCredits": 61317
}
Status Code: 200
2. /pdf/edit/add (with simplified params)
You can add fill pdf fields in existing PDF PDF forms. This method uses simplified version of /pdf/edit/add
.
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.annotationsString
optional. Add one or more text objects on top of pdf. Each text object to be added can be described asx;y;pages;text;fontsize;fontname;fontcolor;link;transparent
. Sample:20;20;0-;Testing Text;24;Arial;FF0000;www.pdf.co;false
. To separate multiple objects, use|
separator. where24
is the font size. You can also add styles intoto the font size using the following modifiers:+bold
for bold style+italic
for italic style+underline
for underline style+strikeout
for strikeout style
For example, for font size 24 and
bold
,italic
,underline
andstrikeout
styles:
250;20;0-;PDF form filled with PDF.co API;24+bold+italic+underline+strikeout;Arial;FF0000;www.pdf.co;true
imagesString
optional. Adds one or more images on top of pdf. Each image object can be defined asx;y;pages;urltoimage;linkToOpen;width;height
for example:20;80;0-;bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png;www.pdf.co;200;200
. To separate multiple objects, use|
separator.fieldsString
optional. Set values for fillable pdf fields (i.e. fill pdf fields in pdf forms). To fill fields in PDF form, use the following formatpage;fieldName;value
. Sample:0;editbox1;text is here
. To fill checkbox, usetrue
, for example:0;checkbox1;true
. To separate multiple objects, use|
separator. To get the list of all fillable fields in PDF form please use/pdf/info/fields
endpoint.password
optional. Password of PDF file. Must be a Stringasync
optional. Runs processing asynchronously. Returns UseJobId
that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.name
optional. File name for generated output. Must be a String.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/edit/add
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"async": false,
"encrypt": false,
"name": "f1040-form-filled",
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-form/f1040.pdf",
"fieldsString": "1;topmostSubform[0].Page1[0].f1_02[0];John A. Doe|1;topmostSubform[0].Page1[0].FilingStatus[0].c1_01[1];true|1;topmostSubform[0].Page1[0].YourSocial_ReadOrderControl[0].f1_04[0];123456789"
}
More example Requests/Responses:
I. Example Request: JSON simplified /pdf/edit/add
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"async": false,
"encrypt": false,
"name": "f1040-form-filled",
"url": "bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-form/f1040.pdf",
"annotationsString": "20;20;0-;PDF form filled with PDF.co API;24;Arial;FF0000;www.pdf.co;true",
"imagesString": "100;180;0-;bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png|400;180;0-;bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png;www.pdf.co;200;200",
"fieldsString": "1;topmostSubform[0].Page1[0].f1_02[0];John A. Doe|1;topmostSubform[0].Page1[0].FilingStatus[0].c1_01[1];true|1;topmostSubform[0].Page1[0].YourSocial_ReadOrderControl[0].f1_04[0];123456789"
}
I. Example Response: JSON simplified /pdf/edit/add
{
"url": "https://pdf-temp-files.s3.amazonaws.com/03c5c55183c74f8d94a4ec952e4e32ad/f1040-form-filled.pdf",
"pageCount": 3,
"error": false,
"status": 200,
"name": "f1040-form-filled",
"remainingCredits": 60822
}
Status Code: 200
PDF Forms Info Reader
Get information about fillable fields inside PDF form file.
1. /pdf/info/fields
Extracts information about fillable PDF fields (fillable edit boxes, fillable checkboxes, radioboxes, comboboxes) from input PDF file along with general information about input PDF document. The purpose of this endpoint is to get information about fillable PDF for use with PDF.co pdf filler (/pdf/edit/add
method)
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/info/fields
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-form/f1040.pdf"
}
More example Requests/Responses:
I. Example Request: /pdf/info/fields
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-form/f1040.pdf"
}
I. Example Response: /pdf/info/fields
{
"info": {
"PageCount": 3,
"Author": "SE:W:CAR:MP",
"Title": "2019 Form 1040",
"Producer": "macOS Version 10.15.1 (Build 19B88) Quartz PDFContext",
"Subject": "U.S. Individual Income Tax Return",
"CreationDate": "8/7/2020 11:17:29 AM",
"Bookmarks": "",
"Keywords": "Fillable",
"Creator": "Adobe LiveCycle Designer ES 9.0",
"Encrypted": false,
"PasswordProtected": false,
"PageRectangle": {
"Location": {
"IsEmpty": true,
"X": 0,
"Y": 0
},
"Size": "612, 792",
"X": 0,
"Y": 0,
"Width": 612,
"Height": 792,
"Left": 0,
"Top": 0,
"Right": 612,
"Bottom": 792,
"IsEmpty": false
},
"ModificationDate": "8/7/2020 11:17:29 AM",
"EncryptionAlgorithm": "None",
"PermissionPrinting": true,
"PermissionModifyDocument": true,
"PermissionContentExtraction": true,
"PermissionModifyAnnotations": true,
"PermissionFillForms": true,
"PermissionAccessibility": true,
"PermissionAssemble": true,
"PermissionHighQualityPrint": true,
"FieldsInfo": {
"Fields": [
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].FilingStatus[0].c1_01[0]",
"Value": "False",
"Left": 95.5989990234375,
"Top": 67.99798583984375,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].FilingStatus[0].c1_01[1]",
"Value": "False",
"Left": 138.7989959716797,
"Top": 67.99798583984375,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].FilingStatus[0].c1_01[2]",
"Value": "False",
"Left": 225.19900512695312,
"Top": 67.99798583984375,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].FilingStatus[0].c1_01[3]",
"Value": "False",
"Left": 340.39898681640625,
"Top": 67.99798583984375,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].FilingStatus[0].c1_01[4]",
"Value": "False",
"Left": 441.1990051269531,
"Top": 67.99798583984375,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].FilingStatus[0].f1_01[0]",
"Value": "",
"Left": 208.8000030517578,
"Top": 90,
"Width": 331.20001220703125,
"Height": 11.9990234375
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].f1_02[0]",
"Value": "",
"Left": 36,
"Top": 111.9990234375,
"Width": 200.60000610351562,
"Height": 14.0009765625
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].f1_03[0]",
"Value": "",
"Left": 238.60000610351562,
"Top": 111.9990234375,
"Width": 228.39999389648438,
"Height": 14.0009765625
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].YourSocial_ReadOrderControl[0].f1_04[0]",
"Value": "",
"Left": 468,
"Top": 111.9990234375,
"Width": 108,
"Height": 14.0009765625
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].YourSocial_ReadOrderControl[0].f1_05[0]",
"Value": "",
"Left": 36,
"Top": 136,
"Width": 200.60000610351562,
"Height": 14.0009765625
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].YourSocial_ReadOrderControl[0].f1_06[0]",
"Value": "",
"Left": 238.60000610351562,
"Top": 136,
"Width": 228.39999389648438,
"Height": 14.0009765625
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl[0].f1_07[0]",
"Value": "",
"Left": 468,
"Top": 136,
"Width": 108,
"Height": 14.0009765625
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl[0].Address[0].f1_08[0]",
"Value": "",
"Left": 36,
"Top": 160.0009765625,
"Width": 380.6000061035156,
"Height": 14.00103759765625
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl[0].Address[0].f1_09[0]",
"Value": "",
"Left": 418.6000061035156,
"Top": 160.0009765625,
"Width": 48.399993896484375,
"Height": 14.00103759765625
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl[0].Address[0].f1_10[0]",
"Value": "",
"Left": 36,
"Top": 183.9990234375,
"Width": 431,
"Height": 14.0009765625
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl[0].Address[0].f1_11[0]",
"Value": "",
"Left": 36,
"Top": 208,
"Width": 222.20001220703125,
"Height": 14.0009765625
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl[0].Address[0].f1_12[0]",
"Value": "",
"Left": 260.20001220703125,
"Top": 208,
"Width": 142,
"Height": 14.0009765625
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl[0].Address[0].f1_13[0]",
"Value": "",
"Left": 404.20001220703125,
"Top": 208,
"Width": 62.79998779296875,
"Height": 14.0009765625
},
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl[1].PresidentialElection[0].c1_02[0]",
"Value": "False",
"Left": 513.2000122070312,
"Top": 188,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl[1].PresidentialElection[0].c1_03[0]",
"Value": "False",
"Left": 542,
"Top": 188,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl[1].StandardDeduction[0].c1_04[0]",
"Value": "False",
"Left": 167.5989990234375,
"Top": 224,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl[1].StandardDeduction[0].c1_05[0]",
"Value": "False",
"Left": 261.1990051269531,
"Top": 224,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl[1].StandardDeduction[0].c1_06[0]",
"Value": "False",
"Left": 95.5989990234375,
"Top": 235.9990234375,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl[1].AgeBlindness[0].c1_07[0]",
"Value": "False",
"Left": 117.1989974975586,
"Top": 253.9990234375,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl[1].AgeBlindness[0].c1_08[0]",
"Value": "False",
"Left": 246.7989959716797,
"Top": 253.9990234375,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl[1].AgeBlindness[0].c1_09[0]",
"Value": "False",
"Left": 340.39898681640625,
"Top": 253.9990234375,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl[1].AgeBlindness[0].c1_10[0]",
"Value": "False",
"Left": 469.9989929199219,
"Top": 253.9990234375,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].IfMoreThanFour[0].c1_11[0]",
"Value": "False",
"Left": 568,
"Top": 210.99798583984375,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].Dependents[0].Table_Dependents[0].Row1[0].f1_14[0]",
"Value": "",
"Left": 36,
"Top": 287.99700927734375,
"Width": 207.8000030517578,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].Dependents[0].Table_Dependents[0].Row1[0].f1_15[0]",
"Value": "",
"Left": 244.8000030517578,
"Top": 287.99700927734375,
"Width": 86.40000915527344,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].Dependents[0].Table_Dependents[0].Row1[0].f1_16[0]",
"Value": "",
"Left": 332.20001220703125,
"Top": 287.99700927734375,
"Width": 84.39999389648438,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].Dependents[0].Table_Dependents[0].Row1[0].c1_12[0]",
"Value": "False",
"Left": 453.20001220703125,
"Top": 289.9960021972656,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].Dependents[0].Table_Dependents[0].Row1[0].c1_13[0]",
"Value": "False",
"Left": 532.4000244140625,
"Top": 289.9960021972656,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].Dependents[0].Table_Dependents[0].Row2[0].f1_17[0]",
"Value": "",
"Left": 36,
"Top": 299.9960021972656,
"Width": 207.8000030517578,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].Dependents[0].Table_Dependents[0].Row2[0].f1_18[0]",
"Value": "",
"Left": 244.8000030517578,
"Top": 299.9960021972656,
"Width": 86.40000915527344,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].Dependents[0].Table_Dependents[0].Row2[0].f1_19[0]",
"Value": "",
"Left": 332.20001220703125,
"Top": 299.9960021972656,
"Width": 84.39999389648438,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].Dependents[0].Table_Dependents[0].Row2[0].c1_14[0]",
"Value": "False",
"Left": 453.20001220703125,
"Top": 301.9949951171875,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].Dependents[0].Table_Dependents[0].Row2[0].c1_15[0]",
"Value": "False",
"Left": 532.4000244140625,
"Top": 301.9949951171875,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].Dependents[0].Table_Dependents[0].Row3[0].f1_20[0]",
"Value": "",
"Left": 36,
"Top": 311.9949951171875,
"Width": 207.8000030517578,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].Dependents[0].Table_Dependents[0].Row3[0].f1_21[0]",
"Value": "",
"Left": 244.8000030517578,
"Top": 311.9949951171875,
"Width": 86.40000915527344,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].Dependents[0].Table_Dependents[0].Row3[0].f1_22[0]",
"Value": "",
"Left": 332.20001220703125,
"Top": 311.9949951171875,
"Width": 84.39999389648438,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].Dependents[0].Table_Dependents[0].Row3[0].c1_16[0]",
"Value": "False",
"Left": 453.20001220703125,
"Top": 313.9939880371094,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].Dependents[0].Table_Dependents[0].Row3[0].c1_17[0]",
"Value": "False",
"Left": 532.4000244140625,
"Top": 313.9939880371094,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].Dependents[0].Table_Dependents[0].Row4[0].f1_23[0]",
"Value": "",
"Left": 36,
"Top": 323.9939880371094,
"Width": 207.8000030517578,
"Height": 11.9990234375
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].Dependents[0].Table_Dependents[0].Row4[0].f1_24[0]",
"Value": "",
"Left": 244.8000030517578,
"Top": 323.9939880371094,
"Width": 86.40000915527344,
"Height": 11.9990234375
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].Dependents[0].Table_Dependents[0].Row4[0].f1_25[0]",
"Value": "",
"Left": 332.20001220703125,
"Top": 323.9939880371094,
"Width": 84.39999389648438,
"Height": 11.9990234375
},
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].Dependents[0].Table_Dependents[0].Row4[0].c1_18[0]",
"Value": "False",
"Left": 453.20001220703125,
"Top": 325.9930114746094,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].Dependents[0].Table_Dependents[0].Row4[0].c1_19[0]",
"Value": "False",
"Left": 532.4000244140625,
"Top": 325.9930114746094,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl_Lns1-8b[0].f1_26[0]",
"Value": "",
"Left": 504,
"Top": 335.9989929199219,
"Width": 72,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl_Lns1-8b[0].f1_27[0]",
"Value": "",
"Left": 252,
"Top": 348.0010070800781,
"Width": 71.25,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl_Lns1-8b[0].f1_28[0]",
"Value": "",
"Left": 504,
"Top": 348.0010070800781,
"Width": 72,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl_Lns1-8b[0].f1_29[0]",
"Value": "",
"Left": 252,
"Top": 360,
"Width": 71.25,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl_Lns1-8b[0].f1_30[0]",
"Value": "",
"Left": 504,
"Top": 360,
"Width": 72,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl_Lns1-8b[0].f1_31[0]",
"Value": "",
"Left": 252,
"Top": 371.9989929199219,
"Width": 71.25,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl_Lns1-8b[0].f1_32[0]",
"Value": "",
"Left": 504,
"Top": 371.9989929199219,
"Width": 72,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl_Lns1-8b[0].f1_33[0]",
"Value": "",
"Left": 252,
"Top": 384.0010070800781,
"Width": 71.25,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl_Lns1-8b[0].f1_34[0]",
"Value": "",
"Left": 504,
"Top": 384.0010070800781,
"Width": 72,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl_Lns1-8b[0].f1_35[0]",
"Value": "",
"Left": 252,
"Top": 396,
"Width": 71.25,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl_Lns1-8b[0].f1_36[0]",
"Value": "",
"Left": 504,
"Top": 396,
"Width": 72,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl_Lns1-8b[0].c1_20[0]",
"Value": "False",
"Left": 465.2030029296875,
"Top": 410.74798583984375,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl_Lns1-8b[0].f1_37[0]",
"Value": "",
"Left": 504,
"Top": 407.9989929199219,
"Width": 72,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl_Lns1-8b[0].f1_38[0]",
"Value": "",
"Left": 504,
"Top": 420.0010070800781,
"Width": 72,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl_Lns1-8b[0].f1_39[0]",
"Value": "",
"Left": 504,
"Top": 432,
"Width": 72,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl_Lns1-8b[0].f1_40[0]",
"Value": "",
"Left": 504,
"Top": 443.9989929199219,
"Width": 72,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].ReadOrderControl_Lns1-8b[0].f1_41[0]",
"Value": "",
"Left": 504,
"Top": 456.0010070800781,
"Width": 72,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].f1_42[0]",
"Value": "",
"Left": 410.3999938964844,
"Top": 468,
"Width": 71.25,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].f1_43[0]",
"Value": "",
"Left": 410.3999938964844,
"Top": 479.9989929199219,
"Width": 71.25,
"Height": 11.998992919921875
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].f1_44[0]",
"Value": "",
"Left": 504,
"Top": 492,
"Width": 72,
"Height": 12
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].f1_45[0]",
"Value": "",
"Left": 504,
"Top": 504.0000305175781,
"Width": 72,
"Height": 11.998992919921875
},
{
"PageIndex": 2,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page2[0].Lines12a-12b_ReadOrder[0].c2_01[0]",
"Value": "False",
"Left": 246.8000030517578,
"Top": 38.9990234375,
"Width": 8,
"Height": 8
},
{
"PageIndex": 2,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page2[0].Lines12a-12b_ReadOrder[0].c2_02[0]",
"Value": "False",
"Left": 290,
"Top": 38.9990234375,
"Width": 8,
"Height": 8
},
{
"PageIndex": 2,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page2[0].Lines12a-12b_ReadOrder[0].c2_03[0]",
"Value": "False",
"Left": 333.1990051269531,
"Top": 38.9990234375,
"Width": 8,
"Height": 8
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].Lines12a-12b_ReadOrder[0].f2_01[0]",
"Value": "",
"Left": 345.6000061035156,
"Top": 36,
"Width": 36,
"Height": 11.9990234375
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].Lines12a-12b_ReadOrder[0].f2_02[0]",
"Value": "",
"Left": 410.3999938964844,
"Top": 36,
"Width": 71.25,
"Height": 11.9990234375
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].f2_03[0]",
"Value": "",
"Left": 504,
"Top": 48,
"Width": 72,
"Height": 12.0009765625
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].Lines13a-13b_ReadOrder[0].f2_04[0]",
"Value": "",
"Left": 410.3999938964844,
"Top": 60.0009765625,
"Width": 71.25,
"Height": 11.9990234375
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].f2_05[0]",
"Value": "",
"Left": 504,
"Top": 72.0009765625,
"Width": 72,
"Height": 12.00103759765625
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].f2_06[0]",
"Value": "",
"Left": 504,
"Top": 83.9990234375,
"Width": 72,
"Height": 11.99896240234375
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].f2_07[0]",
"Value": "",
"Left": 504,
"Top": 96.0009765625,
"Width": 72,
"Height": 11.9990234375
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].f2_08[0]",
"Value": "",
"Left": 504,
"Top": 108,
"Width": 72,
"Height": 11.9990234375
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].f2_09[0]",
"Value": "",
"Left": 504,
"Top": 119.9990234375,
"Width": 72,
"Height": 11.99896240234375
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].Line18_ReadOrder[0].f2_10[0]",
"Value": "",
"Left": 410.3999938964844,
"Top": 144,
"Width": 71.25,
"Height": 11.9990234375
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].Line18_ReadOrder[0].f2_11[0]",
"Value": "",
"Left": 410.3999938964844,
"Top": 155.9990234375,
"Width": 71.25,
"Height": 11.99896240234375
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].Line18_ReadOrder[0].f2_12[0]",
"Value": "",
"Left": 410.3999938964844,
"Top": 168.0009765625,
"Width": 71.25,
"Height": 11.9990234375
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].Line18_ReadOrder[0].f2_13[0]",
"Value": "",
"Left": 410.3999938964844,
"Top": 180,
"Width": 71.25,
"Height": 11.9990234375
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].f2_14[0]",
"Value": "",
"Left": 504,
"Top": 192.0009765625,
"Width": 72,
"Height": 12
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].f2_15[0]",
"Value": "",
"Left": 504,
"Top": 204.0009765625,
"Width": 72,
"Height": 11.9990234375
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].f2_16[0]",
"Value": "",
"Left": 504,
"Top": 216,
"Width": 72,
"Height": 11.9990234375
},
{
"PageIndex": 2,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page2[0].c2_04[0]",
"Value": "False",
"Left": 465.20001220703125,
"Top": 230.49798583984375,
"Width": 8,
"Height": 8
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].f2_17[0]",
"Value": "",
"Left": 504,
"Top": 227.9990234375,
"Width": 72,
"Height": 11.99896240234375
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].RoutingNo[0].f2_18[0]",
"Value": "",
"Left": 172.8000030517578,
"Top": 240.0009765625,
"Width": 129.45298767089844,
"Height": 11.9990234375
},
{
"PageIndex": 2,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page2[0].c2_05[0]",
"Value": "False",
"Left": 377.3999938964844,
"Top": 243,
"Width": 8,
"Height": 8
},
{
"PageIndex": 2,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page2[0].c2_05[1]",
"Value": "False",
"Left": 435,
"Top": 243,
"Width": 8,
"Height": 8
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].AccountNo[0].f2_19[0]",
"Value": "",
"Left": 172.822998046875,
"Top": 252.4990234375,
"Width": 244.08001708984375,
"Height": 11.0009765625
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].f2_20[0]",
"Value": "",
"Left": 410.3999938964844,
"Top": 263.9990234375,
"Width": 71.25,
"Height": 11.99896240234375
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].f2_21[0]",
"Value": "",
"Left": 504,
"Top": 276.0009765625,
"Width": 72,
"Height": 11.9990234375
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].f2_22[0]",
"Value": "",
"Left": 410.3999938964844,
"Top": 288,
"Width": 71.25,
"Height": 11.998992919921875
},
{
"PageIndex": 2,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page2[0].ThirdPartyDesignee[0].c2_06[0]",
"Value": "False",
"Left": 491.6000061035156,
"Top": 302.99798583984375,
"Width": 8,
"Height": 8
},
{
"PageIndex": 2,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page2[0].ThirdPartyDesignee[0].c2_06[1]",
"Value": "False",
"Left": 491.6000061035156,
"Top": 313.75,
"Width": 8,
"Height": 8
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].ThirdPartyDesignee[0].f2_23[0]",
"Value": "",
"Left": 144,
"Top": 324,
"Width": 144,
"Height": 18
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].ThirdPartyDesignee[0].f2_24[0]",
"Value": "",
"Left": 324,
"Top": 324,
"Width": 93.60000610351562,
"Height": 18
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].ThirdPartyDesignee[0].f2_25[0]",
"Value": "",
"Left": 504,
"Top": 330.0010070800781,
"Width": 72,
"Height": 11.998992919921875
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].Signatures[0].f2_26[0]",
"Value": "",
"Left": 325,
"Top": 376.0010070800781,
"Width": 134.79998779296875,
"Height": 19.998992919921875
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].Signatures[0].f2_27[0]",
"Value": "",
"Left": 504,
"Top": 384.0010070800781,
"Width": 72,
"Height": 11.998992919921875
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].Signatures[0].f2_28[0]",
"Value": "",
"Left": 325,
"Top": 406,
"Width": 134.79998779296875,
"Height": 19.998992919921875
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].Signatures[0].f2_29[0]",
"Value": "",
"Left": 504,
"Top": 414,
"Width": 72,
"Height": 11.998992919921875
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].Signatures[0].f2_30[0]",
"Value": "",
"Left": 136.8000030517578,
"Top": 425.9989929199219,
"Width": 135.8000030517578,
"Height": 11.998992919921875
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].Signatures[0].f2_31[0]",
"Value": "",
"Left": 324,
"Top": 425.9989929199219,
"Width": 252,
"Height": 11.998992919921875
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].PaidPreparer[0].Preparer[0].f2_32[0]",
"Value": "",
"Left": 93.5999984741211,
"Top": 448.0010070800781,
"Width": 121.4000015258789,
"Height": 14.001007080078125
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].PaidPreparer[0].Preparer[0].f2_33[0]",
"Value": "",
"Left": 447.3999938964844,
"Top": 448.0010070800781,
"Width": 55.600006103515625,
"Height": 14.001007080078125
},
{
"PageIndex": 2,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page2[0].PaidPreparer[0].Preparer[0].CheckIf[0].c2_07[0]",
"Value": "False",
"Left": 511.20001220703125,
"Top": 450.9700012207031,
"Width": 8,
"Height": 8
},
{
"PageIndex": 2,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page2[0].PaidPreparer[0].Preparer[0].CheckIf[0].c2_07[1]",
"Value": "False",
"Left": 511.20001220703125,
"Top": 462.99798583984375,
"Width": 8,
"Height": 8
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].PaidPreparer[0].Preparer[0].f2_34[0]",
"Value": "",
"Left": 158.39999389648438,
"Top": 461.9989929199219,
"Width": 229.39999389648438,
"Height": 11.94000244140625
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].PaidPreparer[0].Preparer[0].f2_35[0]",
"Value": "",
"Left": 432,
"Top": 461.9989929199219,
"Width": 72,
"Height": 11.94000244140625
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].PaidPreparer[0].Preparer[0].f2_36[0]",
"Value": "",
"Left": 158.39999389648438,
"Top": 474.0010070800781,
"Width": 301.3999938964844,
"Height": 11.998992919921875
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].PaidPreparer[0].Preparer[0].f2_37[0]",
"Value": "",
"Left": 509.7449951171875,
"Top": 474.0010070800781,
"Width": 66.2550048828125,
"Height": 11.998992919921875
}
]
}
},
"error": false,
"status": 200,
"remainingCredits": 59987
}
Status Code: 200
PDF Info Reader
Get detailed information about PDF document, its properties and security permissions.
1. /pdf/info
Extracts basic information about input PDF file, PDF file security permissions, and other information. If you want to extract information about fillable fields (checkboxes, radiboxes, listboxes) from PDF then please use /pdf/info/fields
instead.
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/info
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | your api key for PDF.co API access. Get yours at https://app.pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-info/sample.pdf"
}
More example Requests/Responses:
I. Example Request: POST /pdf/info
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
Key | Value | Description |
---|---|---|
url | https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-info/sample.pdf | required. URL of the source PDF file. Must be a String. To use your file please upload it first to the temporary storage, see Upload and Manage Files section below to learn how to do it. |
password | optional. Password of PDF file. Must be a String. |
I. Example Response: POST /pdf/info
{
"info": {
"PageCount": 1,
"Author": "Alice V. Knox",
"Title": "Kid's News 1",
"Producer": "Acrobat Distiller 4.0 for Windows",
"Subject": "Kid's News 1",
"CreationDate": "8/15/2001 2:50:36 PM",
"Bookmarks": "",
"Keywords": "",
"Creator": "Adobe PageMaker 6.52",
"Encrypted": false,
"PageRectangle": {
"Location": {
"IsEmpty": true,
"X": 0,
"Y": 0
},
"Size": "612, 792",
"X": 0,
"Y": 0,
"Width": 612,
"Height": 792,
"Left": 0,
"Top": 0,
"Right": 612,
"Bottom": 792,
"IsEmpty": false
},
"ModificationDate": "9/20/2001 6:23:02 PM",
"EncryptionAlgorithm": 0,
"PermissionPrinting": true,
"PermissionModifyDocument": true,
"PermissionContentExtraction": true,
"PermissionModifyAnnotations": true,
"PermissionFillForms": true,
"PermissionAccessibility": true,
"PermissionAssemble": true,
"PermissionHighQualityPrint": true
},
"error": false,
"status": 200,
"remainingCredits": 77732
}
Status Code: 200
PDF Merge
Merge PDF from two or more PDF files into a new one.
1. /pdf/merge
url
required. Comma separated urls to the source PDF files in the same order that you want them to be merged. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section. Need to merge non-PDF files too? Use/pdf/merge2
endpoint instead.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.async
optional. Runs processing asynchronously. Returns Use JobId that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.name
optional. name of the output file.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/merge
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-merge/sample1.pdf,https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-merge/sample2.pdf"
}
More example Requests/Responses:
I. Example Request: /pdf/merge
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
Key | Value | Description |
---|---|---|
url | https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-merge/sample1.pdf,https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-merge/sample2.pdf | optional. URL of the source PDF file. Must be a String. |
name | result.pdf | optional. File name for generated output. Must be a String. |
I. Example Response: /pdf/merge
{
"url": "https://pdf-temp-files.s3.amazonaws.com/3ec287356c0b4e02b5231354f94086f2/result.pdf",
"error": false,
"status": 200,
"name": "result.pdf",
"remainingCredits": 98465
}
Status Code: 200
2. /pdf/merge2 (supports documents, spreadsheets, images as sources)
This endpoint is similar to /pdf/merge
but it also accepts documents, spreadsheets and images as source files. Please notice that it is recommended to use this endpoint in "async": true
mode. It also consumes more credits because of the internal format conversions involved (see the credits pricing page for more details).
url
required. Comma separated urls to the source files (PDF, documents, spreadsheets, images) in the same order that you want them to be merged. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.async
optional. Runs processing asynchronously. Returns Use JobId that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.name
optional. name of the output file.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/merge2
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-merge/sample1.pdf,https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/other/Input.xls, https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/doc-to-pdf/sample.docx, https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/image-to-pdf/image1.png,https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/image-to-pdf/image2.jpg"
}
More example Requests/Responses:
I. Example Request: /pdf/merge
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
Key | Value | Description |
---|---|---|
url | https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-merge/sample1.pdf,https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-merge/sample2.pdf | optional. URL of the source PDF file. Must be a String. |
name | result.pdf | optional. File name for generated output. Must be a String. |
I. Example Response: /pdf/merge
{
"url": "https://pdf-temp-files.s3.amazonaws.com/3ec287356c0b4e02b5231354f94086f2/result.pdf",
"error": false,
"status": 200,
"name": "result.pdf",
"remainingCredits": 98465
}
Status Code: 200
PDF Optimize
Optimize PDF document to reduce its size.
1. /pdf/optimize
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.name
optional. File name for generated output. Must be a String.password
optional. Password of PDF file. Must be a String.async
optional. Runs processing asynchronously. Returns UseJobId
that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.encrypt
optional.Enable encryption for output file. Must be one of:true
,false
.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: POST params, JSON or FORMDATA
URL: https://api.pdf.co/v1/pdf/optimize
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
Key | Value | Description |
---|---|---|
url | https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-optimize/sample.pdf | required. URL of the source file. Must be a String. To use your file please upload it first to the temporary storage, see Upload and Manage Files section below to learn how to do it. |
name | result.pdf | optional. File name for generated output. Must be a String. |
password | optional. Password of PDF file. Must be a String. |
More example Requests/Responses:
I. Example Request: /pdf/optimize
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-optimize/sample.pdf",
"name": "result.pdf",
"password": ""
}
I. Example Response: /pdf/optimize
{
"url": "https://pdf-temp-files.s3.amazonaws.com/c3bde960dcc54bcebc14a72ab1521fa9/result-compressed.pdf",
"fileSize": 798621,
"pageCount": 5,
"error": false,
"status": 200,
"name": "result-compressed.pdf",
"remainingCredits": 59877
}
Status Code: 200
PDF Password And Security
Merge PDF from two or more PDF files into a new one.
1. /pdf/security/add
url
required. URL to the source file. Must be a String. You can pass link to file from Google Drive, Dropbox or another online file service that can generate shareable links. You can also use built-in PDF.co cloud storage located at https://app.pdf.co/files or upload your file as temporary file right before making this API call (seeUpload and Manage Files
section for more details on uploading files via API).ownerPassword
- The owner password will be required for document modification.userPassword
- The user password only allows to view and print the document.encryptionAlgorithm
- Encryption algorithm. Valid values:RC4_40bit
,RC4_128bit
,AES_128bit
,AES_256bit
.allowAccessibilitySupport
- Allow or prohibit content extraction for accessibility needs.true/false
allowAssemblyDocument
- Allow or prohibit assembling the document.true/false
allowPrintDocument
- Allow or prohibit printing PDF document.true/false
allowFillForms
- Allow or prohibit filling of interactive form fields (including signature fields) in PDF document.true/false
allowModifyDocument
- Allow or prohibit modification of PDF document.true/false
allowContentExtraction
- Allow or prohibit copying content from PDF document.true/false
allowModifyAnnotations
- Allow or prohibit interacting with text annotations and forms in PDF document.true/false
printQuality
- Allowed printing quality. Valid values:HighResolution
,LowResolution
.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.async
optional. Runs processing asynchronously. Returns Use JobId that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.name
optional. name of the output file.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/security/add
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-merge/sample1.pdf",
"ownerPassword": "12345",
"userPassword": "54321",
"EncryptionAlgorithm": "AES_128bit",
"AllowAccessibilitySupport": true,
"AllowAssemblyDocument": false,
"AllowPrintDocument": false,
"AllowFillForms": false,
"AllowModifyDocument": false,
"AllowContentExtraction": false,
"AllowModifyAnnotations": false,
"PrintQuality": "LowResolution",
"encrypt": false,
"async": false
}
2. /pdf/security/remove
url
required. URL to the source file. Must be a String. You can pass link to file from Google Drive, Dropbox or another online file service that can generate shareable links. You can also use built-in PDF.co cloud storage located at https://app.pdf.co/files or upload your file as temporary file right before making this API call (seeUpload and Manage Files
section for more details on uploading files via API).password
- The owner/user password to open file and to remove security features.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.async
optional. Runs processing asynchronously. Returns Use JobId that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.name
optional. name of the output file.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/security/remove
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-security/ProtectedPDFFile.pdf",
"password": "admin@123",
"name": "unprotected"
}
PDF Search Text
Search text in PDF and get coordinates. Supports regular expressions.
1. /pdf/find
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.searchString
text to search. Can contain regular expressions if you setregexSearch
param totrue
.pages
optional. Comma-separated list of page indices (or ranges) to process. IMPORTANT: the very first page starts at0
(zero). To set a range use the dash-
, for example:0,2-5,7-
. To set a range from index to the last page use range like this:2-
(from page #3 as the index starts at zero and till the of the document). For ALL pages just leave this param empty. Example:0,2-5,7-
means first page, then 3rd page to 6th page, and then the range from 8th (index =7
) page till the end of the document. Must be a String.inline
optional. Must be one of:true
,false
.wordMatchingMode
optional. Must be a String.password
optional. Password of PDF file. Must be a StringregexSearch
optional. Must be one of:true
,false
.async
optional. Runs processing asynchronously. Returns UseJobId
that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.name
optional. File name for generated output. Must be a String.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/find
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Body:
{
"async": "false",
"encrypt": "false",
"url": "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-to-text/sample.pdf",
"searchString": "Invoice Date \\d+/\\d+/\\d+",
"regexSearch": "true",
"name": "output",
"pages": "0-",
"inline": "true",
"wordMatchingMode": "",
"password": ""
}
More example Requests/Responses:
I. Example Request: /pdf/find
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Body:
{
"async": "false",
"encrypt": "false",
"url": "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-to-text/sample.pdf",
"searchString": "Invoice Date \\d+/\\d+/\\d+",
"regexSearch": "true",
"name": "output",
"pages": "0-",
"inline": "true",
"wordMatchingMode": "",
"password": ""
}
I. Example Response: /pdf/find
{
"body": [
{
"text": "Invoice Date 01/01/2016",
"left": 436.5400085449219,
"top": 130.4599995137751,
"width": 122.85311957550027,
"height": 11.040000486224898,
"pageIndex": 0,
"bounds": {
"location": {
"isEmpty": false,
"x": 436.54,
"y": 130.46
},
"size": "122.853119, 11.0400009",
"x": 436.54,
"y": 130.46,
"width": 122.853119,
"height": 11.0400009,
"left": 436.54,
"top": 130.46,
"right": 559.3931,
"bottom": 141.5,
"isEmpty": false
},
"elementCount": 1,
"elements": [
{
"index": 0,
"left": 436.5400085449219,
"top": 130.4599995137751,
"width": 122.85311957550027,
"height": 11.040000486224898,
"angle": 0,
"text": "Invoice Date 01/01/2016",
"isNewLine": true,
"fontIsBold": true,
"fontIsItalic": false,
"fontName": "Helvetica-Bold",
"fontSize": 11,
"fontColor": "0, 0, 0",
"fontColorAsOleColor": 0,
"fontColorAsHtmlColor": "#000000",
"bounds": {
"location": {
"isEmpty": false,
"x": 436.54,
"y": 130.46
},
"size": "122.853119, 11.0400009",
"x": 436.54,
"y": 130.46,
"width": 122.853119,
"height": 11.0400009,
"left": 436.54,
"top": 130.46,
"right": 559.3931,
"bottom": 141.5,
"isEmpty": false
}
}
]
}
],
"pageCount": 1,
"error": false,
"status": 200,
"name": "output",
"remainingCredits": 59970
}
Status Code: 200
PDF Search and Delete Text from PDF
Search text in PDF and remove found text from PDF.
1. /pdf/edit/delete-text (multiple replacements)
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.searchStrings[]
array of strings to search.caseSensitive
optional. Set tofalse
to use case-insensitive search.name
optional. File name for generated output. Must be a String.password
optional. Password of PDF file. Must be a String.pages
optional. Comma-separated list of page indices (or ranges) to process. IMPORTANT: the very first page starts at0
(zero). To set a range use the dash-
, for example:0,2-5,7-
. To set a range from index to the last page use range like this:2-
(from page #3 as the index starts at zero and till the of the document). For ALL pages just leave this param empty. Example:0,2-5,7-
means first page, then 3rd page to 6th page, and then the range from 8th (index =7
) page till the end of the document. Must be a String.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.async
optional. Runs processing asynchronously. Returns UseJobId
that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/edit/delete-text
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-to-text/sample.pdf",
"name": "pdfWithTextDeleted",
"caseSensitive": "false",
"searchStrings": [
"Notes",
"City, State Zip"
]
}
More example Requests/Responses:
I. Example Request: /pdf/edit/delete-text (multiple replacements)
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-split/sample.pdf",
"name": "pdfWithTextDeleted",
"caseSensitive": "false",
"searchStrings": [
"conspicuous feature"
]
}
I. Example Response: /pdf/edit/delete-text (multiple replacements)
{
"url": "https://pdf-temp-files.s3.amazonaws.com/c4367f7cf8794f12b4e8899d8101fced/pdfWithTextDeleted.pdf",
"pageCount": 4,
"error": false,
"status": 200,
"name": "pdfWithTextDeleted",
"remainingCredits": 59914
}
Status Code: 200
2. /pdf/edit/delete-text (single replacement)
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.searchString
string to search.caseSensitive
optional. Set tofalse
to use case-insensitive search.name
optional. File name for generated output. Must be a String.password
optional. Password of PDF file. Must be a String.pages
optional. Comma-separated list of page indices (or ranges) to process. IMPORTANT: the very first page starts at0
(zero). To set a range use the dash-
, for example:0,2-5,7-
. To set a range from index to the last page use range like this:2-
(from page #3 as the index starts at zero and till the of the document). For ALL pages just leave this param empty. Example:0,2-5,7-
means first page, then 3rd page to 6th page, and then the range from 8th (index =7
) page till the end of the document. Must be a String.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.async
optional. Runs processing asynchronously. Returns UseJobId
that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/edit/delete-text
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-to-text/sample.pdf",
"name": "pdfWithTextDeleted",
"caseSensitive": "false",
"searchString": "Notes"
}
More example Requests/Responses:
I. Example Request: /pdf/edit/delete-text (single replacement)
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-split/sample.pdf",
"name": "pdfWithTextDeleted",
"caseSensitive": "false",
"searchString": "conspicuous feature"
}
I. Example Response: /pdf/edit/delete-text (single replacement)
{
"url": "https://pdf-temp-files.s3.amazonaws.com/9c674faed1d9444a8912bfb4695c2754/pdfWithTextDeleted.pdf",
"pageCount": 4,
"error": false,
"status": 200,
"name": "pdfWithTextDeleted",
"remainingCredits": 59902
}
Status Code: 200
PDF Search and Replace Text
Description: Search and replace text of your choice in a pdf file
Status Errors
Code | Description |
---|---|
200 | The request has succeeded |
400 | bad input parameters |
401 | unauthorized |
403 | not enough credits |
405 | Timeout error. To process large documents or files please use asynchronous mode ( set async parameter to true) and then check the status using /job/check endpoint. If file contains many pages then specify a page range using pages parameter. The number of pages of the document can be obtained using the endpoint /pdf/info |
Example 1: single text replacement
GET
https://api.pdf.co/v1/pdf/edit/replace-text?url=https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-split/sample.pdf&searchString=conspicuous&replaceString=replaced&x-api-key=YOUR-API-KEY
or
POST
{
"url": "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-split/sample.pdf",
"searchString": "conspicuous feature",
"replaceString": "Replaced1",
"caseSensitive": true,
"name": "finalFile"
}
or
cURL (uploading your file along with the request)
curl -F "x-api-key=PASTE_YOUR_API_KEY_HERE" -F "searchString=conspicuous feature" -F "replaceString=Replaced1" -F "file=@./sample.pdf" https://api.pdf.co/v1/pdf/edit/replace-text
Example 2: batch texts replacement
Sample Request:
! Don’t forget to set x-api-key
url param or http header param (preferred) to API key, get yours here
POST
{
"url": "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-split/sample.pdf",
"searchStrings": [
"conspicuous feature",
"Martian"
],
"replaceStrings": [
"Replaced1",
"Replaced2"
],
"caseSensitive": true,
"name": "finalFile"
}
1. /pdf/edit/replace-text (mutliple replacements)
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.searchStrings[]
array of strings to search.replaceStrings[]
arrao of replacements strings.caseSensitive
optional. Set tofalse
to use case-insensitive search.name
optional. File name for generated output. Must be a String.password
optional. Password of PDF file. Must be a String.pages
optional. Comma-separated list of page indices (or ranges) to process. IMPORTANT: the very first page starts at0
(zero). To set a range use the dash-
, for example:0,2-5,7-
. To set a range from index to the last page use range like this:2-
(from page #3 as the index starts at zero and till the of the document). For ALL pages just leave this param empty. Example:0,2-5,7-
means first page, then 3rd page to 6th page, and then the range from 8th (index =7
) page till the end of the document. Must be a String.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.async
optional. Runs processing asynchronously. Returns UseJobId
that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/edit/replace-text
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-to-text/sample.pdf",
"searchStrings": [
"Your Company Name",
"Client Name"
],
"replaceStrings": [
"XYZ LLC",
"ABCD"
],
"caseSensitive": true,
"pages": "",
"password":"",
"name": "finalFile"
}
More example Requests/Responses:
I. Example Request: /pdf/edit/replace-text
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-split/sample.pdf",
"searchStrings": [
"conspicuous feature",
"Martian"
],
"replaceStrings": [
"Replaced1",
"Replaced2"
],
"caseSensitive": true,
"name": "finalFile"
}
I. Example Response: /pdf/edit/replace-text
{
"url": "https://pdf-temp-files.s3.amazonaws.com/5e02856782ea4f90b0c47c052565ae01/finalFile.pdf",
"pageCount": 4,
"error": false,
"status": 200,
"name": "finalFile",
"remainingCredits": 98298
}
Status Code: 200
2. /pdf/edit/replace-text (single replacement)
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.searchString
required for single text replacement. Word or phrase to be replaced. Must be a String.replaceString
required for single text replacement. Word to be replaced with. Must be a String.caseSensitive
optional. Set tofalse
to use case-insensitive search.name
optional. File name for generated output. Must be a String.password
optional. Password of PDF file. Must be a String.pages
optional. Comma-separated list of page indices (or ranges) to process. IMPORTANT: the very first page starts at0
(zero). To set a range use the dash-
, for example:0,2-5,7-
. To set a range from index to the last page use range like this:2-
(from page #3 as the index starts at zero and till the of the document). For ALL pages just leave this param empty. Example:0,2-5,7-
means first page, then 3rd page to 6th page, and then the range from 8th (index =7
) page till the end of the document. Must be a String.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.async
optional. Runs processing asynchronously. Returns UseJobId
that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: POST params, JSON or FORMDATA
URL: https://api.pdf.co/v1/pdf/edit/replace-text
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
Key | Value | Description |
---|---|---|
url | https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-to-text/sample.pdf | required. URL of the source file. Must be a String. To use your file please upload it first to the temporary storage, see Upload and Manage Files section below to learn how to do it. |
name | finalFile | optional. File name for generated output. Must be a String. |
caseSensitive | true | optional. true or false . Set to false by default |
searchString | Your Company Name | required for single text replacement. Word to be replaced. Must be a String |
replaceString | XYZ LLC | required for single text replacement. Word to be replaced with. Must be a String |
More example Requests/Responses:
I. Example Request: /pdf/edit/replace-text
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
Key | Value | Description |
---|---|---|
url | https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-split/sample.pdf | optional. URL of the source PDF file. Must be a String. |
name | finalFile | optional. File name for generated output. Must be a String. |
caseSensitive | true | optional. true or false . Set to false by default |
searchString | onspicuous feature | required for single text replacement. Word to be replaced. Must be a String |
replaceString | Replaced1 | required for single text replacement. Word to be replaced with. Must be a String |
I. Example Response: /pdf/edit/replace-text
{
"url": "https://pdf-temp-files.s3.amazonaws.com/1a0e9a51e2d04fe4bcce0a6a31c365a8/finalFile.pdf",
"pageCount": 4,
"error": false,
"status": 200,
"name": "finalFile",
"remainingCredits": 98310
}
Status Code: 200
PDF Search and Replace Text with Image
Search and replace text in PDF.
1. /pdf/edit/replace-text-with-image
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.searchString
required for single text replacement. Word or phrase to be replaced. Must be a String.replaceImage
required. Image url to be inserted in doc:http://www.xyz.com/image.png
.caseSensitive
optional. Set tofalse
to use case-insensitive search.name
optional. File name for generated output. Must be a String.password
optional. Password of PDF file. Must be a String.pages
optional. Comma-separated list of page indices (or ranges) to process. IMPORTANT: the very first page starts at0
(zero). To set a range use the dash-
, for example:0,2-5,7-
. To set a range from index to the last page use range like this:2-
(from page #3 as the index starts at zero and till the of the document). For ALL pages just leave this param empty. Example:0,2-5,7-
means first page, then 3rd page to 6th page, and then the range from 8th (index =7
) page till the end of the document. Must be a String.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.async
optional. Runs processing asynchronously. Returns UseJobId
that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: POST params, JSON or FORMDATA
URL: https://api.pdf.co/v1/pdf/edit/replace-text-with-image
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
Key | Value | Description |
---|---|---|
url | https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-to-text/sample.pdf | required. URL of the source file. Must be a String. To use your file please upload it first to the temporary storage, see Upload and Manage Files section below to learn how to do it. |
caseSensitive | true | optional. true or false . Set to false by default |
searchString | Your Company Name | required. Word to be replaced. Must contain at least 1 word. Example: 'Hello' |
replaceImage | https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png | required. Image url to be inserted in doc: http://www.xyz.com/image.png |
pages | 0 | optional. Comma-separated list of page indices (or ranges) to process. IMPORTANT: the very first page starts at 0 (zero). To set a range use the dash - , for example: 0,2-5,7- . To set a range from index to the last page use range like this: 2- (from page #3 as the index starts at zero and till the of the document). For ALL pages just leave this param empty. Example: 0,2-5,7- means first page, then 3rd page to 6th page, and then the range from 8th (index = 7 ) page till the end of the document. Must be a String. |
More example Requests/Responses:
I. Example Request: /pdf/edit/replace-text-with-image
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Body:
{
"url": "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-split/sample.pdf",
"caseSensitive": true,
"searchString": "Hypothesis",
"replaceImage": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/image-to-pdf/image1.png",
"pages": "0"
}
I. Example Response: /pdf/edit/replace-text-with-image
{
"url": "https://pdf-temp-files.s3.amazonaws.com/0e8f486dbf8a4764a1468b3d7c222e4c/sample.pdf",
"pageCount": 4,
"error": false,
"status": 200,
"name": "sample.pdf",
"remainingCredits": 59926
}
Status Code: 200
PDF Split
Split PDF into multiple PDF files.
1. /pdf/split
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.pages
Define comma-separated indices of pages (or ranges) that you want to split from the document. The first page indice is always1
. For example, if you have a 7 page document that you want split into 3 separate PDFs but different number of pages it would go like this:1, 2, 3-
or1, 2, 3-7
which will result in 1 PDF with page one, 1 PDF with page two and one PDF with the rest of the pages. You can also use inverted page numbers adding ‘!’ before the number. E.g. “!1” means “the last page”, “2-!2” means “from the second to the penultimate page”, “!2-“ - last two pages”. Also, you can use a single asterisk (“*”) character as the range to split the document into separate pages. SPECIAL CASES: You can use a single asterisk*
symbol to split the document into separate pages. Parameter must be a String.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.async
optional. Runs processing asynchronously. Returns Use JobId that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.name
optional. name of the output file.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/split
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-split/sample.pdf",
"pages": "1-2,3-",
"name": "result.pdf"
}
More example Requests/Responses:
I. Example Request: /pdf/split
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
Key | Value | Description |
---|---|---|
url | https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-split/sample.pdf | optional. URL of the source PDF file. Must be a String. |
name | result.pdf | optional. File name for generated output. Must be a String. |
pages | 1-2,3- | Define comma-separated indices of pages (or ranges) that you want to split from the document. The first page indice is always 1 . For example, if you have a 7 page document that you want split into 3 separate PDFs but different number of pages it would go like this: 1, 2, 3- or 1, 2, 3-7 which will result in 1 PDF with page one, 1 PDF with page two and one PDF with the rest of the pages. Must be a String. |
I. Example Response: /pdf/split
{
"urls": [
"https://pdf-temp-files.s3.amazonaws.com/1e9a7f2c46834160903276716424382b/result_page1-2.pdf",
"https://pdf-temp-files.s3.amazonaws.com/c976b9f89a2e460786a3d5c0deeeef67/result_page3-4.pdf"
],
"pageCount": 4,
"error": false,
"status": 200,
"name": "result.pdf",
"remainingCredits": 98441
}
Status Code: 200
PDF To CSV
Convert PDF and scanned images into CSV representation with layout, columns, rows, tables.
1. /pdf/convert/to/csv
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.pages
optional. Comma-separated list of page indices (or ranges) to process. IMPORTANT: the very first page starts at0
(zero). To set a range use the dash-
, for example:0,2-5,7-
. To set a range from index to the last page use range like this:2-
(from page #3 as the index starts at zero and till the of the document). For ALL pages just leave this param empty. Example:0,2-5,7-
means first page, then 3rd page to 6th page, and then the range from 8th (index =7
) page till the end of the document. Must be a String.unwrap
optional. Unwrap lines into a single line within table cells whenlineGrouping
is enabled. Must be one of:true
,false
.rect
optional. Defines coordinates for extraction, e.g.51.8, 114.8, 235.5, 204.0
. You can use PDF.co PDF Viewer with coordinates to easily select and copy coordinates. Must be a String.lang
optional. Sets OCR language to be used for scanned PDF, PNG, JPG douments when extracting text from them. Default iseng
. Supported values:eng
,spa
,deu
,fra
,jpn
,chi_sim
,chi_tra
,kor
. You can also specify two languages to be used on the same page, for example:eng+deu
,jpn+kor
or other combinations. For more languages please contact our customer support.inline
optional. Must be one of:true
to return data as inline orfalse
to return link to output file (default).lineGrouping
optional. optional. Line grouping within table cells. Set to1
to enable the grouping. Must be a String.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.async
optional. Runs processing asynchronously. Returns UseJobId
that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.name
optional. File name for generated output. Must be a String.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples. For example, to change CSV separator:{ 'profiles': [ { 'profile1': { 'CSVSeparatorSymbol': ';' } } ] }
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/convert/to/csv
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-to-csv/sample.pdf",
"lang": "eng",
"inline": "true",
"unwrap": "",
"pages": "0-",
"rect": "",
"async": "false",
"encrypt": "false",
"name": "result.csv",
"password": "",
"lineGrouping": "",
"profiles": ""
}
PDF To JSON
Convert PDF and scanned images into JSON representation with text, fonts, images, vectors, formatting preserved.
1. /pdf/convert/to/json
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.pages
optional. Comma-separated list of page indices (or ranges) to process. IMPORTANT: the very first page starts at0
(zero). To set a range use the dash-
, for example:0,2-5,7-
. To set a range from index to the last page use range like this:2-
(from page #3 as the index starts at zero and till the of the document). For ALL pages just leave this param empty. Example:0,2-5,7-
means first page, then 3rd page to 6th page, and then the range from 8th (index =7
) page till the end of the document. Must be a String.unwrap
optional. Unwrap lines into a single line within table cells whenlineGrouping
is enabled. Must be one of:true
,false
.rect
optional. Defines coordinates for extraction, e.g.51.8, 114.8, 235.5, 204.0
. You can use PDF.co PDF Viewer with coordinates to easily select and copy coordinates. Must be a String.lang
optional. Sets OCR language to be used for scanned PDF, PNG, JPG douments when extracting text from them. Default iseng
. Supported values:eng
,spa
,deu
,fra
,jpn
,chi_sim
,chi_tra
,kor
. You can also specify two languages to be used on the same page, for example:eng+deu
,jpn+kor
or other combinations. For more languages please contact our customer support.inline
optional. Must be one of:true
to return data as inline orfalse
to return link to output file (default).lineGrouping
optional. optional. Line grouping within table cells. Set to1
to enable the grouping. Must be a String.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.async
optional. Runs processing asynchronously. Returns UseJobId
that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.name
optional. File name for generated output. Must be a String.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples. For example, to change CSV separator:{ 'profiles': [ { 'profile1': { 'CSVSeparatorSymbol': ';' } } ] }
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/convert/to/json2
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-to-json/sample.pdf",
"inline": true
}
More example Requests/Responses:
I. Example Request: /pdf/convert/to/json
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-to-json/sample.pdf",
"inline": true
}
I. Example Response: /pdf/convert/to/json
{
"body": {
"document": {
"page": {
"@index": "0",
"row": [
{
"column": [
{
"text": {
"@fontName": "Arial",
"@fontSize": "24.0",
"@fontStyle": "Bold",
"@color": "#538DD3",
"@x": "36.00",
"@y": "34.44",
"@width": "242.81",
"@height": "24.00",
"#text": "Your Company Name"
}
},
{
"text": ""
},
{
"text": ""
},
{
"text": ""
}
]
},
{
"column": [
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@x": "36.00",
"@y": "76.94",
"@width": "66.62",
"@height": "11.04",
"#text": "Your Address"
}
},
{
"text": ""
},
{
"text": ""
},
{
"text": ""
}
]
},
{
"column": [
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@x": "36.00",
"@y": "91.46",
"@width": "69.14",
"@height": "11.04",
"#text": "City, State Zip"
}
},
{
"text": ""
},
{
"text": ""
},
{
"text": ""
}
]
},
{
"column": [
{
"text": ""
},
{
"text": ""
},
{
"text": ""
},
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@fontStyle": "Bold",
"@x": "461.02",
"@y": "115.94",
"@width": "98.42",
"@height": "11.04",
"#text": "Invoice No. 123456"
}
}
]
},
{
"column": [
{
"text": ""
},
{
"text": ""
},
{
"text": ""
},
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@fontStyle": "Bold",
"@x": "436.54",
"@y": "130.46",
"@width": "122.90",
"@height": "11.04",
"#text": "Invoice Date 01/01/2016"
}
}
]
},
{
"column": [
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@fontStyle": "Bold",
"@x": "36.00",
"@y": "154.94",
"@width": "63.62",
"@height": "11.04",
"#text": "Client Name"
}
},
{
"text": ""
},
{
"text": ""
},
{
"text": ""
}
]
},
{
"column": [
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@x": "36.00",
"@y": "169.70",
"@width": "40.34",
"@height": "11.04",
"#text": "Address"
}
},
{
"text": ""
},
{
"text": ""
},
{
"text": ""
}
]
},
{
"column": [
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@x": "36.00",
"@y": "184.22",
"@width": "69.14",
"@height": "11.04",
"#text": "City, State Zip"
}
},
{
"text": ""
},
{
"text": ""
},
{
"text": ""
}
]
},
{
"column": [
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@x": "36.00",
"@y": "233.30",
"@width": "28.70",
"@height": "11.04",
"#text": "Notes"
}
},
{
"text": ""
},
{
"text": ""
},
{
"text": ""
}
]
},
{
"column": [
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@fontStyle": "Bold",
"@x": "36.00",
"@y": "316.25",
"@width": "22.58",
"@height": "11.04",
"#text": "Item"
}
},
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@fontStyle": "Bold",
"@x": "247.61",
"@y": "316.25",
"@width": "44.64",
"@height": "11.04",
"#text": "Quantity"
}
},
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@fontStyle": "Bold",
"@x": "398.95",
"@y": "316.25",
"@width": "26.91",
"@height": "11.04",
"#text": "Price"
}
},
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@fontStyle": "Bold",
"@x": "533.14",
"@y": "316.25",
"@width": "26.30",
"@height": "11.04",
"#text": "Total"
}
}
]
},
{
"column": [
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@x": "36.00",
"@y": "341.33",
"@width": "30.62",
"@height": "11.04",
"#text": "Item 1"
}
},
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@x": "286.13",
"@y": "341.33",
"@width": "6.12",
"@height": "11.04",
"#text": "1"
}
},
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@x": "398.35",
"@y": "341.33",
"@width": "27.51",
"@height": "11.04",
"#text": "40.00"
}
},
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@x": "531.94",
"@y": "341.33",
"@width": "27.50",
"@height": "11.04",
"#text": "40.00"
}
}
]
},
{
"column": [
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@x": "36.00",
"@y": "362.45",
"@width": "30.62",
"@height": "11.04",
"#text": "Item 2"
}
},
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@x": "286.13",
"@y": "362.45",
"@width": "6.12",
"@height": "11.04",
"#text": "2"
}
},
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@x": "398.35",
"@y": "362.45",
"@width": "27.51",
"@height": "11.04",
"#text": "30.00"
}
},
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@x": "531.94",
"@y": "362.45",
"@width": "27.50",
"@height": "11.04",
"#text": "60.00"
}
}
]
},
{
"column": [
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@x": "36.00",
"@y": "383.57",
"@width": "30.62",
"@height": "11.04",
"#text": "Item 3"
}
},
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@x": "286.13",
"@y": "383.57",
"@width": "6.12",
"@height": "11.04",
"#text": "3"
}
},
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@x": "398.35",
"@y": "383.57",
"@width": "27.51",
"@height": "11.04",
"#text": "20.00"
}
},
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@x": "531.94",
"@y": "383.57",
"@width": "27.50",
"@height": "11.04",
"#text": "60.00"
}
}
]
},
{
"column": [
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@x": "36.00",
"@y": "404.93",
"@width": "30.62",
"@height": "11.04",
"#text": "Item 4"
}
},
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@x": "286.13",
"@y": "404.93",
"@width": "6.12",
"@height": "11.04",
"#text": "4"
}
},
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@x": "398.35",
"@y": "404.93",
"@width": "27.51",
"@height": "11.04",
"#text": "10.00"
}
},
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@x": "531.94",
"@y": "404.93",
"@width": "27.50",
"@height": "11.04",
"#text": "40.00"
}
}
]
},
{
"column": [
{
"text": ""
},
{
"text": ""
},
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@fontStyle": "Bold",
"@x": "389.11",
"@y": "425.83",
"@width": "36.75",
"@height": "11.04",
"#text": "TOTAL"
}
},
{
"text": {
"@fontName": "Arial",
"@fontSize": "11.0",
"@fontStyle": "Bold",
"@x": "525.82",
"@y": "425.83",
"@width": "33.62",
"@height": "11.04",
"#text": "200.00"
}
}
]
}
]
}
}
},
"pageCount": 1,
"error": false,
"status": 200,
"name": "sample.json",
"remainingCredits": 60583
}
Status Code: 200
PDF To TEXT
Convert PDF and scanned images to Text with layout preserved.
1. /pdf/convert/to/text
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.pages
optional. Comma-separated list of page indices (or ranges) to process. IMPORTANT: the very first page starts at0
(zero). To set a range use the dash-
, for example:0,2-5,7-
. To set a range from index to the last page use range like this:2-
(from page #3 as the index starts at zero and till the of the document). For ALL pages just leave this param empty. Example:0,2-5,7-
means first page, then 3rd page to 6th page, and then the range from 8th (index =7
) page till the end of the document. Must be a String.unwrap
optional. Unwrap lines into a single line within table cells whenlineGrouping
is enabled. Must be one of:true
,false
.rect
optional. Defines coordinates for extraction, e.g.51.8, 114.8, 235.5, 204.0
. You can use PDF.co PDF Viewer with coordinates to easily select and copy coordinates. Must be a String.lang
optional. Sets OCR language to be used for scanned PDF, PNG, JPG douments when extracting text from them. Default iseng
. Supported values:eng
,spa
,deu
,fra
,jpn
,chi_sim
,chi_tra
,kor
. You can also specify two languages to be used on the same page, for example:eng+deu
,jpn+kor
or other combinations. For more languages please contact our customer support.inline
optional. Must be one of:true
to return data as inline orfalse
to return link to output file (default).lineGrouping
optional. optional. Line grouping within table cells. Set to1
to enable the grouping. Must be a String.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.async
optional. Runs processing asynchronously. Returns UseJobId
that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.name
optional. File name for generated output. Must be a String.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples. For example, to change CSV separator:{ 'profiles': [ { 'profile1': { 'CSVSeparatorSymbol': ';' } } ] }
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/convert/to/text
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-to-text/sample.pdf",
"inline": true
}
More example Requests/Responses:
I. Example Request: /pdf/convert/to/text
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-to-text/sample.pdf",
"inline": true
}
I. Example Response: /pdf/convert/to/text
{
"body": " Your Company Name \r\n Your Address \r\n City, State Zip \r\n Invoice No. 123456 \r\n Invoice Date 01/01/2016 \r\n Client Name \r\n Address \r\n City, State Zip \r\n\r\n Notes \r\n\r\n\r\n Item Quantity Price Total \r\n Item 1 1 40.00 40.00 \r\n Item 2 2 30.00 60.00 \r\n Item 3 3 20.00 60.00 \r\n Item 4 4 10.00 40.00 \r\n TOTAL 200.00\r\n",
"pageCount": 1,
"error": false,
"status": 200,
"name": "sample.txt",
"remainingCredits": 60577
}
Status Code: 200
PDF To XLS
Convert PDF and scanned images to spreadsheet with layout and fonts preserved.
1. /pdf/convert/to/xls
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.pages
optional. Comma-separated list of page indices (or ranges) to process. IMPORTANT: the very first page starts at0
(zero). To set a range use the dash-
, for example:0,2-5,7-
. To set a range from index to the last page use range like this:2-
(from page #3 as the index starts at zero and till the of the document). For ALL pages just leave this param empty. Example:0,2-5,7-
means first page, then 3rd page to 6th page, and then the range from 8th (index =7
) page till the end of the document. Must be a String.unwrap
optional. Unwrap lines into a single line within table cells whenlineGrouping
is enabled. Must be one of:true
,false
.rect
optional. Defines coordinates for extraction, e.g.51.8, 114.8, 235.5, 204.0
. You can use PDF.co PDF Viewer with coordinates to easily select and copy coordinates. Must be a String.lang
optional. Sets OCR language to be used for scanned PDF, PNG, JPG douments when extracting text from them. Default iseng
. Supported values:eng
,spa
,deu
,fra
,jpn
,chi_sim
,chi_tra
,kor
. You can also specify two languages to be used on the same page, for example:eng+deu
,jpn+kor
or other combinations. For more languages please contact our customer support.inline
optional. Must be one of:true
to return data as inline orfalse
to return link to output file (default).lineGrouping
optional. optional. Line grouping within table cells. Set to1
to enable the grouping. Must be a String.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.async
optional. Runs processing asynchronously. Returns UseJobId
that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.name
optional. File name for generated output. Must be a String.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples. For example, to change CSV separator:{ 'profiles': [ { 'profile1': { 'CSVSeparatorSymbol': ';' } } ] }
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/convert/to/xls
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-to-excel/sample.pdf"
}
More example Requests/Responses:
I. Example Request: /pdf/convert/to/xls
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-to-excel/sample.pdf"
}
I. Example Response: /pdf/convert/to/xls
{
"url": "https://pdf-temp-files.s3.amazonaws.com/544e26441de7451ab287152b7159d350/sample.xls",
"pageCount": 1,
"error": false,
"status": 200,
"name": "sample.xls",
"remainingCredits": 60572
}
Status Code: 200
PDF To XLSX
Convert PDF to spreadsheet with layout and fonts preserved.
1. /pdf/convert/to/xls
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.pages
optional. Comma-separated list of page indices (or ranges) to process. IMPORTANT: the very first page starts at0
(zero). To set a range use the dash-
, for example:0,2-5,7-
. To set a range from index to the last page use range like this:2-
(from page #3 as the index starts at zero and till the of the document). For ALL pages just leave this param empty. Example:0,2-5,7-
means first page, then 3rd page to 6th page, and then the range from 8th (index =7
) page till the end of the document. Must be a String.unwrap
optional. Unwrap lines into a single line within table cells whenlineGrouping
is enabled. Must be one of:true
,false
.rect
optional. Defines coordinates for extraction, e.g.51.8, 114.8, 235.5, 204.0
. You can use PDF.co PDF Viewer with coordinates to easily select and copy coordinates. Must be a String.lang
optional. Sets OCR language to be used for scanned PDF, PNG, JPG douments when extracting text from them. Default iseng
. Supported values:eng
,spa
,deu
,fra
,jpn
,chi_sim
,chi_tra
,kor
. You can also specify two languages to be used on the same page, for example:eng+deu
,jpn+kor
or other combinations. For more languages please contact our customer support.inline
optional. Must be one of:true
to return data as inline orfalse
to return link to output file (default).lineGrouping
optional. optional. Line grouping within table cells. Set to1
to enable the grouping. Must be a String.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.async
optional. Runs processing asynchronously. Returns UseJobId
that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.name
optional. File name for generated output. Must be a String.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples. For example, to change CSV separator:{ 'profiles': [ { 'profile1': { 'CSVSeparatorSymbol': ';' } } ] }
Endpoint:
Method: POST
Type: POST params, JSON or FORMDATA
URL: https://api.pdf.co/v1/pdf/convert/to/xlsx
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Query params:
Key | Value | Description |
---|---|---|
Body:
Key | Value | Description |
---|---|---|
url | https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-to-excel/sample.pdf | required. URL of the source PDF file. Must be a String. To use your file please upload it first to the temporary storage, see Upload and Manage Files section below to learn how to do it. |
name | result.xlsx | optional. File name for generated output. Must be a String. |
password | optional. Password of PDF file. Must be a String. | |
pages | optional. Comma-separated list of page indices (or ranges) to process. IMPORTANT: the very first page starts at 0 (zero). To set a range use the dash - , for example: 0,2-5,7- . To set a range from index to the last page use range like this: 2- (from page #3 as the index starts at zero and till the of the document). For ALL pages just leave this param empty. Example: 0,2-5,7- means first page, then 3rd page to 6th page, and then the range from 8th (index = 7 ) page till the end of the document. Must be a String. |
More example Requests/Responses:
I. Example Request: /pdf/convert/to/xls
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Query:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Optional. Please use http headers instead when possible because passing your API key as parameter for POST or GET is not secure and is for legacy app compatibility only. |
Body:
{
"url": "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-to-excel/sample.pdf"
}
I. Example Response: /pdf/convert/to/xls
{
"url": "https://pdf-temp-files.s3.amazonaws.com/60c6b9f50280495a9567f73a0a394252/sample.xlsx",
"pageCount": 1,
"error": false,
"status": 200,
"name": "sample.xlsx",
"remainingCredits": 60568
}
Status Code: 200
PDF To XML
Convert PDF to XML with information about text value, tables, fonts, images, objects positions.
1. /pdf/convert/to/xml
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.pages
optional. Comma-separated list of page indices (or ranges) to process. IMPORTANT: the very first page starts at0
(zero). To set a range use the dash-
, for example:0,2-5,7-
. To set a range from index to the last page use range like this:2-
(from page #3 as the index starts at zero and till the of the document). For ALL pages just leave this param empty. Example:0,2-5,7-
means first page, then 3rd page to 6th page, and then the range from 8th (index =7
) page till the end of the document. Must be a String.unwrap
optional. Unwrap lines into a single line within table cells whenlineGrouping
is enabled. Must be one of:true
,false
.rect
optional. Defines coordinates for extraction, e.g.51.8, 114.8, 235.5, 204.0
. You can use PDF.co PDF Viewer with coordinates to easily select and copy coordinates. Must be a String.lang
optional. Sets OCR language to be used for scanned PDF, PNG, JPG douments when extracting text from them. Default iseng
. Supported values:eng
,spa
,deu
,fra
,jpn
,chi_sim
,chi_tra
,kor
. You can also specify two languages to be used on the same page, for example:eng+deu
,jpn+kor
or other combinations. For more languages please contact our customer support.inline
optional. Must be one of:true
to return data as inline orfalse
to return link to output file (default).lineGrouping
optional. optional. Line grouping within table cells. Set to1
to enable the grouping. Must be a String.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.async
optional. Runs processing asynchronously. Returns UseJobId
that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.name
optional. File name for generated output. Must be a String.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/convert/to/xml
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-to-xml/sample.pdf"
}
More example Requests/Responses:
I. Example Request: /pdf/convert/to/xml
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-to-xml/sample.pdf",
"inline": true
}
I. Example Response: /pdf/convert/to/xml
{
"body": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<document>\r\n <page index=\"0\">\r\n <row>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"24.0\" fontStyle=\"Bold\" color=\"#538DD3\" x=\"36.00\" y=\"34.44\" width=\"242.81\" height=\"24.00\">Your Company Name</text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n </row>\r\n <row>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" x=\"36.00\" y=\"76.94\" width=\"66.62\" height=\"11.04\">Your Address</text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n </row>\r\n <row>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" x=\"36.00\" y=\"91.46\" width=\"69.14\" height=\"11.04\">City, State Zip</text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n </row>\r\n <row>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" fontStyle=\"Bold\" x=\"461.02\" y=\"115.94\" width=\"98.42\" height=\"11.04\">Invoice No. 123456</text>\r\n </column>\r\n </row>\r\n <row>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" fontStyle=\"Bold\" x=\"436.54\" y=\"130.46\" width=\"122.90\" height=\"11.04\">Invoice Date 01/01/2016</text>\r\n </column>\r\n </row>\r\n <row>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" fontStyle=\"Bold\" x=\"36.00\" y=\"154.94\" width=\"63.62\" height=\"11.04\">Client Name</text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n </row>\r\n <row>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" x=\"36.00\" y=\"169.70\" width=\"40.34\" height=\"11.04\">Address</text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n </row>\r\n <row>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" x=\"36.00\" y=\"184.22\" width=\"69.14\" height=\"11.04\">City, State Zip</text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n </row>\r\n <row>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" x=\"36.00\" y=\"233.30\" width=\"28.70\" height=\"11.04\">Notes</text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n </row>\r\n <row>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" fontStyle=\"Bold\" x=\"36.00\" y=\"316.25\" width=\"22.58\" height=\"11.04\">Item</text>\r\n </column>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" fontStyle=\"Bold\" x=\"247.61\" y=\"316.25\" width=\"44.64\" height=\"11.04\">Quantity</text>\r\n </column>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" fontStyle=\"Bold\" x=\"398.95\" y=\"316.25\" width=\"26.91\" height=\"11.04\">Price</text>\r\n </column>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" fontStyle=\"Bold\" x=\"533.14\" y=\"316.25\" width=\"26.30\" height=\"11.04\">Total</text>\r\n </column>\r\n </row>\r\n <row>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" x=\"36.00\" y=\"341.33\" width=\"30.62\" height=\"11.04\">Item 1</text>\r\n </column>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" x=\"286.13\" y=\"341.33\" width=\"6.12\" height=\"11.04\">1</text>\r\n </column>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" x=\"398.35\" y=\"341.33\" width=\"27.51\" height=\"11.04\">40.00</text>\r\n </column>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" x=\"531.94\" y=\"341.33\" width=\"27.50\" height=\"11.04\">40.00</text>\r\n </column>\r\n </row>\r\n <row>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" x=\"36.00\" y=\"362.45\" width=\"30.62\" height=\"11.04\">Item 2</text>\r\n </column>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" x=\"286.13\" y=\"362.45\" width=\"6.12\" height=\"11.04\">2</text>\r\n </column>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" x=\"398.35\" y=\"362.45\" width=\"27.51\" height=\"11.04\">30.00</text>\r\n </column>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" x=\"531.94\" y=\"362.45\" width=\"27.50\" height=\"11.04\">60.00</text>\r\n </column>\r\n </row>\r\n <row>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" x=\"36.00\" y=\"383.57\" width=\"30.62\" height=\"11.04\">Item 3</text>\r\n </column>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" x=\"286.13\" y=\"383.57\" width=\"6.12\" height=\"11.04\">3</text>\r\n </column>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" x=\"398.35\" y=\"383.57\" width=\"27.51\" height=\"11.04\">20.00</text>\r\n </column>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" x=\"531.94\" y=\"383.57\" width=\"27.50\" height=\"11.04\">60.00</text>\r\n </column>\r\n </row>\r\n <row>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" x=\"36.00\" y=\"404.93\" width=\"30.62\" height=\"11.04\">Item 4</text>\r\n </column>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" x=\"286.13\" y=\"404.93\" width=\"6.12\" height=\"11.04\">4</text>\r\n </column>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" x=\"398.35\" y=\"404.93\" width=\"27.51\" height=\"11.04\">10.00</text>\r\n </column>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" x=\"531.94\" y=\"404.93\" width=\"27.50\" height=\"11.04\">40.00</text>\r\n </column>\r\n </row>\r\n <row>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n <column>\r\n <text>\r\n </text>\r\n </column>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" fontStyle=\"Bold\" x=\"389.11\" y=\"425.83\" width=\"36.75\" height=\"11.04\">TOTAL</text>\r\n </column>\r\n <column>\r\n <text fontName=\"Arial\" fontSize=\"11.0\" fontStyle=\"Bold\" x=\"525.82\" y=\"425.83\" width=\"33.62\" height=\"11.04\">200.00</text>\r\n </column>\r\n </row>\r\n </page>\r\n</document>",
"pageCount": 1,
"error": false,
"status": 200,
"name": "sample.xml",
"remainingCredits": 60563
}
Status Code: 200
PDF from CSV (CSV to PDF)
Description: Convert CSV, XLS, XLSX to PDF conversion. GET
or POST
request.
Status Errors
Code | Description |
---|---|
200 | The request has succeeded |
400 | bad input parameters |
401 | unauthorized |
403 | not enough credits |
405 | Timeout error. To process large documents or files please use asynchronous mode ( set async parameter to true) and then check the status using /job/check endpoint. If file contains many pages then specify a page range using pages parameter. The number of pages of the document can be obtained using the endpoint /pdf/info |
Example
Sample Request:
! Don’t forget to set x-api-key
url param or http header param (preferred) to API key, get yours here
POST
{
"name" : "result.pdf",
"pages" : "",
"url" : "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/csv-to-pdf/sample.csv"
}
1. /pdf/convert/from/csv
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.pages
optional. Comma-separated list of page indices (or ranges) to process. IMPORTANT: the very first page starts at0
(zero). To set a range use the dash-
, for example:0,2-5,7-
. To set a range from index to the last page use range like this:2-
(from page #3 as the index starts at zero and till the of the document). For ALL pages just leave this param empty. Example:0,2-5,7-
means first page, then 3rd page to 6th page, and then the range from 8th (index =7
) page till the end of the document. Must be a String.name
optional. File name for generated output. Must be a String.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.async
optional. Runs processing asynchronously. Returns Use JobId that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/convert/from/csv
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/csv-to-pdf/sample.csv",
"pages": "0-",
"name": "result.pdf"
}
More example Requests/Responses:
I. Example Request: /pdf/convert/from/csv
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
Key | Value | Description | |
---|---|---|---|
url | https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/csv-to-pdf/sample.csv | optional. URL of the source PDF file. Must be a String. | |
name | result.pdf | optional. File name for generated output. Must be a String. | |
pages | optional. Comma-separated list of page indices (or ranges) to process. IMPORTANT: the very first page starts at 0 (zero). To set a range use the dash - , for example: 0,2-5,7- . To set a range from index to the last page use range like this: 2- (from page #3 as the index starts at zero and till the of the document). For ALL pages just leave this param empty. Example: 0,2-5,7- means first page, then 3rd page to 6th page, and then the range from 8th (index = 7 ) page till the end of the document. Must be a String. |
I. Example Response: /pdf/convert/from/csv
{
"url": "https://pdf-temp-files.s3.amazonaws.com/01ede81738a44b4fa5a6b909115ae0a3/result.pdf",
"pageCount": 1,
"error": false,
"status": 200,
"name": "result.pdf",
"remainingCredits": 98506
}
Status Code: 200
PDF from Doc, DocX, RTF, TXT, XPS (Document to PDF)
Description: Convert DOC, DOCX, RTF, TXT, XPS files into PDF. GET
or POST
request.
Status Errors
Code | Description |
---|---|
200 | The request has succeeded |
400 | bad input parameters |
401 | unauthorized |
403 | not enough credits |
405 | Timeout error. To process large documents or files please use asynchronous mode ( set async parameter to true) and then check the status using /job/check endpoint. If file contains many pages then specify a page range using pages parameter. The number of pages of the document can be obtained using the endpoint /pdf/info |
Example
Sample Request:
! Don’t forget to set x-api-key
url param or http header param (preferred) to API key, get yours here
POST
{
"name" : "result.pdf",
"url" : "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/doc-to-pdf/sample.docx"
}
1. /pdf/convert/from/doc
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.pages
optional. Comma-separated list of page indices (or ranges) to process. IMPORTANT: the very first page starts at0
(zero). To set a range use the dash-
, for example:0,2-5,7-
. To set a range from index to the last page use range like this:2-
(from page #3 as the index starts at zero and till the of the document). For ALL pages just leave this param empty. Example:0,2-5,7-
means first page, then 3rd page to 6th page, and then the range from 8th (index =7
) page till the end of the document. Must be a String.name
optional. File name for generated output. Must be a String.encrypt
optional. Enable encryption for output file. Must be one of:true
,false
.async
optional. Runs processing asynchronously. Returns Use JobId that you may use with/job/check
to check state of the processing (possible states:working
,failed
,aborted
andsuccess
). Must be one of:true
,false
.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/convert/from/doc
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/doc-to-pdf/sample.docx",
"pages": "0-",
"name": "result.pdf"
}
More example Requests/Responses:
I. Example Request: POST /pdf/convert/from/doc
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
Key | Value | Description |
---|---|---|
encrypt | true | optional. Enable encryption for output file. Must be one of: true , false . |
url | https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/doc-to-pdf/sample.docx | required. URL of the source file. Must be a String. To use your file please upload it first to the temporary storage, see Upload and Manage Files section below to learn how to do it. |
name | result.pdf | optional. File name for generated output. Must be a String. |
I. Example Response: POST /pdf/convert/from/doc
{
"url": "https://pdf-temp-files.s3-us-west-2.amazonaws.com/efc283805b4a47da87910826d4ddf063/result.pdf?X-Amz-Expires=3600&x-amz-security-token=FwoGZXIvYXdzEKz%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDFzXkfTapcUbLLKahiKBAbIL4F2wV3gvozuGDxmOpWUu9ETuVzkYKjMuNLAFzVZeSgRm9Yuaj7ubad9uOLQkL65GNgBQoy1Xm%2FxtLWD9tegUYd3hFvYfIWMfkWjuROwMGTZeD3CMacDPdFkP%2BUSG4aXOZb8MoG2PXnsd9UUeOvrevZkCVTg77OBXIteBCPOojSjeis%2F5BTIoVCi%2FrwV5kEGkbfBwtgsfQL3MxSbg7j%2Fud%2F3oGbUWW7zsemcfiHTiFg%3D%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIA4NRRSZPHAK44PZ6O/20200812/us-west-2/s3/aws4_request&X-Amz-Date=20200812T103301Z&X-Amz-SignedHeaders=host;x-amz-security-token&X-Amz-Signature=6a176281828de74c917a4ff5bacd46eeca50221178bf34d01cac331f172e51c3",
"pageCount": 1,
"error": false,
"status": 200,
"name": "result.pdf",
"remainingCredits": 61165
}
Status Code: 200
PDF from Email
Description: Convert email files (MSG or EML) code into PDF. Extracts attachments (if any) from input email and embeds into PDF as pdf attachments.
Status Errors
Code | Description |
---|---|
200 | The request has succeeded |
400 | bad input parameters |
401 | unauthorized |
403 | not enough credits |
405 | Timeout error. To process large documents or files please use asynchronous mode ( set async parameter to true) and then check the status using /job/check endpoint. If file contains many pages then specify a page range using pages parameter. The number of pages of the document can be obtained using the endpoint /pdf/info |
Example
Sample Request:
! Don’t forget to set x-api-key
url param or http header param (preferred) to API key, get yours here
1. /email/decode
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/email/decode
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/email-extractor/sample.eml"
}
More example Requests/Responses:
I. Example Request: /email/decode
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/email-extractor/sample.eml"
}
I. Example Response: /email/decode
{
"body": {
"from": "test@example.com",
"fromName": "",
"to": [
{
"address": "test2@example.com",
"name": ""
}
],
"cc": [],
"bcc": [],
"sentAt": null,
"receivedAt": null,
"subject": "Test email with attachments",
"bodyHtml": null,
"bodyText": "Test Email Message with 2 PDF files as attachments\r\n\r\n",
"attachmentCount": 2
},
"error": false,
"status": 200,
"name": "sample.json",
"remainingCredits": 60095
}
Status Code: 200
2. /email/extract-attachments
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/email/extract-attachments
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/email-extractor/sample.eml"
}
More example Requests/Responses:
I. Example Request: POST /email/extract-attachments
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/email-extractor/sample.eml"
}
I. Example Response: POST /email/extract-attachments
{
"body": {
"from": "test@example.com",
"subject": "Test email with attachments",
"bodyHtml": null,
"bodyText": "Test Email Message with 2 PDF files as attachments\r\n\r\n",
"attachments": [
{
"filename": "DigitalOcean.pdf",
"url": "https://pdf-temp-files.s3.amazonaws.com/2943e6bb80e646ec92e839292e95d542/DigitalOcean.pdf"
},
{
"filename": "sample.pdf",
"url": "https://pdf-temp-files.s3.amazonaws.com/e10e37fbb438432a83ece50ccdc719b3/sample.pdf"
}
]
},
"pageCount": 2,
"error": false,
"status": 200,
"name": "sample.json",
"remainingCredits": 60085
}
Status Code: 200
3. /pdf/convert/from/email
Generate PDF from MSG
or EML
file and creates PDF file with email and attachments (if any). You can set the following params:
url
required. Link to input EML or MSG file to be converted. You can pass link to file from Google Drive, Dropbox or another online file service that can generate shareable links. You can also use built-in PDF.co cloud storage located at https://app.pdf.co/files or upload your file as temporary file right before making this API call (seeUpload and Manage Files
section for more details on uploading files via API).embedAttachments
optional.True
by default. Set totrue
to automatically embeds all attachments from original input email MSG or EML fileas files into final output PDF. Set tofalse
if you don’t want to embed attachments so it will convert only the body of input email.convertAttachments
optional.true
by default. Set tofalse
if you don’t want to convert attachments from original email and want to embed them as original files (as embedded pdf attachments). Converts attachments that are supported by API (doc, docx, html, png, jpg etc) into PDF and merges into output final PDF. Non-supported file types are added as PDF attachments (Adobe Reader or another viewer maybe required to view PDF attachments).async
optional. Set totrue
to run as async job in background (recommended for heavy documents).margins
optional. set to css style margins like10 px
or5px 5px 5px 5px
paperSize
optional. Can beLetter
,A4
,A5
,A6
or custom size like200x200
orientation
optional. set toPortrait
orLandscape
.Portrait
by default.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/convert/from/email
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/email-to-pdf/sample.eml",
"embedAttachments": true,
"convertAttachments": true,
"paperSize": "Letter",
"name": "email-with-attachments",
"async": false,
"encrypt": false
}
More example Requests/Responses:
I. Example Request: /pdf/convert/from/url (with header and footer)
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Body:
{
"url": "https://wikipedia.org",
"async": false,
"encrypt": false,
"name": "result.pdf",
"margins": "40px 5px 40px 5px",
"paperSize": "Letter",
"orientation": "Portrait",
"printBackground": true,
"header": "<div style='width:100%'><span style='font-size:10px;margin-left:20px;width:50%;float:left'>LEFT SUBHEADER</span><span style='font-size:8px;width:30%;float:right'>RIGHT SUBHEADER</span></div>",
"footer": "<div style='width:100%;text-align:right'><span style='font-size:10px;margin-right:20px'>Page <span class='pageNumber'></span> of <span class='totalPages'></span>.</span></div>"
}
Status Code: 0
II. Example Request: JSON POST /pdf/convert/from/url
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Body:
{
"url": "https://wikipedia.org/wiki/Wikipedia:Contact_us",
"margins": "5px 5px 5px 5px",
"paperSize": "Letter",
"orientation": "Portrait",
"printBackground": true,
"header": "",
"footer": "",
"async": false,
"encrypt": false
}
II. Example Response: JSON POST /pdf/convert/from/url
{
"url": "https://pdf-temp-files.s3.amazonaws.com/980bc13f061344809c75e83ce181851c/Contact_us.pdf",
"pageCount": 3,
"error": false,
"status": 200,
"name": "Contact_us.pdf",
"remainingCredits": 60637
}
Status Code: 200
4. /pdf/convert/from/email with Orientation and paper Size
url
required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section.profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/convert/from/email
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/email-to-pdf/sample.eml",
"embedAttachments": true,
"name": "email-with-attachments",
"async": false,
"encrypt": false,
"profiles": "{\"orientation\": \"landscape\", \"paperSize\": \"letter\" }"
}
More example Requests/Responses:
I. Example Request: POST /email/extract-attachments
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/email-extractor/sample.eml"
}
I. Example Response: POST /email/extract-attachments
{
"body": {
"from": "test@example.com",
"subject": "Test email with attachments",
"bodyHtml": null,
"bodyText": "Test Email Message with 2 PDF files as attachments\r\n\r\n",
"attachments": [
{
"filename": "DigitalOcean.pdf",
"url": "https://pdf-temp-files.s3.amazonaws.com/2943e6bb80e646ec92e839292e95d542/DigitalOcean.pdf"
},
{
"filename": "sample.pdf",
"url": "https://pdf-temp-files.s3.amazonaws.com/e10e37fbb438432a83ece50ccdc719b3/sample.pdf"
}
]
},
"pageCount": 2,
"error": false,
"status": 200,
"name": "sample.json",
"remainingCredits": 60085
}
Status Code: 200
PDF from HTML (HTML to PDF)
Description: Convert HTML code snippet into full featured PDF. GET
or POST
request.
Status Errors
Code | Description |
---|---|
200 | The request has succeeded |
400 | bad input parameters |
401 | unauthorized |
403 | not enough credits |
405 | Timeout error. To process large documents or files please use asynchronous mode ( set async parameter to true) and then check the status using /job/check endpoint. If file contains many pages then specify a page range using pages parameter. The number of pages of the document can be obtained using the endpoint /pdf/info |
Example
Sample Request:
! Don’t forget to set x-api-key
url param or http header param (preferred) to API key, get yours here
POST
{
"name" : "result.pdf",
"html" : "true",
"url" : "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-to-html/sample.html"
}
1. /pdf/convert/from/html
Generate PDF from HTML input. You can also set the following params:
html
required. Input HTML code to be converted. If you need to convert link or url to PDF then use/pdf/convert/from/url
endpoint instead.async
optional. Set totrue
to run as async job in background (recommended for heavy documents).margins
optional. set to css style margins like10 px
or5px 5px 5px 5px
paperSize
optional. Can beLetter
,A4
,A5
,A6
or custom size like200x200
orientation
optional. set toPortrait
orLandscape
.Portrait
by default.printBackground
optional.true
by default. Set tofalse
to disbale printing of background.templateData
optional string. String with JSON data to replace inside HTML. If this property has JSON code inside (note that it should be represented as escaped string) then the engine will process input HTML (or in URL) as Handlebars HTML template and will replace data in the template accordingly. For example:{{invoice.company}}
in HTML will be replaced withACME Company
iftemplateData
is set to{invoice: {company: \"ACME Company\"}}
.templateData
optional. You can also use Handlebars & Mustache style html templates. SettemplateData
to the string representsation of input JSON data for your template
Sample template: https://bytescout-com.s3-us-west-2.amazonaws.com/files/cloudapi-templates/template-invoice-1.html
Example input data for this template:
{
"invoice": {
"id": "0021",
"date": "August 29, 2041",
"dateDue": "September 29, 2041"
},
"issuer": {
"name": "Sarah Connor",
"company": "T-800 Research Lab",
"address": "435 South La Fayette Park Place, Los Angeles, CA 90057",
"website": "www.example.com",
"email": "info@example.com"
},
"client": {
"name": "Cyberdyne Systems",
"company": "Cyberdyne Systems",
"address": "18144 El Camino Real, Sunnyvale, California"
}
}
Note: you should set templateData
to the escaped version (use JSON.stringify(object)
or similar). For a sample on using templates please check PDF from HTML Template
set of samples below.
header
optional. Set to HTML for header to be applied on every page at the header.footer
optional. Set to HTML for footer to be applied on every page at the bottom.
The header
and footer
params should contain valid HTML markup with the following classes used to inject printing values into them:
date
: formatted print date title
: document title url
: document location pageNumber
: current page number totalPages
: total pages in the document
For example, the following markup will generate Page N of NN
page numbering:
<span style='font-size:10px'>Page <span class='pageNumber'></span> of <span class='totalPages'></span>.</span>
Sample JSON for PDF generation with more advanced header and footer. Note that the top and bottom page margins are important because the page content may overlap the footer or header.
{
"html": ""<!DOCTYPE html><html><head><meta charSet=\"utf-8\"/><style type=\"text/css\">body { font-family: \"Arial\" }</style></head><body><h1>Hello</h1></body></html>",
"async": false,
"encrypt": false,
"name": "result.pdf",
"margins": "40px 5px 40px 5px",
"paperSize": "Letter",
"orientation": "Portrait",
"printBackground": true,
"header": "<div style='width:100%'><span style='font-size:10px;margin-left:20px;width:50%;float:left'>LEFT SUBHEADER</span><span style='font-size:8px;width:30%;float:right'>RIGHT SUBHEADER</span></div>",
"footer": "<div style='width:100%;text-align:right'><span style='font-size:10px;margin-right:20px'>Page <span class='pageNumber'></span> of <span class='totalPages'></span>.</span></div>"
}
profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/convert/from/html
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Body:
{
"html": "<h1>Hello World!</h1><a href='https://pdf.co'>Go to PDF.co</a>",
"name": "result.pdf",
"margins": "5px 5px 5px 5px",
"paperSize": "Letter",
"orientation": "Portrait",
"printBackground": true,
"header": "",
"footer": "",
"async": false,
"encrypt": false
}
More example Requests/Responses:
I. Example Request: /pdf/convert/from/html
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Body:
{
"html": "<h1>Hello World!</h1>",
"async": false,
"encrypt": false,
"name": "result.pdf",
"margins": "5px 5px 5px 5px",
"paperSize": "Letter",
"orientation": "Portrait",
"printBackground": true,
"header": "",
"footer": ""
}
I. Example Response: /pdf/convert/from/html
{
"url": "https://pdf-temp-files.s3.amazonaws.com/97dc323f32794eae8fa6602f5bd981c1/result.pdf",
"pageCount": 1,
"error": false,
"status": 200,
"name": "result.pdf",
"remainingCredits": 60646
}
Status Code: 200
II. Example Request: /pdf/convert/from/html (with header and footer)
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Body:
{
"html": "<!DOCTYPE html><html><head><meta charSet=\"utf-8\"/><style type=\"text/css\">body { font-family: \"Arial\" }</style></head><body><h1>Hello</h1></body></html>",
"async": false,
"encrypt": false,
"name": "result.pdf",
"margins": "40px 5px 40px 5px",
"paperSize": "Letter",
"orientation": "Portrait",
"printBackground": true,
"header": "<div style='width:100%'><span style='font-size:10px;margin-left:20px;width:50%;float:left'>LEFT SUBHEADER</span><span style='font-size:8px;width:30%;float:right'>RIGHT SUBHEADER</span></div>",
"footer": "<div style='width:100%;text-align:right'><span style='font-size:10px;margin-right:20px'>Page <span class='pageNumber'></span> of <span class='totalPages'></span>.</span></div>"
}
Status Code: 0
2. /pdf/convert/from/html (with custom profiles and custom js to disable links)
Generate PDF from HTML input. You can also set the following params:
html
required. Input HTML code to be converted. If you need to convert link or url to PDF then use/pdf/convert/from/url
endpoint instead.async
optional. Set totrue
to run as async job in background (recommended for heavy documents).margins
optional. set to css style margins like10 px
or5px 5px 5px 5px
paperSize
optional. Can beLetter
,A4
,A5
,A6
or custom size like200x200
orientation
optional. set toPortrait
orLandscape
.Portrait
by default.printBackground
optional.true
by default. Set tofalse
to disbale printing of background.templateData
optional string. String with JSON data to replace inside HTML. If this property has JSON code inside (note that it should be represented as escaped string) then the engine will process input HTML (or in URL) as Handlebars HTML template and will replace data in the template accordingly. For example:{{invoice.company}}
in HTML will be replaced withACME Company
iftemplateData
is set to{invoice: {company: \"ACME Company\"}}
.templateData
optional. You can also use Handlebars & Mustache style html templates. SettemplateData
to the string representsation of input JSON data for your template
Sample template: https://bytescout-com.s3-us-west-2.amazonaws.com/files/cloudapi-templates/template-invoice-1.html
Example input data for this template:
{
"invoice": {
"id": "0021",
"date": "August 29, 2041",
"dateDue": "September 29, 2041"
},
"issuer": {
"name": "Sarah Connor",
"company": "T-800 Research Lab",
"address": "435 South La Fayette Park Place, Los Angeles, CA 90057",
"website": "www.example.com",
"email": "info@example.com"
},
"client": {
"name": "Cyberdyne Systems",
"company": "Cyberdyne Systems",
"address": "18144 El Camino Real, Sunnyvale, California"
}
}
Note: you should set templateData
to the escaped version (use JSON.stringify(object)
or similar). For a sample on using templates please check PDF from HTML Template
set of samples below.
header
optional. Set to HTML for header to be applied on every page at the header.footer
optional. Set to HTML for footer to be applied on every page at the bottom.
The header
and footer
params should contain valid HTML markup with the following classes used to inject printing values into them:
date
: formatted print date title
: document title url
: document location pageNumber
: current page number totalPages
: total pages in the document
For example, the following markup will generate Page N of NN
page numbering:
<span style='font-size:10px'>Page <span class='pageNumber'></span> of <span class='totalPages'></span>.</span>
Sample JSON for PDF generation with more advanced header and footer. Note that the top and bottom page margins are important because the page content may overlap the footer or header.
{
"html": ""<!DOCTYPE html><html><head><meta charSet=\"utf-8\"/><style type=\"text/css\">body { font-family: \"Arial\" }</style></head><body><h1>Hello</h1></body></html>",
"async": false,
"encrypt": false,
"name": "result.pdf",
"margins": "40px 5px 40px 5px",
"paperSize": "Letter",
"orientation": "Portrait",
"printBackground": true,
"header": "<div style='width:100%'><span style='font-size:10px;margin-left:20px;width:50%;float:left'>LEFT SUBHEADER</span><span style='font-size:8px;width:30%;float:right'>RIGHT SUBHEADER</span></div>",
"footer": "<div style='width:100%;text-align:right'><span style='font-size:10px;margin-right:20px'>Page <span class='pageNumber'></span> of <span class='totalPages'></span>.</span></div>"
}
profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/convert/from/html
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Body:
{
"html": "<h1>Hello World!</h1>",
"name": "result.pdf",
"margins": "5px 5px 5px 5px",
"printBackground": true,
"header": "",
"footer": "",
"async": false,
"encrypt": false,
"profiles": "{\"orientation\": \"landscape\", \"paperSize\": \"letter\" }"
}
More example Requests/Responses:
I. Example Request: /pdf/convert/from/html
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Body:
{
"html": "<h1>Hello World!</h1>",
"async": false,
"encrypt": false,
"name": "result.pdf",
"margins": "5px 5px 5px 5px",
"paperSize": "Letter",
"orientation": "Portrait",
"printBackground": true,
"header": "",
"footer": ""
}
I. Example Response: /pdf/convert/from/html
{
"url": "https://pdf-temp-files.s3.amazonaws.com/97dc323f32794eae8fa6602f5bd981c1/result.pdf",
"pageCount": 1,
"error": false,
"status": 200,
"name": "result.pdf",
"remainingCredits": 60646
}
Status Code: 200
II. Example Request: /pdf/convert/from/html (with header and footer)
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Body:
{
"html": "<!DOCTYPE html><html><head><meta charSet=\"utf-8\"/><style type=\"text/css\">body { font-family: \"Arial\" }</style></head><body><h1>Hello</h1></body></html>",
"async": false,
"encrypt": false,
"name": "result.pdf",
"margins": "40px 5px 40px 5px",
"paperSize": "Letter",
"orientation": "Portrait",
"printBackground": true,
"header": "<div style='width:100%'><span style='font-size:10px;margin-left:20px;width:50%;float:left'>LEFT SUBHEADER</span><span style='font-size:8px;width:30%;float:right'>RIGHT SUBHEADER</span></div>",
"footer": "<div style='width:100%;text-align:right'><span style='font-size:10px;margin-right:20px'>Page <span class='pageNumber'></span> of <span class='totalPages'></span>.</span></div>"
}
Status Code: 0
PDF from HTML template (Mustache or HandleBars style)
Description: Creates PDF from HTML template. POST
request.
Status Errors
Code | Description |
---|---|
200 | The request has succeeded |
400 | bad input parameters |
401 | unauthorized |
403 | not enough credits |
405 | Timeout error. To process large documents or files please use asynchronous mode ( set async parameter to true) and then check the status using /job/check endpoint. If file contains many pages then specify a page range using pages parameter. The number of pages of the document can be obtained using the endpoint /pdf/info |
PDF.co supports Handlebars & Mustache HTML templates. It works like this: HTML or URL to HTML contains HTML code with special macros like {{invoice.company}}
inside. To put data for to be replaced in the template use templateData
property with the string representation of JSON data object inside (use JSON.stringify(object)
or similar to generate string from JSON).
So if you are setting templateData
property to JSON like this { invoice: { company: \"ACME Company\"}}
then {{invoice.company}}
inside HTML template is getting replaced with ACME Company
.
For more information about Handlebars & Mustache templates please visit https://handlebarsjs.com/.
1. /pdf/convert/from/html (using simple inline HTML template)
You can generate PDF from HTML template. Just pass HTML template with Mustache or Handlebars variables as input.
html
required. HTML template with Mustache and Handlebars template. If you need to convert from url then please use/pdf/convert/from/url
endpoint instead.margins
optional. set to css style margins like10 px
or5px 5px 5px 5px
paperSize
optional. Can beLetter
,A4
,A5
,A6
or custom size like200x200
orientation
optional. set toPortrait
orLandscape
.Portrait
by default.printBackground
optional.true
by default. Set tofalse
to disbale printing of background.header
optional. Set to HTML for header to be applied on every page at the header.footer
optional. Set to HTML for footer to be applied on every page at the bottom.async
optional. Set totrue
to run as async job in background (recommended for heavy documents).templateData
optional. Set to string with JSON data for template if your HTML is a template (Handlebars & Mustache style). And you should settemplateData
param to the escaped string (useJSON.stringify(object)
or similar)profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/convert/from/html
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Body:
{
"html": "Sample template: <strong>{{variable1}}</strong> and <strong>{{variable2}}</strong>",
"name": "newDocument.pdf",
"margins": "5px 5px 5px 5px",
"paperSize": "Letter",
"orientation": "Portrait",
"printBackground": true,
"header": "",
"footer": "",
"async": false,
"encrypt": false,
"templateData": "{\"variable1\": \"Hello from variable1\", \"variable2\": \"Hello from variable 2\"}"
}
More example Requests/Responses:
I. Example Request: JSON POST (simple template) /pdf/convert/from/url
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Body:
{
"html": "Sample template: <strong>{{variable1}}</strong> and <strong>{{variable2}}</strong>",
"name": "newDocument.pdf",
"margins": "5px 5px 5px 5px",
"paperSize": "Letter",
"orientation": "Portrait",
"printBackground": true,
"header": "",
"footer": "",
"async": false,
"encrypt": false,
"templateData": "{\"variable1\": \"Hello from variable1\", \"variable2\": \"Hello from variable 2\"}"
}
I. Example Response: JSON POST (simple template) /pdf/convert/from/url
{
"url": "https://pdf-temp-files.s3.amazonaws.com/3f10116dafe4498aa0c498ac1735fb76/newDocument.pdf",
"pageCount": 1,
"error": false,
"status": 200,
"name": "newDocument.pdf",
"remainingCredits": 60065
}
Status Code: 200
2. /pdf/convert/from/url (invoice template 1)
Generate PDF from HTML templates (Mustache and Handlebars template styles are supported). Input Parameters
url
required. Url to HTML template. Mustache and Handlebars templates are supported. You can pass link to file from Google Drive, Dropbox or another online file service that can generate shareable links. You can also use built-in PDF.co cloud storage located at https://app.pdf.co/files or upload your file as temporary file right before making this API call (seeUpload and Manage Files
section for more details on uploading files via API).margins
optional. set to css style margins like10 px
or5px 5px 5px 5px
paperSize
optional. Can beLetter
,A4
,A5
,A6
or custom size like200x200
orientation
optional. set toPortrait
orLandscape
.Portrait
by default.printBackground
optional.true
by default. Set tofalse
to disbale printing of background.header
optional. Set to HTML for header to be applied on every page at the header.footer
optional. Set to HTML for footer to be applied on every page at the bottom.async
optional. Set totrue
to run as async job in background (recommended for heavy documents).templateData
optional. Set to string with JSON data for template if your HTML is a template (Handlebars & Mustache style).
Example of JSON for template data:
{
"invoice": {
"id": "0021",
"date": "August 29, 2041",
"dateDue": "September 29, 2041"
},
"issuer": {
"name": "Sarah Connor",
"company": "T-800 Research Lab",
"address": "435 South La Fayette Park Place, Los Angeles, CA 90057",
"website": "www.example.com",
"email": "info@example.com"
},
"client": {
"name": "Cyberdyne Systems",
"company": "Cyberdyne Systems",
"address": "18144 El Camino Real, Sunnyvale, California",
"website": "www.example.com",
"email": "sales@example.com"
},
"items": [
{
"name": "T-800 Prototype Research",
"price": "$1000.00"
},
{
"name": "T-800 Cloud Sync Setup",
"price": "$300.00"
},
{
"name": "Skynet Domain Setup",
"price": "$50.00"
},
{
"name": "T-800 OS License",
"price": "$350.00"
},
{
"name": "T-800 Vision Testing",
"price": "$150.00"
},
],
"discount": "$100.00%",
"tax": "$126.88 (7.5%)",
"total": "$1876.88",
"paid": true,
"note": "Thank you for your business with us.",
"primaryColor": "#E4135A",
"secondaryColor": "#00538B",
"textColor": "#3F4254"
}
And you should set templateData
to the escaped version (use JSON.stringify(object)
or similar)
profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/convert/from/url
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/cloudapi-templates/template-invoice-1.html",
"name": "newInvoice.pdf",
"margins": "5px 5px 5px 5px",
"paperSize": "Letter",
"orientation": "Portrait",
"printBackground": true,
"header": "",
"footer": "",
"async": false,
"encrypt": false,
"templateData": "{\r\n \"invoice\": {\r\n \"id\": \"0021\",\r\n \"date\": \"August 29, 2041\",\r\n \"dateDue\": \"September 29, 2041\"\r\n },\r\n \"issuer\": {\r\n \"name\": \"Sarah Connor\",\r\n \"company\": \"T-800 Research Lab\",\r\n \"address\": \"435 South La Fayette Park Place, Los Angeles, CA 90057\",\r\n \"website\": \"www.example.com\",\r\n \"email\": \"info@example.com\"\r\n },\r\n \"client\": {\r\n \"name\": \"Cyberdyne Systems\",\r\n \"company\": \"Cyberdyne Systems\",\r\n \"address\": \"18144 El Camino Real, Sunnyvale, California\",\r\n \"website\": \"www.example.com\",\r\n \"email\": \"sales@example.com\"\r\n },\r\n \"items\": [\r\n {\r\n \"name\": \"T-800 Prototype Research\",\r\n \"price\": \"$1000.00\"\r\n },\r\n {\r\n \"name\": \"T-800 Cloud Sync Setup\",\r\n \"price\": \"$300.00\"\r\n },\r\n {\r\n \"name\": \"Skynet Domain Setup\",\r\n \"price\": \"$50.00\"\r\n },\r\n {\r\n \"name\": \"T-800 OS License\",\r\n \"price\": \"$350.00\"\r\n },\r\n {\r\n \"name\": \"T-800 Vision Testing\",\r\n \"price\": \"$150.00\"\r\n },\r\n ],\r\n \"discount\": \"$100.00\",\r\n \"tax\": \"$126.88 (7.5%)\",\r\n \"total\": \"$1876.88\",\r\n \"paid\": true,\r\n \"note\": \"Thank you for your business with us.\",\r\n \"primaryColor\": \"#E4135A\",\r\n \"secondaryColor\": \"#00538B\",\r\n \"textColor\": \"#3F4254\"\r\n }"
}
More example Requests/Responses:
I. Example Request: JSON POST (sample invoice template 1) /pdf/convert/from/html
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/cloudapi-templates/template-invoice-1.html",
"name": "newInvoice.pdf",
"margins": "5px 5px 5px 5px",
"paperSize": "Letter",
"orientation": "Portrait",
"printBackground": true,
"header": "",
"footer": "",
"async": false,
"encrypt": false,
"templateData": "{\r\n \"invoice\": {\r\n \"id\": \"0021\",\r\n \"date\": \"August 29, 2041\",\r\n \"dateDue\": \"September 29, 2041\"\r\n },\r\n \"issuer\": {\r\n \"name\": \"Sarah Connor\",\r\n \"company\": \"T-800 Research Lab\",\r\n \"address\": \"435 South La Fayette Park Place, Los Angeles, CA 90057\",\r\n \"website\": \"www.example.com\",\r\n \"email\": \"info@example.com\"\r\n },\r\n \"client\": {\r\n \"name\": \"Cyberdyne Systems\",\r\n \"company\": \"Cyberdyne Systems\",\r\n \"address\": \"18144 El Camino Real, Sunnyvale, California\",\r\n \"website\": \"www.example.com\",\r\n \"email\": \"sales@example.com\"\r\n },\r\n \"items\": [\r\n {\r\n \"name\": \"T-800 Prototype Research\",\r\n \"price\": \"$1000.00\"\r\n },\r\n {\r\n \"name\": \"T-800 Cloud Sync Setup\",\r\n \"price\": \"$300.00\"\r\n },\r\n {\r\n \"name\": \"Skynet Domain Setup\",\r\n \"price\": \"$50.00\"\r\n },\r\n {\r\n \"name\": \"T-800 OS License\",\r\n \"price\": \"$350.00\"\r\n },\r\n {\r\n \"name\": \"T-800 Vision Testing\",\r\n \"price\": \"$150.00\"\r\n },\r\n ],\r\n \"discount\": \"$100.00\",\r\n \"tax\": \"$126.88 (7.5%)\",\r\n \"total\": \"$1876.88\",\r\n \"paid\": true,\r\n \"note\": \"Thank you for your business with us.\",\r\n \"primaryColor\": \"#E4135A\",\r\n \"secondaryColor\": \"#00538B\",\r\n \"textColor\": \"#3F4254\"\r\n }"
}
I. Example Response: JSON POST (sample invoice template 1) /pdf/convert/from/html
{
"url": "https://pdf-temp-files.s3.amazonaws.com/81329c3acdbe430092c76f1cec8e0fa8/newInvoice.pdf",
"pageCount": 1,
"error": false,
"status": 200,
"name": "newInvoice.pdf",
"remainingCredits": 60074
}
Status Code: 200
3. /pdf/convert/from/url (invoice template 2)
Generate PDF from HTML templates (Mustache and Handlebars template styles are supported). Input Parameters
url
required. Url to HTML template. Mustache and Handlebars templates are supported. You can pass link to file from Google Drive, Dropbox or another online file service that can generate shareable links. You can also use built-in PDF.co cloud storage located at https://app.pdf.co/files or upload your file as temporary file right before making this API call (seeUpload and Manage Files
section for more details on uploading files via API).margins
optional. set to css style margins like10 px
or5px 5px 5px 5px
paperSize
optional. Can beLetter
,A4
,A5
,A6
or custom size like200x200
orientation
optional. set toPortrait
orLandscape
.Portrait
by default.printBackground
optional.true
by default. Set tofalse
to disbale printing of background.header
optional. Set to HTML for header to be applied on every page at the header.footer
optional. Set to HTML for footer to be applied on every page at the bottom.async
optional. Set totrue
to run as async job in background (recommended for heavy documents).templateData
optional. Set to string with JSON data for template if your HTML is a template (Handlebars & Mustache style).
Example of JSON for template data:
{
"invoice": {
"id": "0021",
"date": "August 29, 2041",
"dateDue": "September 29, 2041"
},
"issuer": {
"name": "Sarah Connor",
"company": "T-800 Research Lab",
"address": "435 South La Fayette Park Place, Los Angeles, CA 90057",
"website": "www.example.com",
"email": "info@example.com"
},
"client": {
"name": "Cyberdyne Systems",
"company": "Cyberdyne Systems",
"address": "18144 El Camino Real, Sunnyvale, California",
"website": "www.example.com",
"email": "sales@example.com"
},
"items": [
{
"name": "T-800 Prototype Research",
"price": "$1000.00"
},
{
"name": "T-800 Cloud Sync Setup",
"price": "$300.00"
},
{
"name": "Skynet Domain Setup",
"price": "$50.00"
},
{
"name": "T-800 OS License",
"price": "$350.00"
},
{
"name": "T-800 Vision Testing",
"price": "$150.00"
},
],
"discount": "$100.00%",
"tax": "$126.88 (7.5%)",
"total": "$1876.88",
"paid": true,
"note": "Thank you for your business with us.",
"primaryColor": "#E4135A",
"secondaryColor": "#00538B",
"textColor": "#3F4254"
}
And you should set templateData
to the escaped version (use JSON.stringify(object)
or similar)
profiles
optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.
Endpoint:
Method: POST
Type: RAW
URL: https://api.pdf.co/v1/pdf/convert/from/url
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/cloudapi-templates/template-invoice-2.html",
"name": "newInvoice.pdf",
"margins": "5px 5px 5px 5px",
"paperSize": "Letter",
"orientation": "Portrait",
"printBackground": true,
"header": "",
"footer": "",
"async": false,
"encrypt": false,
"templateData": "{\r\n \"invoice\": {\r\n \"id\": \"0021\",\r\n \"date\": \"August 29, 2041\",\r\n \"dateDue\": \"September 29, 2041\"\r\n },\r\n \"issuer\": {\r\n \"name\": \"Sarah Connor\",\r\n \"company\": \"T-800 Research Lab\",\r\n \"address\": \"435 South La Fayette Park Place, Los Angeles, CA 90057\",\r\n \"website\": \"www.example.com\",\r\n \"email\": \"info@example.com\"\r\n },\r\n \"client\": {\r\n \"name\": \"Cyberdyne Systems\",\r\n \"company\": \"Cyberdyne Systems\",\r\n \"address\": \"18144 El Camino Real, Sunnyvale, California\",\r\n \"website\": \"www.example.com\",\r\n \"email\": \"sales@example.com\"\r\n },\r\n \"items\": [\r\n {\r\n \"name\": \"T-800 Prototype Research\",\r\n \"price\": \"$1000.00\"\r\n },\r\n {\r\n \"name\": \"T-800 Cloud Sync Setup\",\r\n \"price\": \"$300.00\"\r\n },\r\n {\r\n \"name\": \"Skynet Domain Setup\",\r\n \"price\": \"$50.00\"\r\n },\r\n {\r\n \"name\": \"T-800 OS License\",\r\n \"price\": \"$350.00\"\r\n },\r\n {\r\n \"name\": \"T-800 Vision Testing\",\r\n \"price\": \"$150.00\"\r\n },\r\n ],\r\n \"discount\": \"$100.00%\",\r\n \"tax\": \"$126.88 (7.5%)\",\r\n \"total\": \"$1876.88\",\r\n \"paid\": true,\r\n \"note\": \"Thank you for your business with us.\",\r\n \"primaryColor\": \"#E4135A\",\r\n \"secondaryColor\": \"#00538B\",\r\n \"textColor\": \"#3F4254\"\r\n }"
}
More example Requests/Responses:
I. Example Request: JSON POST (sample invoice template 2) /pdf/convert/from/url
Headers:
Key | Value | Description |
---|---|---|
x-api-key | {{x-api-key}} | Required. API key for PDF.co. Get yours at https://pdf.co/ |
Content-Type | application/json |
Body:
{
"url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/cloudapi-templates/template-invoice-2.html",
"name": "newInvoice.pdf",
"margins": "5px 5px 5px 5px",
"paperSize": "Letter",
"orientation": "Portrait",
"printBackground": true,
"header": "",
"footer": "",
"async": false,
"encrypt": false,
"templateData": "{\r\n \"invoice\": {\r\n \"id\": \"0021\",\r\n \"date\": \"August 29, 2041\",\r\n \"dateDue\": \"September 29, 2041\"\r\n },\r\n \"issuer\": {\r\n \"name\": \"Sarah Connor\",\r\n \"company\": \"T-800 Research Lab\",\r\n \"address\": \"435 South La Fayette Park Place, Los Angeles, CA 90057\",\r\n \"website\": \"www.example.com\",\r\n \"email\": \"info@example.com\"\r\n },\r\n \"client\": {\r\n \"name\": \"Cyberdyne Systems\",\r\n \"company\": \"Cyberdyne Systems\",\r\n \"address\": \"18144 El Camino Real, Sunnyvale, California\",\r\n \"website\": \"www.example.com\",\r\n \"email\": \"sales@example.com\"\r\n },\r\n \"items\": [\r\n {\r\n \"name\": \"T-800 Prototype Research\",\r\n \"price\": \"$1000.00\"\r\n },\r\n {\r\n \"name\": \"T-800 Cloud Sync Setup\",\r\n \"price\": \"$300.00\"\r\n },\r\n {\r\n \"name\": \"Skynet Domain Setup\",\r\n \"price\": \"$50.00\"\r\n },\r\n {\r\n \"name\": \"T-800 OS License\",\r\n \"price\": \"$350.00\"\r\n },\r\n {\r\n \"name\": \"T-800 Vision Testing\",\r\n \"price\": \"$150.00\"\r\n },\r\n ],\r\n \"discount\": \"$100.00%\",\r\n \"tax\": \"$126.88 (7.5%)\",\r\n \"total\": \"$1876.88\",\r\n \"paid\": true,\r\n \"note\": \"Thank you for your business with us.\",\r\n \"primaryColor\": \"#E4135A\",\r\n \"