How to Use the Custom Profiles Parameter When Converting PDF to Text with PDF.co and Postman
Some PDF documents display readable text that cannot be selected, copied, or extracted normally. This can happen when characters have been converted into vector drawings rather than stored as regular PDF text.
In this tutorial, you will use the PDF.co PDF-to-Text API with Postman and set the OCRMode custom profile to TextFromVectorsOnly. This tells PDF.co to run OCR specifically on vector drawings.
Requirements
Before beginning, you will need:
- A PDF.co account and API key.
- The Postman application or another HTTP client.
- A direct URL or PDF.co
filetoken://link for the source PDF. - A PDF containing text represented by vector drawings.
Your PDF.co API key is available from the PDF.co dashboard.
Step 1: Create a Postman Request
Open Postman and create a new HTTP request.
Configure the request as follows:
- Method:
POST - URL:
https://api.pdf.co/v1/pdf/convert/to/text
This endpoint converts PDF documents and scanned images into text while supporting OCR and custom extraction profiles.
Step 2: Add the Request Headers
Open the Headers section and add:
- Content-Type:
application/json - x-api-key: Your PDF.co API key
Keep your API key private. Do not include a real production key in screenshots, published examples, or source-code repositories.
Step 3: Add the Source PDF
The url parameter must contain the source document location. You can use either:
- A direct, publicly accessible file URL.
- A
filetoken://link from PDF.co Files Storage.
To use PDF.co Files Storage, upload the document through your PDF.co dashboard and copy its generated file token.
Step 4: Configure the JSON Body
In Postman, open Body, select raw, and choose JSON as the content type.
Enter the following request body:
{
"url": "filetoken://YOUR_FILE_TOKEN",
"inline": false,
"async": false,
"profiles": "{ 'OCRMode': 'TextFromVectorsOnly' }"
}Replace filetoken://YOUR_FILE_TOKEN with the URL or file token for your document.
The profiles value must be supplied as a string. The OCRMode property can be placed directly inside that string; the older nested profiles and profile1 structure is unnecessary.
Step 5: Understand the Parameters
URL
The url parameter identifies the PDF that PDF.co should process.
Inline
The inline parameter controls how the extracted text is returned:
- Set it to
falseto receive a temporary URL for a downloadable text file. - Set it to
trueto include the extracted text directly in the API response.
Async
For this example, async is set to false, so the API returns the completed result in the same request.
For large or time-consuming documents, set async to true and use the returned job information to monitor processing.
Profiles
The profiles parameter supplies additional processing options that are not represented by regular top-level request parameters.
This tutorial uses:
{ 'OCRMode': 'TextFromVectorsOnly' }TextFromVectorsOnly extracts text from vector drawings while excluding raster images and regular PDF text objects from the OCR result.
Step 6: Choose the Appropriate OCR Mode
The default OCR mode is Auto, which is appropriate for many documents. Use a more specific mode when you know how the document’s content is constructed.
Common options include:
Auto— Automatically determines whether OCR is required.AutoRepairFonts— Automatically repairs text affected by damaged or incorrectly encoded fonts.TextFromImagesOnly— Extracts text from raster images only.TextFromVectorsOnly— Extracts text from vector drawings only.TextFromRepairedFontsOnly— Processes text with damaged font encoding.TextFromImagesAndFonts— Extracts regular PDF text and text found in raster images.TextFromImagesAndVectorsAndFonts— Extracts regular text and runs OCR on both raster images and vector drawings.TextFromImagesAndVectorsAndRepairedFonts— Processes raster images, vector drawings, and text with damaged font encoding.
Use TextFromVectorsOnly when visible characters have been converted to outlines or other vector elements. If the document is a conventional scanned image, use an image-based mode or leave the setting at Auto.
See the PDF.co Profiles documentation for the complete, current list of OCR modes and profile options.
Step 7: Send the Request
Click Send in Postman.
A successful synchronous request should return:
- HTTP status
200. "error": false.- Information about the generated output.
- A temporary output URL when
inlineisfalse.
If the request fails, check that:
- The API key is valid.
- The source URL or file token is accessible.
- The endpoint uses the
POSTmethod. - The request body is valid JSON.
- The
profilesvalue is enclosed in quotes as a string.
Step 8: Download or Review the Extracted Text
When inline is false, copy the returned url value and open it in a browser to download or view the generated text file.
The output is a .txt file—not another PDF. PDF.co output URLs are temporary, so download the result or transfer it to permanent storage if it must remain available.
When inline is true, review the extracted text directly in the response body instead.
Equivalent cURL Request
The same request can be sent without Postman:
curl --location --request POST 'https://api.pdf.co/v1/pdf/convert/to/text' \
--header 'Content-Type: application/json' \
--header 'x-api-key: INSERT_API_KEY_HERE' \
--data-raw '{
"url": "filetoken://YOUR_FILE_TOKEN",
"inline": false,
"async": false,
"profiles": "{ '\''OCRMode'\'': '\''TextFromVectorsOnly'\'' }"
}'Replace the API key and source file token before sending the request.
Conclusion
You have used the PDF.co profiles parameter to control OCR behavior during PDF-to-text conversion. By setting OCRMode to TextFromVectorsOnly, PDF.co can extract visible text represented by vector drawings that ordinary text extraction cannot read.
The same approach can be used with other profile options to adjust OCR resolution, handle damaged fonts, change text grouping, rotate content, or refine extraction behavior.
For all supported parameters, see the PDF-to-Text API documentation.
Related Tutorials

