Why do I see garbled characters on my page?
This usually happens when Prince is not able to find a suitable font, or might be using the wrong font. Try installing a font that supports your script, or try using a different font in your stylesheet. See also: Fonts and Redefining the generic font families.
Why is all the document's content displayed on one page, while I was expecting it to take several pages?
Typically a document displays on only one page, even though it should be much longer, because it is wrapped up in an absolutely positioned or in a floated block element, or in a single inline-block element, which Prince cannot split over several pages. This issue does not affect browsers, because they don't paginate. See also: Paged Media.
Why does my PDF exported to PDF/x-1a not show the transparent background?
Different PDF profiles have different requirements. The PDF/x-1a profile does not support transparency. See also: PDF Profiles and Color Management and PDF Profiles
How can I create tooltips in the PDF file?
PDF tooltips can be enabled with the CSS property prince-tooltip
like this:
*[title] { prince-tooltip: attr(title) }
However, please note that tooltips are not a standard PDF feature, and they may only work in Adobe Reader and Adobe Acrobat and may not be visible in other PDF viewers, such as web browsers.
How can I make an element, such as an image or some text, appear on each page of the PDF document?
For this purpose you can use the @page
page regions. See: Page regions and Watermarks.
How can I apply CSS styles in page regions?
You cannot add style to generated content in the page regions, except for
some inline style properties, such as color and
font. A possibility for using more complex styling is to use
the flow()
CSS function. See Using generated content in page regions,
Copying text content from the document and Taking elements from the document.
However, this will remove the element from the document.
Does Prince support JavaScript?
Yes, Prince supports JavaScript - remember to enable it with the
--javascript
command-line option (see Applying JavaScript in Prince). However,
there are some limitations: Prince produces printed documents, and interactive
events make no sense in this context. Also, modifications of the document
after layout has finished are not possible. See: Scripting.
Can I modify the document after layout has finished?
No, unfortunately this is part of the inherent limitations of printed media - see JavaScript in Printed Media. However, JavaScript can run after layout is done, and the output can be used for a second run of Prince - see The "Two-Pass" Solution.
Can I include content of external files in an XML file?
Yes, this is done by means of XML Inclusions (XInclude). Note that
XInclude is disabled by default, and can be enabled with the
--xinclude
command-line option. Also note that XInclude only applies to XML files. To
apply it to HTML files, the input format needs to be specified with the
--input
command-line option.
How can I run Prince on Windows without showing the UI?
On Linux, you typically run Prince with the following command:
prince file.xml -o file.pdf
On Windows, you replace the name of the exectuable with
Prince\Engine\bin\prince.exe
in the installation directory
(see Windows installation layout), which is the command-line program.
See also Command-line Reference.