Link Search Menu Expand Document

Optical Marks Reader (Checkboxes, Radiobutton, Fillable Fields, Segments etc)

Our barcode reader engine can also find the following marks and objects on scanned documents:

  1. checkboxes
  2. radioboxes
  3. vertical and horizontal lines
  4. general segments (basically, all content types on the page).

Available Methods

[POST] /barcode/read/from/url (find checkboxes on scan 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.
types required
Comma-separated list of object types to decode. Must be in a “string” format. Object types supported:
checkboxes, radioboxes, Vertical and Horizontal lines and general segments:

1. Segment - locates and selects objects on a page (general selection)
2. UnderlinedField - detects fillable fields (typically, underlined spaces, i.e. fields to fill in a form).
3. Rectangle - detects rectangles, including checkboxes. Also returns the value as 1 if a checkmark or a filled rectangle was detected.
4. Oval - detects rounded or oval marks (typically, a radiobox). Returns value of 1 if filled out radiobox was detected.
5. HorizontalLine - detects horizontal lines.
6. VerticalLine - detects vertical lines.

For selecting multiple types just put them together with a separate comma.
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 end of the document). For ALL pages just leave this param empty. Example: 0,2-5,7- means the first page, then the 3rd page to the 6th page, and then the range from the 8th (index = 7) page till the end of the document.
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.
profiles optional
Use this parameter to set additional configurations for fine-tuning and extra options. Must be in a “string” format. Explore PDF.co knowledgebase for profile examples.
  • Method: POST
  • URL: /v1/barcode/read/from/url

Query parameters

No query parameters accepted.

Body payload

{
	"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-html/sample.pdf",
	"types": "Checkbox,UnderlinedField",
    "async": false
}

Example responses

/barcode/read/from/url (find checkboxes on scan image)
{
    "barcodes": [
        {
            "Value": "box",
            "RawData": "",
            "Type": 53,
            "Rect": "{X=34,Y=264,Width=526,Height=9}",
            "Page": 0,
            "File": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-html/sample.pdf",
            "Confidence": 1,
            "Metadata": "",
            "TypeName": "UnderlinedField"
        },
        {
            "Value": "box",
            "RawData": "",
            "Type": 53,
            "Rect": "{X=30,Y=299,Width=534,Height=9}",
            "Page": 0,
            "File": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-html/sample.pdf",
            "Confidence": 1,
            "Metadata": "",
            "TypeName": "UnderlinedField"
        },
        {
            "Value": "box",
            "RawData": "",
            "Type": 53,
            "Rect": "{X=30,Y=327,Width=132,Height=9}",
            "Page": 0,
            "File": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-html/sample.pdf",
            "Confidence": 1,
            "Metadata": "",
            "TypeName": "UnderlinedField"
        },
        {
            "Value": "box",
            "RawData": "",
            "Type": 53,
            "Rect": "{X=298,Y=327,Width=132,Height=9}",
            "Page": 0,
            "File": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-html/sample.pdf",
            "Confidence": 1,
            "Metadata": "",
            "TypeName": "UnderlinedField"
        },
        {
            "Value": "box",
            "RawData": "",
            "Type": 53,
            "Rect": "{X=30,Y=352,Width=132,Height=6}",
            "Page": 0,
            "File": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-html/sample.pdf",
            "Confidence": 1,
            "Metadata": "",
            "TypeName": "UnderlinedField"
        },
        {
            "Value": "box",
            "RawData": "",
            "Type": 53,
            "Rect": "{X=298,Y=352,Width=132,Height=6}",
            "Page": 0,
            "File": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-html/sample.pdf",
            "Confidence": 1,
            "Metadata": "",
            "TypeName": "UnderlinedField"
        },
        {
            "Value": "box",
            "RawData": "",
            "Type": 53,
            "Rect": "{X=30,Y=373,Width=132,Height=5}",
            "Page": 0,
            "File": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-html/sample.pdf",
            "Confidence": 1,
            "Metadata": "",
            "TypeName": "UnderlinedField"
        },
        {
            "Value": "box",
            "RawData": "",
            "Type": 53,
            "Rect": "{X=298,Y=373,Width=132,Height=5}",
            "Page": 0,
            "File": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-html/sample.pdf",
            "Confidence": 1,
            "Metadata": "",
            "TypeName": "UnderlinedField"
        },
        {
            "Value": "box",
            "RawData": "",
            "Type": 53,
            "Rect": "{X=30,Y=394,Width=132,Height=6}",
            "Page": 0,
            "File": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-html/sample.pdf",
            "Confidence": 1,
            "Metadata": "",
            "TypeName": "UnderlinedField"
        },
        {
            "Value": "box",
            "RawData": "",
            "Type": 53,
            "Rect": "{X=298,Y=394,Width=132,Height=6}",
            "Page": 0,
            "File": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-html/sample.pdf",
            "Confidence": 1,
            "Metadata": "",
            "TypeName": "UnderlinedField"
        },
        {
            "Value": "box",
            "RawData": "",
            "Type": 53,
            "Rect": "{X=30,Y=416,Width=132,Height=6}",
            "Page": 0,
            "File": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-html/sample.pdf",
            "Confidence": 1,
            "Metadata": "",
            "TypeName": "UnderlinedField"
        },
        {
            "Value": "box",
            "RawData": "",
            "Type": 53,
            "Rect": "{X=298,Y=416,Width=132,Height=6}",
            "Page": 0,
            "File": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-html/sample.pdf",
            "Confidence": 1,
            "Metadata": "",
            "TypeName": "UnderlinedField"
        },
        {
            "Value": "box",
            "RawData": "",
            "Type": 53,
            "Rect": "{X=30,Y=433,Width=132,Height=9}",
            "Page": 0,
            "File": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-html/sample.pdf",
            "Confidence": 1,
            "Metadata": "",
            "TypeName": "UnderlinedField"
        },
        {
            "Value": "box",
            "RawData": "",
            "Type": 53,
            "Rect": "{X=298,Y=437,Width=132,Height=6}",
            "Page": 0,
            "File": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-html/sample.pdf",
            "Confidence": 1,
            "Metadata": "",
            "TypeName": "UnderlinedField"
        }
    ],
    "pageCount": 1,
    "error": false,
    "status": 200,
    "duration": 860,
    "remainingCredits": 98725528,
    "credits": 35
}

Code Snippet

CURL
curl --location --request POST 'https://api.pdf.co/v1/barcode/read/from/url' \
--header 'x-api-key: ' \
--data-raw '{
	"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-html/sample.pdf",
	"types": "Checkbox,UnderlinedField",
    "async": false
}'