Adding a Header or Footer to Documents in a Document Export Query
  • 12 Jan 2024
  • 2 minute read
  • Dark
    Light
  • PDF

Adding a Header or Footer to Documents in a Document Export Query

  • Dark
    Light
  • PDF

Article Summary

Sometimes a third-party system requires document metadata to be included on the document itself (as opposed to being in an associated index file). To accomplish this, the required information must be added to the pdf:xml export in the Document Export query. Using the Configurable Joins - Document base this can be accomplished by creating the pdf:xml export using a Subquery Export.

Building the Standard Parts of the pdf:xml Subquery Export

Start by recreating the standard portions of the pdf:xml export.

Important!

These steps must be followed exactly for the Document Export query to function as intended.

  1. In the Exports section, next to the Export button, select the subquery button. An Edit Part popup appears.

    Subquery Button
  2. Set the following configurations:

    • Name: pdf:xml

    • Output: XML

    • Node: batch

  3. In the Exports area, click the Export button. An Insert Query Part popup appears.
    Edit Part Subquery Export

  4. In the Direct Exports section, under the Document category, select Record GUID.

  5. Click Continue. The export now appears on the Edit Part popup.
    GUID Export Selected

  6. Hover over the Document Record GUID export and select the edit (pencil) icon. An Edit Part popup appears.
    Edit Export Name

  7. Change the Name value to "@id" and click Save. The export is renamed on the Edit Part popup.
    Rename Export

  8. In the Exports area, to the right of the Export and subquery export buttons, click the Literal button. An Edit Part popup appears.
    Literal Button

  9. Set the following values:

    Name: @mode

    Literal: stream

  10. Click Save. The literal appears on the Edit Part popup.
    Add Literal

  11. In the Exports section, click the Export button. An Insert Query Part popup appears.
    Export Button

  12. In the Direct Exports section, under the Document category, select Scope.

  13. Click Continue. The export now appears on the Edit Part popup.

  14. Hover over the Document Scope export and select the edit (pencil) icon. An Edit Part popup appears.

  15. Change the Name value to "@scope" and click Save. The renamed export appears on the Edit Part popup.

  16. In the Exports section, click the Export button. An Insert Query Part popup appears.
    Export Button

  17. In the Direct Exports section, under the Document category, select XML.

  18. Click Continue. The export now appears on the Edit Part popup.
    XML Export Selected

  19. Hover over the Document XML export and select the edit (pencil) icon. An Edit Part popup appears.
    Edit XML Export

  20. Change the Name value to "node()" and click Save. The renamed export appears on the Edit Part popup.
    Rename XML Export

  21. Click Save to complete and save the query.
    Saving Subquery Export  

Add an @header Attribute with Desired Metadata

Before adding the @header attribute to your pdf:xml export, consider which datapoints need to be included and ensure that the joins to access these datapoints are configured appropriately. Refer to our Configurable Joins - Joining documentation as needed.

Important!

Though we are adding an @header attribute to our pdf:xml export, this data will display only within the footer of the resulting document.

1. Open the pdf:xml Subquery Export created above.

2. Add a nested Subquery Export by selecting the Subquery icon next to the Export button

  • Name: @header

    • Output: Concatenate

header_nested_subquery_export.png

3. Add the desired datapoints with literal separators as needed for readability.

header_nested_subquery_export_with_datapoints.png

4. Save the @header nested subquery export.

pdfxml_with_header_at_botton.png

5. Reorder the exports within the pdf:xml subquery export so that the node() export is at the bottom.

6. Save the pdf:xml subquery export.

pdfxml_reorder.png
pdfxml_export_complete_full_query.png

Was this article helpful?