IDEAS, METHODS & DOCUMENTS

OmniDoc Journal.

A closer look at documents.
Parsing, translation, and what comes next.

Archive page 2

Bookmarks Gone After Merging PDFs? Set Retention Rules
PDF engineering

Bookmarks Gone After Merging PDFs? Set Retention Rules

When merging, first decide whether to import the original table of contents. If you wish to create the top-level entry yourself, explicitly set import\outline=F

Read article
Batch PDF Parsing: Let Each Process Open Its Own File
PDF parsing

Batch PDF Parsing: Let Each Process Open Its Own File

Multi-process tasks should pass serializable parameters, with each worker process independently opening the document rather than sharing Document or Page object

Read article
Before Translating a PDF, Inventory Its Fonts First
PDF parsing

Before Translating a PDF, Inventory Its Fonts First

’s default font list differs in length from the tuple returned when full=True. Below, read the first six items, then check whether the font bytes returned by ex

Read article
PDF Viewable but Not Copyable? It May Not Be a Scan
PDF parsing

PDF Viewable but Not Copyable? It May Not Be a Scan

lacks text, so it cannot be directly determined to have a “normal text layer,” nor can it be directly classified as a scanned document. Below, we separately rec

Read article
Do PDF Links Survive Translation? Build a Link Inventory
PDF parsing

Do PDF Links Survive Translation? Build a Link Inventory

The link protocol is on the allowlist, which only indicates that this particular format check has passed; it does not imply that the target website is trustwort

Read article
A Black Box Isn't Redaction: Checks for Real PDF Deletion
PDF parsing

A Black Box Isn't Redaction: Checks for Real PDF Deletion

draws a black rectangle over the ID number in the PDF, saves it, and sends it to a colleague; the recipient can still use Ctrl+F to search for the complete numb

Read article
Annotated PDF Handoff: A Clean-Looking File Isn't Enough
PDF parsing

Annotated PDF Handoff: A Clean-Looking File Isn't Enough

directly addresses a high-frequency fault: when you use page.gettext() When extracting PDF content for translation or archiving, the default output typically do

Read article
Cover, Roman Numerals, Page 1: Don't Mix Up PDF Page Labels
PDF parsing

Cover, Roman Numerals, Page 1: Don't Mix Up PDF Page Labels

page-numbering tag rules use firstpagenum, not start. When the cover page has only a prefix, the read-back rule dictionary may omit style; a more meaningful acc

Read article
File Name vs Document Title: Tidy Up PDF Metadata
PDF parsing

File Name vs Document Title: Tidy Up PDF Metadata

when the automation script processes reportfinalv2.pdf When the document title is written into the database, downstream translation or retrieval systems may rec

Read article
PDF Tables Aren't Just CSV: Check Headers and Boundaries
PDF parsing

PDF Tables Aren't Just CSV: Check Headers and Boundaries

When you receive a scanned or typeset PDF financial report, run findtables() After directly exporting to CSV, you will very likely encounter three types of “sil

Read article
Highlight Boxes Off on Italic PDF Text? Use Quads
PDF parsing

Highlight Boxes Off on Italic PDF Text? Use Quads

Italics do not necessarily ensure that the area of the searched Quad is smaller than that of its bounding rectangle. When it is necessary to preserve corner-dir

Read article
Only Need the Signature Area? Render Just That PDF Region
PDF parsing

Only Need the Signature Area? Render Just That PDF Region

Whether image cropping is valid should be verified by checking the decoded pixel dimensions, rather than using the PNG byte count as a quality metric. For examp

Read article
Thumbnails for Long PDFs: Do the Pixel and Memory Math First
PDF parsing

Thumbnails for Long PDFs: Do the Pixel and Memory Math First

generates thumbnails in batch for a 200-page engineering drawing PDF; the script is killed by the system due to OOM when it reaches page 30. This is a typical i

Read article
Why Extracted PDF Images Differ from What the Page Shows
PDF parsing

Why Extracted PDF Images Differ from What the Page Shows

Images with transparency may be stored separately as the main image and a soft mask. Below, we construct an RGBA PNG using Pillow, then insert it into an in-mem

Read article
Cropped the PDF Margins: Is the Content Really Gone?
PDF parsing

Cropped the PDF Margins: Is the Content Really Gone?

When you use code to shrink the CropBox of a PDF page by a small margin, visually it does indeed appear that only the core content remains; however, this does n

Read article
Landscape PDF, Wrong Coordinates? Check the Rotation
PDF parsing

Landscape PDF, Wrong Coordinates? Check the Rotation

You are parsing a scanned document or an engineering drawing; to the naked eye, the table appears on the right side of the page, but gettext() The returned coor

Read article
Find Where an Amount Sits on a PDF Page
PDF parsing

Find Where an Amount Sits on a PDF Page

appears twice in a single statement 1,200.00: once in the payable amount field, and once in the description text. A full-text search can locate both, but it can

Read article
Two-Column PDF Read as One Column? Keep the Coordinates
PDF parsing

Two-Column PDF Read as One Column? Keep the Coordinates

The left column is read halfway through when the next sentence abruptly transitions to the formula explanation in the right column. Such issues do not necessari

Read article
Check a 100-Page Scan Fast with a Traceable Contact Sheet
OCR & images

Check a 100-Page Scan Fast with a Traceable Contact Sheet

Opening a hundred-page scan one page at a time is very slow, and skipping to the first page risks missing inverted, blank, or duplicate pages. A thumbnail overv

Read article
Map OCR Boxes Back After Scaling and Cropping
OCR & images

Map OCR Boxes Back After Scaling and Cropping

The bounding box returned by OCR is very accurate on the local image, but when rendered back into the PDF, it is offset overall. Do not immediately suspect the

Read article
Stop One Image from Eating All Memory in Your OCR Upload API
OCR & images

Stop One Image from Eating All Memory in Your OCR Upload API

uploads a file that is only a few megabytes in size, yet after decoding it may require far more memory than expected. Highly compressible images, in particular,

Read article
Multi-Page TIFF: Process Every Frame So No Page Is Missed
OCR & images

Multi-Page TIFF: Process Every Frame So No Page Is Missed

After opening a TIFF file, only the first page was processed; the program did not report any errors, yet it had already skipped the remaining content. For multi

Read article
Does Upscaling a Small Image 4x Improve OCR?
OCR & images

Does Upscaling a Small Image 4x Improve OCR?

enlarges the small image by a factor of four, increasing the number of pixels, but strokes that were not originally recorded will not automatically reappear. Re

Read article
Grayish Scans: More Contrast Won't Always Help OCR
OCR & images

Grayish Scans: More Contrast Won't Always Help OCR

The scanned page appears washed out; increasing the contrast does make it more noticeable, but light-colored stamps and fine lines may also disappear. Preproces

Read article
Transparent PNG Turns Black in OCR? Add a White Background
OCR & images

Transparent PNG Turns Black in OCR? Add a White Background

A text PNG with a transparent background looks fine on the web page, but after being fed into a certain processing pipeline, it turns into a black background. T

Read article
How Big Is a Scan? Pixels, DPI and Page Size Explained
OCR & images

How Big Is a Scan? Pixels, DPI and Page Size Explained

changes the image DPI from 72 to 300; the file properties now look more professional, but the text edges remain unclear. DPI is information about physical size

Read article
PDF Code Fails on Another Machine? Share the Environment
Delivery pipelines

PDF Code Fails on Another Machine? Share the Environment

“The same piece of code runs on my computer” is not a reproduction report. PDF rendering and document conversion are also affected by library versions, system f

Read article
Task Says Done but the Download Isn't Ready? Split States
Delivery pipelines

Task Says Done but the Download Isn't Ready? Split States

The button says “Complete,” but clicking download returns an empty file. Typically, this isn’t a matter of textual feedback; rather, the backend only logs that

Read article
Handing Translations to a Colleague? Add a Manifest
Delivery pipelines

Handing Translations to a Colleague? Add a Manifest

The delivery package contains only a few translation files, and the colleague does not know which source document they correspond to, what the target language i

Read article
Power Cut Mid-Export? Don't Ship a Half-Written File
Delivery pipelines

Power Cut Mid-Export? Don't Ship a Half-Written File

The file was halfway written when the service restarted, yet the download link had already been made available to users. Such failures are not as simple as “the

Read article