Common Errors#

Access Denied or Too Many Requests#

First, make sure that your url is accessible.

If it requires username and password then set them accordingly in httpUsername and httpPassword parameters and try again.

If you use Google Docs/Google Drive, make sure that the link to a file or a document is not requiring login. Try to copy the link and open it in Incognito Mode in the browser to see whether it opens as expected.

If you are getting Too Many Requests (or sometimes Access Denied from Google Drive/Docs/Sheets), then try to add caching for the input file. To enable caching please insert cache: before the link.

Example:

  • Without caching: https://example.com/file1.pdf

  • With caching: cache:[https://example.com/file1.pdf](https://example.com/file1.pdf)

NOTE: Caching will not fetch the original file but will cache it in PDF.co and reuse the file for the next 24 hours without making a request to the original url.

ECONNREFUSED error#

An error message containing ECONNREFUSED represents a connection problem. This error is rare, as we have taken measures such as increasing server scalability.

If the error ECONNREFUSED is occurring frequently, you should implement 2-3 retries in your code. The connection error may also be caused by your ISP, temporary issues with routers and many other things. TCP/IP connection is not guaranteed, so any temporary issues with the local ISP, routers, DNS providers may affect connectivity. Zapier and Make have built-in retries.

Error 400 bad request#

The error 400 means incorrect parameters. Please go to your API Logs for more information on which request and what is causing the error https://app.pdf.co/account/logs/api.

Feel free to contact our support team at support@bytescout.com if you need help in troubleshooting. Please enable access to your API Logs so our developers can review them.

Error 403, Can’t download file, Input document is damaged, or Login page is converted instead of the file content#

Applies to the following errors:

  • Error 403

  • Can’t download file

  • Input document is damaged or of incorrect type

  • See a login page instead of the file content

  • Invalid url

If you get any of the error messages above, here are some ways to resolve them:

  1. Check input link to make sure it is publicly accessible. The PDF.co API engine requires the source file to be publicly accessible in order to process it. If you are using Google Drive, Dropbox or similar cloud storage services, change the file permission to Anyone with the link to make it public.

  2. Check input file to make sure it is the correct file format. An incompatible source file type can result in input document is damaged or of incorrect type errors. For example, if you are merging PDF and non-PDF files, please use the correct PDF Merger endpoint.

  3. Add the cache: prefix. Frequent access to a file may result in restricted access by services like Google, Dropbox and similar. Try to add cache: before the URL to resolve the problem. The new URL will look like this: cache:[https://url.com/randomurl.](https://url.com/randomurl.)

  4. Check input link to make sure it is valid. If an incorrect or incompatible link is passed to the API, it will result in an Invalid url error.

If the above steps do not resolve the issue, please enable access to your API Logs and reach out to our support team at support@bytescout.com for assistance. To grant our support team access to your API Logs, refer to this guide: https://pdf.co/enable-api-logs-access.

Error 448 webpage not found#

The error response 448 represents an invalid input URL. This error is mostly observed in the url to pdf endpoint when the input URL is invalid or not accessible.

For example, when pdf from url is executed with the invalid URL https://abcdefabcdef/testing it will return an error.

Request:

curl --location --request POST 'https://api.pdf.co/v1/pdf/convert/from/url' \
--header 'x-api-key: YOUR_PDFCO_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"url": "https://abcdefabcdef/testing"
}'

Response:

{
    "error": true,
    "status": 448,
    "message": "Web page not found",
    "credits": 0,
    "duration": 8133,
    "errorCode": 448
}

Fatal error: Uncaught ValueError: Path cannot be empty#

When you get the error message Fatal error: Uncaught ValueError: Path cannot be empty, please apply the following changes to the php.ini file and the html file.

Modify the php.ini file with the following.

max_execution_time=300
memory_limit=1024M
post_max_size=4000M
upload_max_filesize=4000M

And in the HTML file modify "MAX_FILE_SIZE" to the following.

<input type="hidden" name="MAX_FILE_SIZE" value="8000000000"/>

Google Docs or Google Drive error with Too Many Requests, Access Denied, or Can’t download file#

Sometimes if you use Google Drive, Google Docs, Google Sheets, Dropbox, or similar free cloud storage services to store your input files, you may receive Too Many Requests, Access Denied or Can't download file errors after previously successful calls. Cloud services are throttling requests to prevent frequent access to their files by using this type of protection. Paid plans like Google Workspace provide better support for frequent access, but still throttle all incoming requests.

To solve this issue, PDF.co can use its built-in secure input url cache. Just add the cache: prefix to your input url to enable caching.

For example: cache:[https://example.com/file.pdf](https://example.com/file.pdf)

This will tell PDF.co to cache the file from the url for 24 hours. Instead of re-requesting your url every time, it will use its cached version. This will prevent the Too Many Requests error.

As an alternative, you can store your input files in our built-in file storage, which was specifically designed for providing an alternative and more reliable way to store files for re-use in PDF.co. It is available at https://app.pdf.co/files. You can upload your file and copy the special link to it (so called token), that looks like filetoken://12345… This type of link can be used from the PDF.co platform only.

To learn more about PDF.co built-in file storage, please visit this page https://pdf.co/how-to-use-file-storage-on-pdfco.

Applies to the following errors:

  • error 403

  • can't download file

  • too many requests

  • access denied

Google Drive Source File Error 442#

The error message Error 442 or input document is damaged occurs in two scenarios: (1) when the source file is not in the expected file format, or (2) when the file is prevented from being downloaded. In the first scenario, please verify whether you are using the supported file format. In the second scenario, this issue often arises when a Google Drive file cannot undergo virus scanning. This keeps the PDF.co engine from accessing the actual file.

Error 442

To verify whether this applies to your file, please use the following link format and replace file_id with your actual file ID:

https://drive.google.com/uc?id=file_id&export=download

To resolve this issue, you have two options: either use a Google API Key or an authorization access token from Google OAuth.

Below, you will find a step-by-step guide on generating your Google API Key:

Important: To ensure the security of your Google API Key within PDF.co, follow these instructions to enable Strict Mode for API Logs: https://app.pdf.co/account/logs/api. Enabling Strict Mode will conceal the source file URL, which contains your Google API Key. It is recommended to enable Strict Mode whenever sensitive data, such as a Google API Key, is present in the source file URL.

  1. Start by creating a Project at https://console.cloud.google.com.

  2. Navigate to the “APIs & Services” section.

  3. Click on “Enabled APIs and Services” option.

  4. Click on “+ Enable APIs and Services.”

  5. Search for the Google Drive API.

  6. Enable the Google Drive API.

  7. Go to the “Credentials” section.

  8. Click on “+ Create Credentials.”

  9. Choose “API Key.”

  10. After creating your API Key, hover over the warning icon next to its name and click on “Edit Settings.”

  11. Configure your API Restrictions. For this demo, select the “Restrict API” radio button and choose the Google Drive API. Please setup the restrictions according to your needs. You may also contact Google Support for assistance.

  12. Click “Save.”

You are now prepared to use your Google API Key. Copy the following URL format and replace file_id with your actual file ID, and api_key with your Google API Key. Use this modified URL as your source file link, allowing you to download the previously blocked file:

https://www.googleapis.com/drive/v3/files/file_id/?key=api_key&alt=media

NOTE: Please reach out to Google Support for guidance on how to ensure the security of your Google API Key.

To use the authorization access token from Google OAuth instead of the Google API Key, please start here https://developers.google.com/identity/protocols/oauth2.

Make maximum number of repeats exceeded#

This error originates from Make.com. Make.com has a 5-minute limitation for every module on their platform.

To fix this issue, you need to add a delay and another step to check the job status. Set a delay time that best suits the time it needs to process the job.

NoSuchKey The specified key does not exist error#

If you enable async mode and attempt to access the output while the job is still processing, you may encounter the NoSuchKey error indicating that the specified key does not exist.

To resolve this issue, include a background job check in your code to monitor the job status. You can find our code samples in managing background jobs here.

Or you can also use our code samples which include async and background job checks here.

Postman Collection

If you are using Postman Collection and have set async to true, the result will provide a jobId. Use this jobId to check the job status through the Background Jobs Check available in the Postman collection.

For further details regarding background job checks, please refer to our API Docs.

Zapier/Make

Automation solutions like Zapier and Make have a timeout limit of 30 seconds to 5 minutes. However, we can overcome this limitation by introducing a delay in your workflow. By introducing a delay in your workflow, you can prevent the timeout error and effectively process large files using automation solutions.

PHP - Peer certificate cannot be authenticated#

The Peer certificate cannot be authenticated error appears because SSL certificates or libraries on the computer need to be updated.

To update, run in PHP:

composer update

For more information and other solutions for this issue please explore https://stackoverflow.com/search?q=peer+certificate+cannot+be+authenticated+%5Bphp%5D.

SSL Certificate error unable to get local issuer certificate issue in PHP#

(PHP language): SSL certificate error: unable to get local issuer certificate. To resolve this issue, please try this solution on Stackoverflow.

Salesforce Apex Error 442#

If you attempt to use a file hosted in Salesforce but receive error 442, it could mean that the file url is sending our API a file that is not compatible with the expected file format.

Please refer to this article to get the direct download link: https://salesforce.stackexchange.com/questions/369497/how-to-derive-a-direct-link-to-a-file-from-the-link-to-the-download-page.

If it doesn’t resolve the issue, please contact our support team at support@bytescout.com.

Status errors returned by PDF.co#

API returns https status but also returns JSON that includes status parameter indicating error.

Status value

Description

200

The request has succeeded

400

Bad input parameters

401

Unauthorized

402

Not enough credits

403

Forbidden (source file or url is not accessible)

408

Timeout error. To process large documents or files please use asynchronous mode ( set async parameter to true) and then check the status using Background Job Check endpoint. If the file contains many pages then specify a range using the pages parameter. The number of pages of the document can be obtained using the endpoint PDF Info Reader

Note

Don’t forget to set x-api-key url param or http header param (preferred) to your API key. Get your API key here.

Timeout service is temporarily unavailable#

For Zapier and Make Users

If you are experiencing a connectivity issue, please add the replay functionality to your workflow. This can be set up to retry the failed step manually or automatically.

For Zapier, please visit this guide https://zapier.com/help/manage/history/replay-failed-zap-runs.

As of this writing, Make does not offer a similar error handling directive, but suggests workarounds that can mimic its functionality: https://www.make.com/en/help/errors/retry.