IDEAS, METHODS & DOCUMENTS

OmniDoc Journal.

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

Archive page 1

Document Job Timed Out? Don't Let One Task Stall the Batch
Delivery pipelines

Document Job Timed Out? Don't Let One Task Stall the Batch

A scanned PDF got stuck, and the subsequent ninety-nine tasks remained idle. Adding a timeout to the request seemed to resolve the issue, but in reality, the pr

Read article
Set a ZIP Decompression Budget Before Opening DOCX and EPUB
Delivery pipelines

Set a ZIP Decompression Budget Before Opening DOCX and EPUB

DOCX is essentially a set of ZIP entries, and EPUB also uses a ZIP container. Receiving a very small compressed file does not mean it will remain small after de

Read article
Don't Use Uploaded File Names as Storage Paths
Delivery pipelines

Don't Use Uploaded File Names as Storage Paths

uploads a file named ../../report.pdf, does not mean the server should save the file under that name. The filename originates from the user and constitutes inpu

Read article
Same File Name, Different File: Identify Inputs by Hash
Delivery pipelines

Same File Name, Different File: Identify Inputs by Hash

The client subsequently sent two documents, both titled final.pdf Which of the files has been translated? Relying on file names to answer this question is risky

Read article
Why Store Page Numbers and Source Text in Extracted JSON
Structured data

Why Store Page Numbers and Source Text in Extracted JSON

extraction yields only one amount: 1200, the reviewer still has to reread the entire document. Saving additional page numbers and short original text fragments

Read article
Invoices and Receipts in One Endpoint Without Mixing Schemas
Structured data

Invoices and Receipts in One Endpoint Without Mixing Schemas

An interface that accepts both invoices and receipts at the same time can easily result in a large object with “all fields optional.” Such an object can accommo

Read article
Can an Amount Be Negative? Business Rules vs Type Rules
Structured data

Can an Amount Be Negative? Business Rules vs Type Rules

writes all amount fields as minimum: 0, though seemingly rigorous on the surface, ends up blocking legitimate refund records. Whether the amount has been conver

Read article
The Model Returned an Extra Field: Accept or Reject It?
Structured data

The Model Returned an Extra Field: Accept or Reject It?

The extraction result contains one extra item. confidence, which appears quite useful on the front end, was thus directly displayed as “trustworthiness.” The pr

Read article
Extracted Line Items: Don't Let Sorting Break Row Order
Structured data

Extracted Line Items: Don't Let Sorting Break Row Order

The amounts in the two rows of details are identical, which does not indicate that they are duplicate data; nor does the sorted table, which appears more organi

Read article
Extracting Order Status? Always Keep an "unknown" Value
Structured data

Extracting Order Status? Always Keep an "unknown" Value

When the order status is not in the system’s predefined list, the easiest approach is often to select the value that “most closely resembles” it. The time saved

Read article
Missing Field vs Null Field: Two Different Failures
Structured data

Missing Field vs Null Field: Two Different Failures

“Field not found” and “Field is null” may both appear as blank on the user interface, but they should not be treated as equivalent once the program is executed.

Read article
Spot-Check Long Translations Beyond the First 3 Pages
Translation QA

Spot-Check Long Translations Beyond the First 3 Pages

reviewing a lengthy translation draft—looking only at the first few pages is usually insufficient. The cover page and table of contents may be neatly formatted,

Read article
Translation Cache: Source Text Alone Is Not a Safe Key
Translation QA

Translation Cache: Source Text Alone Is Not a Safe Key

“Save” may look the same across two projects, but its translation, capitalization, and context can differ. Using the original text’s hash as the unique cache ke

Read article
Show Reviewers the Changes First: An Honest Translation Diff
Translation QA

Show Reviewers the Changes First: An Honest Translation Diff

An English draft was revised ten times, requiring the reviewer to read it from scratch each time, which is not very efficient. A diff view can focus attention o

Read article
Identical-Looking Terms That Won't Match: A Unicode Issue
Translation QA

Identical-Looking Terms That Won't Match: A Unicode Issue

The term is clearly listed in the glossary, yet the program reports no match. Printing out the string reveals that both sides appear identical. The issue may no

Read article
& on a Translated Page? You May Have Decoded Twice
Translation QA

& on a Translated Page? You May Have Decoded Twice

The page displays a string of &, the first reaction is often to decode it once more. But the problem may be just the opposite: the same piece of content has

Read article
A Glossary Isn't Find-and-Replace: Define Word Boundaries
Translation QA

A Glossary Isn't Find-and-Replace: Define Word Boundaries

The glossary contains API, does not mean that every word in the document containing these three letters should be replaced.APIs is morphological variation,apiga

Read article
Numbers Right, Units Missing: A Two-Layer Translation Check
Translation QA

Numbers Right, Units Missing: A Two-Layer Translation Check

in the translation, 1,234.50 becomes 1.234,50, may merely represent a change in the numeric format, or it might be incorrectly parsed as another quantity. Numer

Read article
Catch Missing {name} Placeholders Before Translations Ship
Translation QA

Catch Missing {name} Placeholders Before Translations Ship

“Welcome, {name}” After being translated into another language, the variable names are translated along with it, and the page typically only reports an error wh

Read article
Parsing HTML Is Not the Same as Displaying It Safely
HTML & web

Parsing HTML Is Not the Same as Displaying It Safely

When you have successfully parsed a section containing <img src=x onerror=alert(1)> When the string is deserialized, this malicious code remains intact in the o

Read article
Regex for IDs? Handle Full-Width Characters First
Structured data

Regex for IDs? Handle Full-Width Characters First

number AB-1234 looks simple, but the actual input may contain prefixes, trailing line breaks, or full-width characters. Writing just one regular expression and

Read article
Same Broken HTML, Two Parsers, Two Results: Why
HTML & web

Same Broken HTML, Two Parsers, Two Results: Why

When you use Beautiful Soup to extract the main content of a webpage, the most insidious issue isn’t an error message—it’s “no error, but the content is missing

Read article
Translating Tech Docs Without Translating the Code
HTML & web

Translating Tech Docs Without Translating the Code

puts userid is translated as “user identifier,” or <div class="container"> Localizing the class attribute in [ ] is the most costly and hardest-to-diagnose erro

Read article
Having H1–H6 Doesn't Mean Your Heading Outline Works
HTML & web

Having H1–H6 Doesn't Mean Your Heading Outline Works

When dealing with technical documentation or web content, a common misconception is that as long as there is in HTML <h1> to <h6> tag; the document structure is

Read article
Translated Chinese Page to English? Update the lang Tags Too
HTML & web

Translated Chinese Page to English? Update the lang Tags Too

translates a segment of Chinese HTML into English, if it only replaces<p>The text content within the tags, without making corresponding changes.langAttributes—s

Read article
Exported HTML Moved Domains and Images Broke? Check Links
HTML & web

Exported HTML Moved Domains and Images Broke? Check Links

The baseline for urljoin should be the original page URL; do not arbitrarily append a trailing slash to convert a file URL into a directory. This example handle

Read article
Expand HTML rowspan and colspan into a 2D Table Grid
HTML & web

Expand HTML rowspan and colspan into a 2D Table Grid

When you are working with an HTML document that contains complex table headers, directly extracting<td>text often yields corrupted data. A setting withrowspan="

Read article
A PDF That Opens Isn't Fixed: Where Strict Mode Belongs
PDF engineering

A PDF That Opens Isn't Fixed: Where Strict Mode Belongs

In the engineering practice of batch-processing PDF files, the most dangerous signal is often not a program error, but rather PdfReader silently returned what a

Read article
Before Compressing a PDF, Decide If Image Loss Is OK
PDF engineering

Before Compressing a PDF, Decide If Image Loss Is OK

below only checks lossless compression of the content stream: the decoded bytes before and after compression should be identical to the extracted text. It does

Read article
In Word, bold is None—so does that count as bolding or not?
Word & layout

In Word, bold is None—so does that count as bolding or not?

’s direct format of None indicates that no value has been set, not False. Here, only the direct format and the explicit character style chain are checked; when

Read article