User-facing documentation for Papercraft XML templates and the X39.Solutions.PdfTemplate compatibility bridge.
This manual is for template authors who design Papercraft PDF documents with XML templates. It explains the document concepts first, then points to small task examples and reference pages.
Papercraft turns XML templates into PDF documents and images. During the migration, existing
applications can still consume it through the X39.Solutions.PdfTemplate compatibility package.
A template author writes document parts as XML elements such as text,
border, table, image,
line, pageNumber,
chart controls and optional qrCode or
ZXing barcode controls.
Templates can also read values supplied by the application, such as @CustomerName,
and can use template-language blocks such as @if and
@foreach to include or repeat content.
Use this manual when you need to design or adjust the XML template for a PDF document without changing application code. Start here if you need to know where page content belongs, which control to use, how to insert data, or how to make visible layout changes such as spacing, borders and tables.
Developer setup, custom controls, renderer backend choices and resource resolvers belong in the developer integration appendix and renderer backends pages, not in the beginner chapters.
Begin with the smallest visible template:
<?xml version="1.0" encoding="utf-8"?>
<template>
<body>
<text fontsize="18">Hello from a template</text>
</body>
</template>
Next, read Introduction, then First document.
template.style and related style blocks.@if, @switch, @foreach, @for, @var and @alternate.