What the Document Says It Is Made Of
Give the document a reading order and a shape — headings, paragraphs, figures — so a program can read it aloud in the order a person would.
See It in a Real PDF
A List Whose Pictures Speak Too
A parts list whose first column is a picture rather than a word. Each picture carries the sentence somebody hears in its place, so nothing in the list is lost on a reader who cannot see it. On the page, the pictures are simply pictures.
Open the PDF The Whole Example
Also shown in: A Document That Can Be Read Aloud · A Figure That Says Which Headings Reach It · A Tagged PDF/A-1a Deed of Deposit
Summary
Ink on a page has no order of its own. A person sees that the big words at the top are a heading and that the two columns are read one after the other, but a program sees only marks placed at coordinates, in whatever order they were drawn. Once it is written down, a document can be read aloud correctly, copied without scrambling, and reflowed on a small screen. You can also say a passage is in another language, so it is pronounced properly, and give a picture a sentence describing it for somebody who cannot see it.
Technically
Written at the top level of a request, under
"structure"
structure writes the /StructTreeRoot and the /StructElem tree under it — what the document says it is made of, in reading order: the elements that carry the marked content the items left in the content stream. An item opens marked content with tag and mark; the tree then claims it by its /MCID, which is what ties the ink to the meaning. Absent, the file says nothing about itself and reading software reads it in the order the ink went down. lang is the tongue the words are written in, as a BCP 47 tag, and a node states its own where a passage is in another. roles lets the request use tags of its own, each said through /RoleMap to be read as one the standard names. A node either holds children, or claims marked content through content, or reaches a branch built elsewhere.
Request Schema
-
structure— object, optional. Absent, the file says nothing about itself. -
structure.lang— string, optional, a BCP 47 tag. The tongue the document's words are written in. -
structure.roles— array, optional. Tags of the request's own, each an object oftagandstandard, the standard tag it is read as. -
structure.children— array, optional. The elements at the head of the tree, in reading order. -
A node names either
branch, the name of a branch built elsewhere, and nothing else at all; ortag, the standard's name for what it is (Document,Sect,H1,P,Figure), and thenchildren, other nodes, orcontent, the label of the marked content an item left behind, one of the two and never both. A node naming neither a tag nor a branch is refused. -
A node also takes
namespace,langfor a passage in another tongue,alt, a sentence describing what cannot be seen, andactual_text, what a passage really says when its ink does not spell it. -
A node also takes
expansion, the words an abbreviation or an acronym stands for, written out, which reading software says in place of the letters. -
A node also takes
list_numberingon the node of a list, one ofnone,unordered,description,disc,circle,square,ordered,decimal,upper_roman,lower_roman,upper_alphaandlower_alpha. A list inside one that states a scheme and states none of its own is numbered the way the outer one is. -
A node also takes
placement, where the element stands in the flow of its page, one ofblock,inline,before,startandend. Absent, the element is a block or sits inside its line, as its tag is. Nothing on the page moves for it: it tells software reflowing the document where to put the element back. -
structure.namespace_roles— array, optional. Tags of one namespace read as tags of another, each an object ofnamespace,tag,standardandtarget_namespace: thetagofnamespaceis read asstandardoftarget_namespace. It is what lets two namespaces use one name for different things. PDF 2.0. -
structure.pronunciation_lexicons— array of strings, optional. Thenameof files amongattachments, each a pronunciation lexicon in the W3C format, that reading software says the document's words with, the first match winning. A name no attachment declares is refused. -
A node also takes
aria_role, what the element is for where the standard's tags have no word for it, as a role of WAI-ARIA 1.1 or of its Digital Publishing module, spelt as the vocabulary spells it:doc-bibliography,doc-noteref,"alertdialog"."none"is read as"presentation". A word the vocabulary does not hold, or one of its abstract roles, is refused. -
A node also takes
phoneme, how its content is said, spelt in a phonetic alphabet, andphonetic_alphabet, that alphabet, which the nodes nested in it take when they state none:ipa,x_sampa,pinyin,wade_giles, or{"other": name}for one the standard does not name. Absent, reading software takes the IPA. -
A node of a list also takes
continues_list, the earlier list it carries on from:"preceding", the list before it in the tree, or{"from": id}, the list whoseidis given. Anidno node carries is refused. -
A
"Form"node enclosing a printed form field also takesprint_field, an object ofrole(radio_button,check_box,push_button,text_valueorlist_box),checked(on,offorneutral) anddescription, the field's alternate name, each written only where it is stated. -
An
"Artifact"node also takesartifact, what the furniture it encloses is: an object ofkind(pagination,layout,pageorinline),subtype, spelt as the file holds it (Header,Footer,Watermark,PageNum,Bates,LineNum,Redaction, or a name of one's own under ISO 32000-2 Annex E such asACME_Stamp), andbbox, the box it covers, four edges in the page's points, each written only where it is stated. Any other subtype is refused. -
A node also takes
refers_to, theidof the nodes it refers to — a note to what it annotates, a caption to what it captions. Anidno node carries is refused. -
A node also takes
attributes, the attribute objects it states: what its appearance means, such as the box a figure covers, the alignment of a cell or the thickness of a border. Each is an object ofowner, the standard's name for the family it belongs to (Layout,List,PrintField,Table,UserProperties) or a name of one's own, or elsenamespace, the address of a vocabulary of one's own, in PDF 2.0;entries, each value under its name; andrevision, optional, the revision of the element it is tied to. A value istrueorfalse, a number, a string, an array of values,{"name": "Center"}for a name, or{"dictionary": {…}}for values grouped under names. An object stating bothownerandnamespace, or neither, is refused. -
structure.class_map— array, optional. Attribute objects filed once under a name, each class an object ofnameandattributes, written as a node writes them. A node also takesclasses, the classes it belongs to, each an object ofnameandrevision, optional, and holds their attribute objects as its own. -
A cell of a table stated node by node, a
"TH"or a"TD", also takesscope(row,columnorboth, on a"TH"),col_spanandrow_span, the columns and rows it covers counting its own, andheaders, theidof the header cells it sits under. -
A node holding
childrenorcontentalso takesannotations, themarkalinkitem or a form field carries, so the element holds that link or that field and the link leads back to it: what a document claimingpdfua1orpdfua2owes every link and every field. A radio group files one entry per button under its mark. -
A node also takes
imported_runs, the runs of a page brought in by apdf_pageitem:{"page": label, "runs": [0, 1]}, theown_runslabel of that item and the numbers its own document gave the runs.annotationsandimported_runsare refused on a node whosecontentnames several runs. -
An item that draws, where no element of the tree owns its run, takes
described, what the run says for itself: an object ofexpansion,actual_text,altandlang, at least one stated. It is refused besidetagorartifact, and inside a named drawing.
Scope: the whole document. It is what accessible is judged against; on its own it costs nothing and is simply read by whoever wants the order and the meaning rather than the coordinates.
A Whole Request That Creates a PDF
{
"standard_fonts": [{ "name": "sans", "face": "helvetica" }],
"structure": {
"lang": "en-GB",
"children": [
{
"tag": "Document",
"children": [
{ "tag": "H1", "content": "heading" },
{ "tag": "P", "content": "opening" },
{
"tag": "L",
"list_numbering": "decimal",
"children": [
{
"tag": "LI",
"children": [
{ "tag": "Lbl", "content": "label" },
{
"tag": "LBody",
"children": [
{
"tag": "Span",
"expansion": "kilogramme",
"content": "unit"
},
{
"tag": "Span",
"placement": "inline",
"content": "rest"
}
]
}
]
}
]
}
]
}
]
},
"items": [
{
"type": "text",
"rect": { "llx": 72, "lly": 720, "urx": 523, "ury": 760 },
"content": ["What this document is"],
"font": "sans",
"font_size": 20,
"tag": "H1",
"mark": "heading"
},
{
"type": "text",
"rect": { "llx": 72, "lly": 660, "urx": 523, "ury": 710 },
"content": ["It is read in the order the tree gives, not the order of the ink."],
"font": "sans",
"font_size": 11,
"tag": "P",
"mark": "opening"
},
{
"type": "text",
"rect": { "llx": 72, "lly": 620, "urx": 96, "ury": 646 },
"content": ["1."],
"font": "sans",
"font_size": 11,
"tag": "Lbl",
"mark": "label"
},
{
"type": "text",
"rect": { "llx": 100, "lly": 620, "urx": 112, "ury": 646 },
"content": ["kg"],
"font": "sans",
"font_size": 11,
"tag": "Span",
"mark": "unit"
},
{
"type": "text",
"rect": { "llx": 115, "lly": 620, "urx": 523, "ury": 646 },
"content": ["of paper per ream"],
"font": "sans",
"font_size": 11,
"tag": "Span",
"mark": "rest"
}
]
}
Finding one's way through it
The Order One Field Leads to the Next What a Page Sets off as Reading Software Comes and Goes What the Document Runs as It Is Closed, Saved or Printed The Scripts the Document Registers by Name The Clickable Contents Down the Side Landing Places That Have a Name Following an Article Column by Column How the Document Opens and Prints
Where to Go Next
Every JSON key of a request, in one page The other forty-one settings of a request