RML2PDF Test Suite - Test #16
Page
RML2PDF Test Suite - Test #16
Page
RML2PDF Test Suite - Test #16
Page
Front Page
PageCatcher integration tests
This page tests out a number of tags added to make it
easier to use PageCatcher templates.
It is important to see how these interact with the page template.
So, this document has a purple stripe and text at top and bottom which is part of
the template.
First and foremost is <includePdfPages filename="filename.pdf" pages="1,2,7-12"/>. This tag slurps in PDF pages into the current document. It begins by
outputting a page break, and leaves you "on the final page" it draws.
By default the imported PDF file will probably be drawn "over the top"
of the current page template. So, if you have a header or footer defined in a page template, and
the imported page does too, the imported one will draw over it and not vice versa. See the
examples on the next few pages.
However, if your page template defines TWO pagegraphics sections
instead of one, the second one will be drawn AFTER any flowing content, which includes
the imported pages. So, you can use a second pageGraphics section to mask out
headers and footers in the imported forms if you really need to.
The engine will output a page break BEFORE the first new
page, and leave you on the same page as the last imported one.
This behaviour was chosen carefully to facilitate template switching. Commonly one has a standard
header or footer running through a document, but may want to suppress or change it
when including pages from other applications. You can precede includePages with a template
change action, for example,
<setNextTemplate name="alt">.
This will mean that your new template is used for each page on which an included
PDF is drawn. If you don't want one, define a template called 'blank' with one
frame for content and no decorations.
After including pages, you will be left "at the top of" the last
PDF page. You could therefore flow paragraphs over the top of it if you want.
However, the most common use is simply to follow
<includePdfPages>
with
<nextFrame>
to move to the next page. Or, with
<setNextTemplate>
and then <nextFrame>
to change back to your original page template for the next page.
The "pages" attribute can be omitted to import all pages,
or can take strings like "1",
"1,2,3-5" etc.
The next two pages show a UK Inland Revenue form,
and also show switching to a different cyan-coloured template.
The preceding 2 pages should have been the tax form. And I should now be on page !
Let's add the same one again to check it does not complain:
Now we add page 1 at 90 180 and 270
Finally, we will show how the use of a second pageGraphics tags lets us mask
over annoying headers and footers. Compare the mess at the bottom of page 5 with
the cleaner version on page 7.