Forum How do I...?

Generated Content in legacy version

Riker10
Hey team! I have a dependency on a legacy version of princexml (12.5)
According to the documentation, generated content features should be available in this version but I can't seem to make it work.

From the docs here: https://www.princexml.com/doc/12/doc-refs/#prop-content
I see: "The content property can be used to insert text and other content into the original document."

In the generated content docs here: https://www.princexml.com/doc/12/doc-prince/#gen-content
I see: the url(url) function, returning the text content at the given URL,

That's exactly what i want to be able to do. Include the contents of a remote file into my PDF. The way I'm attempting to do this is as follows:

<html>
<head>
<style>
h1 { content: url(http://domain/file) }
</style>
</head>
<body>
<h1> Test </h1>
</body>
</html>

This doesn't work. Am I doing this wrong? Is there some commandline argument I need to be adding when doing the conversion?

Thanks!
mikeday
This only works for images, if you want to include a HTML file that will need to be done using some other way, for example loading it with JavaScript, or applying Prince to multiple input documents.
Riker10
Thanks Mike! I may be able to accomplish this with javascript. I'm essentially trying to generate the same PDF a bunch of times but in each one I want to include the contents of one in a series of different HTML files into one section of hte resulting PDF.

I attempted to do this just now using
<style>
@prince-pdf { prince-pdf-script: url(http://domain/file); }
<style>

but the javascript didn't end up being included in the resulting pdf. Am I doing this correctly?
mikeday
The prince-pdf-script property is for including AcroScript in the generated PDF file, if you want to apply JavaScript to the HTML you can use the <script> element or the --script command-line option.