Forum How do I...?

How to get the rendered HTML as shown in the samples?

melusina
The samples page of princexml (https://www.princexml.com/samples/) shows links to pdfs, but also to html versions. I desperately searched for documentation on how to get such an output html (instead of the pdf) for my own transformations (I work from the command line not the server install) but I could not find anything. I assume it has to do with two-pass workflow, but still, I do not know how to get the rendered html before it is turned into a pdf.
mikeday
You wish to capture the HTML given to Prince? Is this because you are running JavaScript, or some other reason?
melusina
No, in fact I have direct access to the input HTML. My understanding was that there is also an intermediate HTML, one that is already processed in parts by prince but not already turned into a PDF.

See also https://stackoverflow.com/questions/25856269/convert-html-containing-mathjax-markups-to-pdf/30562077 : "(see also: Render your html in the browser such as Chrome first. Get the entire document (not the source but actual rendered document) saved into html file and then use it as input to prince. You can get entire rendered document from browser javascript console.)"


But maybe I got something wrong here.

The background for this need is the fact that I have defined some CSS rules such as `text-align: justify` for `body` that work in the source HTML but that are not applied in prince so I thought I could use the inspector on the half-way processed HTML and see what is overruling my rule after prince started to process the source.
mikeday
There is no intermediate HTML, the StackOverflow question relates to a slightly different use case of performing JavaScript processing in the browser and then taking the output of that to use with Prince.

If you have some CSS rules that are not applying as expected we may be able to help you reduce it to a simpler test case if you can attach a sample document here or email me (mikeday@yeslogic.com) the HTML and CSS.
melusina
Ok, I misinterpreted the logic of the processing but was able to now debug the problem. Thanks.
melusina
Ok, I misinterpreted the logic of the processing but was able to now debug the problem. Thanks.