Link Search Menu Expand Document

PDF Make Text Searchable or Unsearchable

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

Go To Samples

[POST] /pdf/makesearchable

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 invisible text layer on top of your document that can be used for text search, text indexing etc.

  • 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. If you are randomly getting Too Many Requests or Access Denied error for your input url, please try to add cache: to enable built-in url caching.
  • httpusername (optinal) - http auth user name if required to access source url.
  • httppassword (optinal) - http auth password if required to access source url.
  • lang optional. Sets language for OCR (text from image) to use for scanned PDF, PNG, JPG documents input when extracting text. 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 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.
  • password optional. Password of PDF file. Must be a String.
  • 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 and success). 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.
  • expiration (optional). Output link expiration in minutes. Default is 60 (i.e. 60 minutes or 1 hour). After this delay generated output file(s) (if any) will be auto-removed from PDF.co temporary files storage. Max allowed expiration period depends on your current subscription plan. To store permanent input files (e.g. re-usable images, pdf, documents), please use PDF.co built-in Files Storage instead.
  • 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.

Description

  • Method: POST
  • URL: /v1/pdf/makesearchable

Query parameters

No query parameters accepted.

Body payload

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

Example responses

/pdf/makesearchable
{
    "url": "https://pdf-temp-files.s3.amazonaws.com/94628af2d2fd4621aad039f2d0701d66/result.pdf",
    "pageCount": 1,
    "error": false,
    "status": 200,
    "name": "result.pdf",
    "remainingCredits": 60607
}

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://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-make-searchable/sample.pdf",
    "lang": "eng",
    "pages": "",
    "name": "result.pdf",    
    "password": "",
    "async": "false",
    "encrypt": false,
    "profiles": ""
}'

[POST] /pdf/makeunsearchable

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.

  • 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. If you are randomly getting Too Many Requests or Access Denied error for your input url, please try to add cache: to enable built-in url caching.
  • httpusername (optinal) - http auth user name if required to access source url.
  • httppassword (optinal) - 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 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.
  • password optional. Password of PDF file. Must be a String.
  • 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 and success). 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.
  • expiration (optional). Output link expiration in minutes. Default is 60 (i.e. 60 minutes or 1 hour). After this delay generated output file(s) (if any) will be auto-removed from PDF.co temporary files storage. Max allowed expiration period depends on your current subscription plan. To store permanent input files (e.g. re-usable images, pdf, documents), please use PDF.co built-in Files Storage instead.
  • 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.

Description

  • Method: POST
  • URL: /v1/pdf/makeunsearchable

Query parameters

No query parameters accepted.

Body payload

{
    "url": "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-to-text/sample.pdf",
    "pages": "",
    "name": "result.pdf",    
    "password": "",
    "async": "false",
    "encrypt": false,
    "profiles": ""
}

Example responses

/pdf/makeunsearchable
{
    "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": "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-to-text/sample.pdf",
    "pages": "",
    "name": "result.pdf",    
    "password": "",
    "async": "false",
    "encrypt": false,
    "profiles": ""
}'

Samples