Extracts
An Extract reads a piece of text from each PDF of a document type: the text in an area of a page, the file name, or a combination of other Extracts. Modifiers can then change the text, and Validators check it.
Extract types
| Type | Reads | Typical use |
|---|---|---|
| PDF area | The text inside an area of a page. | A title block field, a heading, a stamp's text. |
| File name | The PDF's file name, including .pdf. | Checking the file name with a Pattern; comparing it with a field. |
| Combination | Other Extracts or Modifiers joined by a pattern such as a-b. | Building a full document number from several title block fields. |
Every Extract has a Name (optional). When it is empty, the Extract is shown by its group's name (for example the field's title), or else by its type, such as "(PDF area)". The editor shows what the Extract Reads on the template.
Adding an Extract:
- In a field validation, the Extract is made when you pick the field on the drawing (see Field validation).
- In the Items section, Add ▾ › Extract: PDF area (opens the area dialog), Extract: File name or Extract: Combination.
- In the canvas editor, the Add extract tool (key E): drag to draw an area, or click a box. A labelled box (a label above its value) starts a field validation instead.
PDF area
| Field | What it does |
|---|---|
| Page | The page of the checked PDF to read, starting at 1. |
| Define area / Edit area | Opens the area dialog on the template. Click a box of the title block to use it, or drag to draw the area. The editor then shows the area as, for example, "Area: 62.0–98.5% across, 85.0–97.0% down". |
| Extract mode | Overlap (with Min. overlap) or Contain. See Extract modes. |
| Reading order | As in the PDF, Top to bottom priority or Left to right priority. See Reading orders. |
The Items section summarises a PDF area as, for example, "Page 1 · overlap ≥ 75% · top to bottom priority".
Pages and areas
- The area is stored as fractions of the page, measured from the top-left corner: for example "from 62% to 98.5% of the width". It is not stored in millimetres.
- The same layout on another sheet size works. When a drawing is plotted on A1 instead of A3, everything grows in proportion, and the area still covers the same field.
- A different layout does not. If the title block is placed differently, has other proportions, or the sheet has other proportions (for example A3 against A3FFF), the area lands on a different part of the drawing. Use a data frame for title blocks that move or scale: it finds the title block by its fixed texts and places the cells there.
- A page the PDF does not have reads as empty. An Extract on page 2 of a one-page PDF reads nothing, and its checks fail with
The extract is empty. - Partial lines. In the canvas editor and the area dialog, a click on a box uses the lines of the drawing. With the Partial lines switch on, a separator line that stops short of the box's far side still splits the box (for example between two fields of one row). The choice is remembered in this browser.
Extract modes
The extract mode decides which text items a PDF area reads. A text item is a piece of text the PDF places as one, such as a word or a line.
| Mode | Reads a text item when | Notes |
|---|---|---|
| Overlap | at least the Min. overlap share of the item's own box lies inside the area. | The default for new Extracts, at 75%. The slider goes from 40% to 100% in steps of 5%. |
| Contain | the item lies completely inside the area. Touching the area's edge is not enough. | The mode of Extracts from projects made in NodePDF 26.1, so that their results do not change. |
- Overlap is measured against the text item, not the area. Small text in a large area always counts.
- Items are read whole. A text item that counts is read in full, also when part of it sticks out of the area. Characters are never cut off.
- In the area dialog, the text items on the page are outlined and the ones the area reads are highlighted, so you can see what each mode picks up.
When to use which:
- Use Overlap in most cases. It tolerates text that is placed slightly differently from drawing to drawing, or that sticks out of its cell.
- Raise Min. overlap when the area picks up a neighbouring text that only just reaches into it.
- Use Contain when neighbouring texts sit very close to the field and Overlap keeps picking them up, and the field's own text always lies well inside its cell.
Reading orders
The reading order decides the order in which an area's text items are joined.
| Reading order | Reads | Use it when |
|---|---|---|
| As in the PDF (default) | The order the text is stored in the PDF. | The text reads correctly, which is the usual case. |
| Top to bottom priority | Lines from top to bottom, each line from left to right. Parts of one line at slightly different heights stay one line. | A field reads its words out of order, or a value spans two or more lines (a drawing title, an address). |
| Left to right priority | By where each text item starts, from left to right; items starting at the same spot from top to bottom. Lines are not kept together. | Values are laid out in columns, or the field has a raised character that must stay in place. |
- Raised characters. The "2" of "m²" may sit outside its line. Top to bottom priority then reads it as a line of its own (
2m); Left to right priority keeps it in place (m2). - Labels above values. With Left to right priority, a label above the values is read wherever it starts. For example,
KILOMETER+METERover3 +900 -4 +100reads its label mixed in with the values; a Remove text Modifier still takes the label out, as long as the label is one text item, and the value reads3+900-4+100. - The area dialog shows the text in the Extract's reading order.
Text rules
These rules apply to every PDF area:
- The text items the area reads are taken in the Extract's reading order.
- Each item's spaces at the ends are removed.
- The items are joined without spaces. "This is big" and "readable text" give
This is bigreadable text. - The Modifiers of the chain then apply, in order (see Modifiers).
Because of rule 3, a value printed on two lines, or a label and its value, run together. Write the expected value the way NodePDF reads it, or remove the unwanted part with a Modifier. When a PDF stores its text in pieces that differ from what you see, such as a whole table row in one item or a label split in two, see Common PDF problems.
The PROJECT field of the "Title block" data frame has two lines, "EXAMPLE PROJECT" and "BUILDING 1 – CAT A OFFICE & WORKSPACE". It reads EXAMPLE PROJECTBUILDING 1 – CAT A OFFICE & WORKSPACE, and its Fixed value expects exactly that.
Rotated text (such as a vertical label) is read with the box it actually covers on the page.
Text printed twice
Some PDFs have text printed twice on top of itself, for example from a plot that writes each field twice. An area over such a field reads the text twice: EXAMPLE CLIENTEXAMPLE CLIENT.
- How it is found: two text items in the area with the same text that share at least 95% of the smaller one's box.
- Not flagged: a value that only repeats (
1212), the same text in two different places, or "fake bold" printed slightly offset. - Effect: every check that reads such an area fails, whatever its own result, with the reason Text printed twice. Checks that read the area through a Modifier or Combination are included. The details name the Extract and the text, followed by the check's own details in brackets:
Text printed twice in "CLIENT": "EXAMPLE CLIENT" (Expected "EXAMPLE CLIENT"). - Not affected: the document filter.
- In the Review view, text printed twice is outlined in magenta and marked Printed twice.
- What to do: have the PDF produced again without the doubled text. Changing the check does not help, because the check fails on the doubled text whatever it says.
AutoCAD SHX text
AutoCAD draws text in SHX fonts as lines, so the PDF has no real text there. When the drawing is plotted with comments (AutoCAD 2016 and later), every SHX text gets an "AutoCAD SHX Text" comment that holds the text.
| Setting off (default) | Setting on | |
|---|---|---|
| PDF area Extracts | Read only the PDF's own text. An area over SHX text reads nothing. | Also read the text of the SHX comments. |
| Readable text Validator | Counts only the PDF's own text. | No change. |
| No Autodesk SHX text Validator | Fails on SHX text. | No change. |
- The setting is on Project › Settings, under Text: Allow AutoCAD SHX text: extracts also read it. It applies to reports, previews, the canvas editor and the title block popup.
- SHX text items are outlined in violet in the canvas editor and the Review view, and are selected like any other text (Overlap or Contain).
- Reports keep the setting they ran with, so changing it later does not change an existing report.
- SHX text plotted without comments cannot be read at all: it is only lines.
File name
Reads the name of the PDF file being checked, including .pdf ("Reads the name of the PDF file being validated (including ".pdf")."). It has no settings besides its name. The folder is not included.
Combination
Joins the text of other Extracts or Modifiers with a pattern.
| Field | What it does |
|---|---|
| Sources | The items to combine, as Source a, Source b, and so on. They can be moved up or down, and removed. A source may be an Extract or a Modifier (its changed text is used). |
| Pattern | "The letters a, b, c… are replaced by the sources' text, in order. Example: a-b" |
- Example: a = the project code (
NDXTEST), b = the drawing number (200100), patterna-b: the Combination readsNDXTEST-200100. - Loops are refused: a source that (indirectly) reads the Combination itself cannot be added ("That item (indirectly) reads this combination, which would create a loop.").
- A missing source (one that was deleted) makes the Combination read
Failed to combine extracts, and its checks fail on that text.
Combination quirks
The Combination rules are kept from NodePDF 26.1 so that results match. They have side effects to be aware of:
| Quirk | Example |
|---|---|
| The pattern is turned into lower case first. | DWG-a gives dwg-NDXTEST. |
| Letters in the pattern's own text are replaced too: for each source, the first a, b, c… in the pattern is replaced, wherever it is. | data-a replaces the "a" in "data": dNDXTESTta-a. |
| Letters inside text already put in can be replaced again. | a = sub, b = 01, pattern a-b: a gives sub-b, then the first "b" (in "sub") is replaced: su01-b. |
| Area text has no separators between text items. | See Text rules. |
To avoid them: keep the pattern to the source letters and separators that are not letters, such as -, _, /, . or digits, and check what the Combination Reads on the template. When a source may contain lower-case letters a, b, c… (up to the number of sources), check the result on a few test files.
Deleting an Extract
Deleting an Extract asks first and names what reads it. Those items then lose their source: Validators and Modifiers show up as not connected in their group, Lookups lose their key, and Combinations drop it from their sources. If the Extract's Validator was the document filter, the document type goes back to its file name pattern.
Related pages
- Modifiers: changing the text an Extract reads.
- Validators: checking it.
- Canvas editor and Title block: drawing areas on the template.
- Data frames: title blocks that move or scale.
- Common PDF problems: PDFs whose text is stored differently from how it looks.