Forum How do I...?

Guaranteeing content production

davidq
We've just discovered Prince and it looks extremely useful.

One concern: if we produce some XML and use Prince to convert it to a PDF, what guarantee can we give to the document recipient that the content of the PDF is precisely the same as the XML originally generated?

I can see a potential legal minefield here and it would be nice to know the answer before we get hit!

David Q

mikeday
One concern: if we produce some XML and use Prince to convert it to a PDF, what guarantee can we give to the document recipient that the content of the PDF is precisely the same as the XML originally generated?

XML and PDF are very different formats, so it is not really meaningful to talk about them having precisely the same content. For example, an XML file can contain comments, like this:

<p>This is a paragraph</p>
<!-- This is a comment, which will not be in the PDF output -->
<p>This is another paragraph</p>

Comments will not be included in the generated PDF. More generally, the generated PDF depends on the CSS styles that are applied to the XML. A paragraph element that has "display: none" applied to it will not be included in the generated PDF. For that matter, a paragraph that has "color: white" applied to it will be included in the PDF, but may not be visible to the reader if it occurs on a white background. (This is similar to the legal issues of producing a contract with fine print which is too small to be read with the naked eye).

Assuming that the CSS that you apply to the XML does not hide any significant elements, and styles the XML in a way that the recipient is expecting, then the content of the PDF can be considered to faithfully represent the original XML. But as you can see, this is a decision requiring the involvement of both parties, and not a technical question that can be answered in isolation.