Link Search Menu Expand Document

PDF Make Text Searchable or Unsearchable

Explore Samples

These methods helps to turn PDF and scanned JPG, PNG images into text-searchable PDF. MakeUnSearchable method is doing the opposite: converts PDF document into a “scanned” pdf document is it was printed and then scanned back.

Available Methods

[POST] /pdf/makesearchable (Scanned PDF to Text Searchable PDF)

This method converts scanned PDF documents (where pages are fully or partially made from scanned images) into a text-searchable pdf. It runs OCR and adds an invisible text layer on top of your document that can be used for text search, text indexing etc.

Attributes
url required
URL to the source file. Supports links from Google Drive, Dropbox, and PDF.co built-in files storage. To upload files via API, Check out the Files Upload section.

Note: If you experience intermittent Too Many Requests or Access Denied errors, please try to add cache: to enable built-in URL caching. (e.g cache:https://example.com/file1.pdf)

For data security, you have the option to encrypt output files and decrypt input files. Learn more about user-controlled data encryption.
httpusername optional
HTTP auth user name if required to access source url.
httppassword optional
HTTP auth password if required to access source url.
lang optional
Set the language for OCR (text from image) to use for scanned PDF, PNG, and JPG documents input when extracting text.
The default is “eng”. Other languages are also supported: deu, spa, chi_sim, jpn, and many others (full list of supported OCR languages is here.
You can also use 2 languages simultaneously like this: eng+deu or jpn+kor (any combination).
password optional
Password of PDF file, The input must be in string format.
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 the 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, The input must be in string format.
async optional
Set async to true for long processes to run in the background, API will then return a jobId which you can use with /job/check endpoint to check the status of the process and retrieve the output while you can proceed with other tasks without waiting for this process to finish.
IMPORTANT: Also set the inline param to true to get a direct link to the final output pdf in both sync and async modes. Otherwise, you will be getting a direct link to pdf in sync mode but also a link to the .json file in the async mode.
profiles optional
Use this parameter to set additional configurations for fine-tuning and extra options. Explore PDF.co knowledgebase for profile examples, The input must be in string format.
  • Method: POST
  • URL: /v1/pdf/makesearchable

Query parameters

No query parameters accepted.

Body payload

{
    "url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-make-searchable/sample.pdf",
    "lang": "eng",
    "pages": "",
    "name": "result.pdf",    
    "password": "",
    "async": "false",
    "profiles": ""
}

Example responses

/pdf/makesearchable (Scanned PDF to Text Searchable PDF)
{
    "url": "https://pdf-temp-files.s3.amazonaws.com/a0d52f35504e47148d1771fce875db7b/result.pdf",
    "pageCount": 1,
    "error": false,
    "status": 200,
    "name": "result.pdf",
    "remainingCredits": 99033681,
    "credits": 35
}

Code Snippet

CURL
curl --location --request POST 'https://api.pdf.co/v1/pdf/makesearchable' \
--header 'x-api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
    "url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-make-searchable/sample.pdf",
    "lang": "eng",
    "pages": "",
    "name": "result.pdf",    
    "password": "",
    "async": "false",
    "profiles": ""
}'

[POST] /pdf/makesearchable (PNG to Text Searchable PDF)

This method converts scanned PDF documents (where pages are fully or partially made from scanned images) into a text-searchable pdf. It runs OCR and adds an invisible text layer on top of your document that can be used for text search, text indexing, etc.

Attributes
url required
URL to the source file. Supports links from Google Drive, Dropbox, and PDF.co built-in files storage. To upload files via API, Check out the Files Upload section.

Note: If you experience intermittent Too Many Requests or Access Denied errors, please try to add cache: to enable built-in URL caching. (e.g cache:https://example.com/file1.pdf)

For data security, you have the option to encrypt output files and decrypt input files. Learn more about user-controlled data encryption.
httpusername optional
HTTP auth user name if required to access source url.
httppassword optional
HTTP auth password if required to access source url.
lang optional
Set the language for OCR (text from image) to use for scanned PDF, PNG, and JPG documents input when extracting text.
The default is “eng”. Other languages are also supported: deu, spa, chi_sim, jpn, and many others (full list of supported OCR languages is here.
You can also use 2 languages simultaneously like this: eng+deu or jpn+kor (any combination).
password optional
Password of PDF file, The input must be in string format.
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 the 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, The input must be in string format., The input must be in string format.
async optional
Set async to true for long processes to run in the background, API will then return a jobId which you can use with /job/check endpoint to check the status of the process and retrieve the output while you can proceed with other tasks without waiting for this process to finish.
IMPORTANT: Also set the inline param to true to get a direct link to the final output pdf in both sync and async modes. Otherwise, you will be getting a direct link to pdf in sync mode but also a link to the .json file in the async mode.
profiles optional
Use this parameter to set additional configurations for fine-tuning and extra options. Explore PDF.co knowledgebase for profile examples, The input must be in string format.
  • Method: POST
  • URL: /v1/pdf/makesearchable

Query parameters

No query parameters accepted.

Body payload

{
    "url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/image-to-pdf/image1.png",
    "lang": "eng",
    "pages": "",
    "name": "result.pdf",    
    "password": "",
    "async": "false",
    "profiles": ""
}

Example responses

/pdf/makesearchable (PNG to Text Searchable PDF)
{
    "url": "https://pdf-temp-files.s3.amazonaws.com/cd2613bd41d44e81b3f989bf25c69bf3/result.pdf",
    "pageCount": 1,
    "error": false,
    "status": 200,
    "name": "result.pdf",
    "remainingCredits": 99078416,
    "credits": 35
}

Code Snippet

CURL
curl --location --request POST 'https://api.pdf.co/v1/pdf/makesearchable' \
--header 'x-api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
    "url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/image-to-pdf/image1.png",
    "lang": "eng",
    "pages": "",
    "name": "result.pdf",    
    "password": "",
    "async": "false",
    "profiles": ""
}'

[POST] /pdf/makesearchable (JPG to Text Searchable PDF)

This method converts scanned PDF documents (where pages are fully or partially made from scanned images) into a text-searchable pdf. It runs OCR and adds an invisible text layer on top of your document that can be used for text search, text indexing, etc.

Attributes
url required
URL to the source file. Supports links from Google Drive, Dropbox, and PDF.co built-in files storage. To upload files via API, Check out the Files Upload section.

Note: If you experience intermittent Too Many Requests or Access Denied errors, please try to add cache: to enable built-in URL caching. (e.g cache:https://example.com/file1.pdf)

For data security, you have the option to encrypt output files and decrypt input files. Learn more about user-controlled data encryption.
httpusername optional
HTTP auth user name if required to access source url.
httppassword optional
HTTP auth password if required to access source url.
lang optional
Set the language for OCR (text from image) to use for scanned PDF, PNG, and JPG documents input when extracting text.
The default is “eng”. Other languages are also supported: deu, spa, chi_sim, jpn, and many others (full list of supported OCR languages is here.
You can also use 2 languages simultaneously like this: eng+deu or jpn+kor (any combination).
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 the 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, The input must be in string format.
password optional
Password of PDF file, The input must be in string format.
async optional
Set async to true for long processes to run in the background, API will then return a jobId which you can use with /job/check endpoint to check the status of the process and retrieve the output while you can proceed with other tasks without waiting for this process to finish.
IMPORTANT: Also set the inline param to true to get a direct link to the final output pdf in both sync and async modes. Otherwise, you will be getting a direct link to pdf in sync mode but also a link to the .json file in the async mode.
name optional
File name for the generated output, The input must be in string format.
expiration optional
Set the expiration time for the output link in minutes (default is 60 i.e 60 minutes or 1 hour), After this specified duration, any generated output file(s) will be automatically deleted from PDF.co temporary files storage. The maximum duration for link expiration varies based on your current subscription plan. Learn more

To store permanent input files (e.g. re-usable images, pdf templates, documents), Consider using PDF.co built-in Files Storage.
profiles optional
Use this parameter to set additional configurations for fine-tuning and extra options. Explore PDF.co knowledgebase for profile examples, The input must be in string format.
  • Method: POST
  • URL: /v1/pdf/makesearchable

Query parameters

No query parameters accepted.

Body payload

{
    "url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/image-to-pdf/image2.jpg",
    "lang": "eng",
    "pages": "",
    "name": "result.pdf",    
    "password": "",
    "async": "false",
    "profiles": ""
}

Example responses

/pdf/makesearchable (JPG to Text Searchable PDF)
{
    "url": "https://pdf-temp-files.s3.amazonaws.com/26ef98ed86ff4a27a3c840ab7785e25a/result.pdf",
    "pageCount": 1,
    "error": false,
    "status": 200,
    "name": "result.pdf",
    "remainingCredits": 99078346,
    "credits": 35
}

Code Snippet

CURL
curl --location --request POST 'https://api.pdf.co/v1/pdf/makesearchable' \
--header 'x-api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
    "url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/image-to-pdf/image2.jpg",
    "lang": "eng",
    "pages": "",
    "name": "result.pdf",    
    "password": "",
    "async": "false",
    "profiles": ""
}'

[POST] /pdf/makesearchable (TIF to Text Searchable PDF)

This method converts scanned PDF documents (where pages are fully or partially made from scanned images) into a text-searchable pdf. It runs OCR and adds an invisible text layer on top of your document that can be used for text search, text indexing, etc.

Attributes
url required
URL to the source file. Supports links from Google Drive, Dropbox, and PDF.co built-in files storage. To upload files via API, Check out the Files Upload section.

Note: If you experience intermittent Too Many Requests or Access Denied errors, please try to add cache: to enable built-in URL caching. (e.g cache:https://example.com/file1.pdf)

For data security, you have the option to encrypt output files and decrypt input files. Learn more about user-controlled data encryption.
httpusername optional
HTTP auth user name if required to access source url.
httppassword optional
HTTP auth password if required to access source url.
lang optional
Set the language for OCR (text from image) to use for scanned PDF, PNG, and JPG documents input when extracting text.
The default is “eng”. Other languages are also supported: deu, spa, chi_sim, jpn, and many others (full list of supported OCR languages is here.
You can also use 2 languages simultaneously like this: eng+deu or jpn+kor (any combination).
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 the 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, The input must be in string format.
password optional
Password of PDF file, The input must be in string format.
async optional
Set async to true for long processes to run in the background, API will then return a jobId which you can use with /job/check endpoint to check the status of the process and retrieve the output while you can proceed with other tasks without waiting for this process to finish.
IMPORTANT: Also set the inline param to true to get a direct link to the final output pdf in both sync and async modes. Otherwise, you will be getting a direct link to pdf in sync mode but also a link to the .json file in the async mode.
name optional
File name for the generated output, The input must be in string format.
expiration optional
Set the expiration time for the output link in minutes (default is 60 i.e 60 minutes or 1 hour), After this specified duration, any generated output file(s) will be automatically deleted from PDF.co temporary files storage. The maximum duration for link expiration varies based on your current subscription plan. Learn more

To store permanent input files (e.g. re-usable images, pdf templates, documents), Consider using PDF.co built-in Files Storage.
profiles optional
Use this parameter to set additional configurations for fine-tuning and extra options. Explore PDF.co knowledgebase for profile examples, The input must be in string format.
  • Method: POST
  • URL: /v1/pdf/makesearchable

Query parameters

No query parameters accepted.

Body payload

{
    "url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/image-to-pdf/image2.jpg",
    "lang": "eng",
    "pages": "",
    "name": "result.pdf",    
    "password": "",
    "async": "false",
    "profiles": ""
}

Example responses

/pdf/makesearchable (TIF to Text Searchable PDF)
{
    "url": "https://pdf-temp-files.s3.amazonaws.com/d5a27d3d1e9a4ef7be31f513a95cef7b/result.pdf",
    "pageCount": 1,
    "error": false,
    "status": 200,
    "name": "result.pdf",
    "remainingCredits": 99078311,
    "credits": 35
}

Code Snippet

CURL
curl --location --request POST 'https://api.pdf.co/v1/pdf/makesearchable' \
--header 'x-api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
    "url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/image-to-pdf/image2.jpg",
    "lang": "eng",
    "pages": "",
    "name": "result.pdf",    
    "password": "",
    "async": "false",
    "profiles": ""
}'

[POST] /pdf/makeunsearchable (PDF to Scanned PDF)

This method converts PDF files into “text unsearchable” pdf which are the same as if you printed and then scanned your PDF. In other words, this method converts your pdf into a “scanned” pdf file where everything is turned into an image.

Attributes
url required
URL to the source file. Supports links from Google Drive, Dropbox, and PDF.co built-in files storage. To upload files via API, Check out the Files Upload section.

Note: If you experience intermittent Too Many Requests or Access Denied errors, please try to add cache: to enable built-in URL caching. (e.g cache:https://example.com/file1.pdf)

For data security, you have the option to encrypt output files and decrypt input files. Learn more about user-controlled data encryption.
httpusername optional
HTTP auth user name if required to access source url.
httppassword optional
HTTP auth password if required to access source url.
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 the 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, The input must be in string format.
password optional
Password of PDF file, The input must be in string format.
async optional
Set async to true for long processes to run in the background, API will then return a jobId which you can use with /job/check endpoint to check the status of the process and retrieve the output while you can proceed with other tasks without waiting for this process to finish.
name optional
File name for the generated output, The input must be in string format.
expiration optional
Set the expiration time for the output link in minutes (default is 60 i.e 60 minutes or 1 hour), After this specified duration, any generated output file(s) will be automatically deleted from PDF.co temporary files storage. The maximum duration for link expiration varies based on your current subscription plan. Learn more

To store permanent input files (e.g. re-usable images, pdf templates, documents), Consider using PDF.co built-in Files Storage.
profiles optional
Use this parameter to set additional configurations for fine-tuning and extra options. Explore PDF.co knowledgebase for profile examples, The input must be in string format.
  • Method: POST
  • URL: /v1/pdf/makeunsearchable

Query parameters

No query parameters accepted.

Body payload

{
    "url": "pdfco-test-files.s3.us-west-2.amazonaws.compdf-to-text/sample.pdf",
    "pages": "",
    "name": "result.pdf",    
    "password": "",
    "async": "false",
    "profiles": ""
}

Example responses

/pdf/makeunsearchable (PDF to Scanned PDF)
{
    "url": "https://pdf-temp-files.s3.amazonaws.com/6b755238963a472abf67fd5e7ffafd79/result.pdf",
    "pageCount": 1,
    "error": false,
    "status": 200,
    "name": "result.pdf",
    "remainingCredits": 327244,
    "credits": 35
}

Code Snippet

CURL
curl --location --request POST 'https://api.pdf.co/v1/pdf/makeunsearchable' \
--header 'x-api-key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
    "url": "pdfco-test-files.s3.us-west-2.amazonaws.compdf-to-text/sample.pdf",
    "pages": "",
    "name": "result.pdf",    
    "password": "",
    "async": "false",
    "profiles": ""
}'

Samples