Skip to main content

Lesson 6: Data frames

In lesson 2 the checks read nothing on an A1 sheet, because the title block sat on a different part of the page. A data frame solves this. You build the title block once, on one example PDF, and NodePDF looks for it on every page by the labels that are always printed in it. It finds the title block on the right or on the left, on an A1, A2 or A3 sheet, and reads every field where it actually is. One document type with the frame checks all of them, so there is no need for a document type per sheet size.

What you learn​

  • What a data frame is: cells, anchors and the frame area.
  • How to build a data frame from an example PDF.
  • How to test a data frame on other PDFs and see where it is found.
  • How to import a data frame into a document type, and the two placements.
  • What extension validators are for.

Files for this lesson​

Download Lesson 6 files (zip) and unpack it.

FileWhat it is for
template/NDXTEST-NHX-B1-00-DR-A-200100_P02_A1_landscape.pdfAn A1 sheet. The example PDF for the data frame, and the template for the document type.
check/NDXTEST-NHX-B1-01-DR-A-200101_P02_A3_landscape.pdfA3 landscape, title block on the right.
check/NDXTEST-NHX-B1-02-DR-A-200102_P02_A3_landscape.pdfA3 landscape, title block on the left.
check/NDXTEST-NHX-B1-RF-DR-A-200103_P01_A2_portrait.pdfA2 portrait.
check/NDXTEST-NHX-B1-ZZ-DR-A-200104_P01_A3FF_landscape.pdfA3FF, a long sheet (841 × 297 mm).

All five have the same title block. None of them has a planted fault: the point of this lesson is that one setup reads all of them.

How a data frame works​

A data frame is a reusable set of fields, built on an example PDF. It has three parts (see Data frames):

  • Cells: the fields it reads, each with its Modifiers and checks.
  • Anchors: texts always printed in the same place within the frame, such as the labels "CLIENT" or "SCALE", by which NodePDF finds the frame on another PDF, moved or scaled.
  • Frame area: the frame's outline on the example page; when it is not set, the box around its cells and anchors.

The frame page says how well the frame is found on its own example, for example "Found on the example by 13 of 13 anchors". Fewer than all means an anchor is not where it was defined.

Choosing anchors​

An anchor must be a text printed the same on every drawing, so the box labels work and values such as the drawing number do not. A text that appears twice on the page, such as "DATE" (the DATE box and the "Date" column of the revision table), makes a weaker anchor, and the Anchors table says so. Anchors should also be spread over the title block across and down, and there should be no more of them than the frame needs. Why is explained in Data frames › Placing the anchors.

Using a data frame in a document type​

A document type imports the data frame, with a placement: Anywhere on page N (the default) searches for the frame by its anchors on every PDF, while At a fixed spot reads every PDF where the frame was found on the template; see Data frames › Placement. A document type can add extension validators: the frame checks what is true of every drawing, such as a JOB No. that is filled in and 5 digits long, and the document type adds the specific value it expects, such as its own project's number.

Steps​

Build the data frame​

  1. Create a new project named Lesson 6.
  2. On the Doctypes tab, scroll to Data frames and choose New data frame › From an example PDF…. Pick the A1 PDF from the template folder. The frame is named after the file. Open it, and use Edit details to rename it to Title block.
  3. On the frame page, choose Auto-extract title block, then Remove all.
  4. Click the boxes CLIENT, DATE, JOB No. and REVISION, and add one check to each:
    • CLIENT: the + under Fixed value;
    • DATE: the + under Date;
    • JOB No.: the + under Pattern (5 digits);
    • REVISION: the + under Pattern ("P" + 2 digits).
  5. Choose Add 4 fields. Each field becomes a cell, and each label ("CLIENT", "DATE", "JOB No.", "REVISION") also becomes an anchor.

Add more anchors​

Four anchors work, but they should cover the whole title block across and down, so that the frame can scale in both directions. Add a few more, far from the first ones, and no more than that (see Data frames › Placing the anchors).

  1. In the Anchors section at the bottom of the frame page, choose Edit anchors. The canvas editor opens with the Anchor (A) tool.
  2. Click these labels on the title block: SCALE, DRAWING TITLE, SUITABILITY / STATUS and MODEL / CONTAINER REFERENCE. Each becomes an anchor, outlined in orange. Clicking an anchor again removes it.
  3. Go back to the frame page. The Anchors table lists eight anchors, with a note next to DATE that it appears twice. The frame says it is found on the example by all of its anchors.

The canvas editor also has the Frame area (R) tool to drag the frame's outline. You do not need it here.

Test the frame on other sheets​

  1. Choose Test files at the bottom left and drop the four PDFs from the check folder. Keep the first choice when NodePDF asks what the files are for, and choose OK.
  2. For each file, the panel says where the frame was found, for example "Found on page 1 by 8 of 8 anchors", and every cell and check is shown with its result on that file. Choose the eye button next to the left-hand A3 file (200102) to see the cells drawn where the frame was found.

Import the frame into a document type​

  1. On the Doctypes tab, drop the same A1 PDF from the template folder to create a document type, and rename it to Drawing.
  2. On the document type page, in the Data frames section, choose Import data frame and pick Title block. The frame appears as a card. Keep the placement Anywhere on page 1. The card says it is found on page 1, at scale 1.00, with the number of anchors found, and lists what each cell reads on the template.

Run the report​

  1. On the Validate tab, choose the four PDFs from the check folder, name the report Lesson 6, and choose Run report.
  2. Open the left-hand A3 drawing (200102) in the Review view. The check areas are outlined where the title block actually is, on the left of the sheet.

Exercise​

Build the data frame "Title block" on the A1 example with the four cells and eight anchors from the steps, test it on the four sheets, import it into the document type "Drawing", and run the report.

You're done when…

  • the frame page says the frame is found on its example by all of its anchors;
  • the test files show the frame found on all four sheets: A3 with the title block on the right, A3 with the title block on the left, A2 portrait and A3FF;
  • the report "Lesson 6" shows Files 4, and Results 4: 4 passed, 0 failed;
  • in the Review view of 200102, the check areas are on the left of the sheet.
In the example project

NDX Example - Text and drawings has a finished data frame, Title block, built on an A3FFF example, with 13 anchors and seven checked cells (CLIENT, PROJECT, SCALE, DATE, JOB No., Originator and Role). The document type Drawing imports it, and the A1 and A3FFF example drawings are read with the same frame. Compare its anchors with yours.

Check yourself​

Why does the frame work on the A2 portrait sheet, when the lesson 2 areas failed on the A1 sheet?
Why is the drawing number a poor anchor?
The Anchors table says an anchor "Appears 2 times on the example, so it is a weaker anchor". Should you remove it?
The frame checks that JOB No. is 5 digits. One document type must also check that it is this project's number, and other document types must not. Where do you add that check?

See also​