Link Search Menu Expand Document

Misc Account Info And Misc

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

CodeDescription
200The request has succeeded
400bad input parameters
401unauthorized
403not enough credits
405Timeout 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.

Available methods

[GET] /account/credit/balance

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

CodeDescription
200The request has succeeded
400bad input parameters
401unauthorized
403not enough credits
405Timeout 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"
}

Description

  • Method: GET
  • URL: /v1/account/credit/balance

Query parameters

No query parameters accepted.

Body payload

No body parameters accepted.

Example responses

/account/credit/balance
{
    "remainingCredits": 99795868
}

Code Snippet

CURL
curl --location --request GET 'https://api.pdf.co/v1/account/credit/balance' \
--header 'x-api-key: '

[GET] /license/info (on-prem API Server only)

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

CodeDescription
200The request has succeeded
400bad input parameters
401unauthorized
403not enough credits
405Timeout 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"
}

Description

  • Method: GET
  • URL: /license/info

Query parameters

No query parameters accepted.

Body payload

No body parameters accepted.

Example responses

/license/info (on-prem API Server only)
{
    "body": {
        "modules": [
            {
                "moduleName": "PDFExtractor",
                "enabled": true,
                "licenseInfo": {
                    "LicenseType": "Commercial",
                    "UpdatesExpireOn": "Never",
                    "LimitType": "Unlimited",
                    "LimitTerm": "None",
                    "Limit": -1,
                    "Remainder": -1
                }
            },
            {
                "moduleName": "PDFToHTML",
                "enabled": true,
                "licenseInfo": {
                    "LicenseType": "Commercial",
                    "UpdatesExpireOn": "Never",
                    "LimitType": "Unlimited",
                    "LimitTerm": "None",
                    "Limit": -1,
                    "Remainder": -1
                }
            },
            {
                "moduleName": "PDFGenerator",
                "enabled": true,
                "licenseInfo": {
                    "LicenseType": "Commercial",
                    "UpdatesExpireOn": "Never",
                    "LimitType": "Unlimited",
                    "LimitTerm": "None",
                    "Limit": -1,
                    "Remainder": -1
                }
            },
            {
                "moduleName": "BarcodeGenerator",
                "enabled": true,
                "licenseInfo": {
                    "LicenseType": "Commercial",
                    "UpdatesExpireOn": "Never",
                    "LimitType": "Unlimited",
                    "LimitTerm": "None",
                    "Limit": -1,
                    "Remainder": -1
                }
            },
            {
                "moduleName": "BarcodeReader",
                "enabled": true,
                "licenseInfo": {
                    "LicenseType": "Commercial",
                    "UpdatesExpireOn": "Never",
                    "LimitType": "Unlimited",
                    "LimitTerm": "None",
                    "Limit": -1,
                    "Remainder": -1
                }
            },
            {
                "moduleName": "PDFRenderer",
                "enabled": true,
                "licenseInfo": {
                    "LicenseType": "Commercial",
                    "UpdatesExpireOn": "Never",
                    "LimitType": "Unlimited",
                    "LimitTerm": "None",
                    "Limit": -1,
                    "Remainder": -1
                }
            },
            {
                "moduleName": "Spreadsheet",
                "enabled": true,
                "licenseInfo": {
                    "LicenseType": "Commercial",
                    "UpdatesExpireOn": "Never",
                    "LimitType": "Unlimited",
                    "LimitTerm": "None",
                    "Limit": -1,
                    "Remainder": -1
                }
            },
            {
                "moduleName": "DocumentParser",
                "enabled": true,
                "licenseInfo": {
                    "LicenseType": "Commercial",
                    "UpdatesExpireOn": "Never",
                    "LimitType": "Unlimited",
                    "LimitTerm": "None",
                    "Limit": -1,
                    "Remainder": -1
                }
            },
            {
                "moduleName": "TextRecognition",
                "enabled": true,
                "licenseInfo": {
                    "LicenseType": "Commercial",
                    "UpdatesExpireOn": "Never",
                    "LimitType": "Unlimited",
                    "LimitTerm": "None",
                    "Limit": -1,
                    "Remainder": -1
                }
            }
        ]
    },
    "pageCount": 0,
    "error": false,
    "status": 200
}

Code Snippet

CURL
curl --location --request GET 'localhost:8080/license/info'