Skip to content

About

Example repository for the XTS XML typesetting system

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

This repository contains examples for the XTS XML typesetting system, an open source database publishing system that creates PDF from XML data.

Every example is a directory with a layout.xml, usually a data.xml, and a Readme.md that says what the example shows and which commands to look at. result.pdf is the output of the current XTS release, firstpage.png a preview of its first page.

To run an example, install XTS from the releases page and run xts inside the example directory. The result is xts.pdf. The manual explains the commands.

Introduction

Start here. The examples build on each other, from the first PDF to a multi-page document with a table of contents.

Description Preview
Hello World -- Minimal layout: one Record, one TextBlock, one Value
Data processing 1 -- Barcodes per data element using Record and ProcessNode
Data processing 2 -- The same barcodes using ForAll and sd:grid-width()
Text formatting -- Four ways to get bold, italic and lists into text
Simple table -- Two column price table from data with CSS alignment
Images -- PDF, JPEG, PNG, placeholder and missing image handling
Mail merge -- One form letter per record with master page and areas
Planets -- Two-run booklet with table of contents, bookmarks and links

Showcase

Description Preview
The Gnat and the Bull -- Fable on a full-bleed photo with embedded fonts and CSS

Technical

Description Preview
Base64 decode -- Image from base64 data via sd:decode-base64 and sd:file-contents
ZUGFeRD invoice -- PDF/A-3b invoice with the embedded Factur-X XML

Checking the examples

Every example is run and compared against its result.pdf on each push, see the workflow. To do the same locally you need XTS and Rake:

rake qa

Every example is run with --suppressinfo, which makes the PDF reproducible, and the result is compared with result.pdf by hash. Any byte difference counts, also one you cannot see, such as in the metadata or the structure tree. A differing example keeps its xts.pdf, the workflow uploads these files. rake qa[introduction/planets] checks one example, XTS=path/to/xts rake qa uses another binary than the one in PATH.

rake compare tells a visible difference from one only in the bytes: for each example whose hash differs, xts compare renders both PDFs and compares the pages, which needs ImageMagick and Ghostscript. A visible difference produces pagediff-NN.png files in the example directory and a compare-report.html.

After changing an example, rake regenerateqa[introduction/planets] writes its new result.pdf and firstpage.png; without the argument it regenerates all of them. rake clean removes the files a run leaves behind.

About

Example repository for the XTS XML typesetting system

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages