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)

  • 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. You can also encrypt data for output files and decrypt data input files with user-controlled data encryption (uses strong AES encryption with your own keys). Click here to learn more.
  • 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. 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 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 separated 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 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 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.

  • profiles optional. Must be a String. Use this param to set additional configuration for fine tuning and extra options. 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://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/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://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/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://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/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://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/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://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/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://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/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://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/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://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/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://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/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://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/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://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/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://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/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://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/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://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/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://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/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://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-to-html/sample.pdf",
	"types": "Checkbox,UnderlinedField",
    "async": false
}'