Skip to main content

Specifications

Format: PDF Recommended size: 100 pages or fewer Import methods:
  • IAM Delegated Access
  • Signed URLs (https URLs only)
When importing document data to Labelbox, you are no longer required to provide an OCR extract in the form of a JSON file. Labelbox generates text layers automatically during PDF import using Google Document AI if the data row doesn’t include a text layer. The JSON file generated will be your text layer, rendered on top of your PDF in the Document Editor.

Text layer limit

Previously generated PDF documents without text layers can’t be retroactively filled with the text layer generated by Labelbox.
Google Document AI has the following limitations:
  • The document must have no more than 15 pages
  • The file size should not exceed 20 MB.
Additionally, Google Document AI optimizes documents before OCR processing. This optimization might include rotating images or pages to ensure text appears horizontally. Consequently, token coordinates are calculated based on the rotated/optimized images, resulting in potential discrepancies with the original PDF document. For example, the document is rotated 90 degrees before processing in a landscape-oriented PDF. As a result, all tokens in the text layer are also rotated by 90 degrees.

Image encoding

If your PDF files contain images, use JPEG encoding and RGB colorspace for color images.

Text Layer Validation Schema

If you want to upload your own text layer, the textLayer JSON file must adhere to the following JSON schema.

Parameters

Import format

Python example

Verify files are processed

File processing can take up to 20 mins

Since PDFs and OCR’ed files can be very large, the conversion can sometimes take up to 20 minutes to perform a data upload.
By checking the Media Attributes section, you can verify whether a file conversion using a custom or Labelbox-generated text layer is complete.
  • If Is text layer valid = true, the file was successfully processed.