Forum How do I...?

... make previewing results easier?

markushausammann
Hi,

Sometimes, working with PDFs can be very tedious. You change some CSS, refresh your pipeline, download the PDF, open the pdf, check how it was rendered, rinse, repeat. The problem with this is that many things are obviously not rendered the same way as they would be in the browser. It would be extremely helpful to have a browser plugin (or similar) that can render a page as if it was the PDF but can be auto-refreshed.

Do you know of any such existing workflows or do you have anything like that on the roadmap?

Best
Markus
mikeday
An updated Prince GUI environment would be nice, but will take some time to develop. :(
markushausammann
Hi Mike, is there a GUI environment for MacOS? Can you think of any other way to get more immediate results?
mikeday
We don't have a GUI for Mac yet, no. If you are working locally, some PDF viewers will automatically refresh every time the PDF file changes, which is handy as you can trigger Prince from your text editor.
John
Hello Markus,

if you know task runners such as grunt or gulp, you may achieve the desired result by watching changes to the CSS file and automatically triggering PDF creation.

but it seems you are not rendering the PDF locally?

greetings,
John
markushausammann
Hi guys,

We are using gulp and I already thought of such a solution. We're not rendering PDF locally but I think we should for dev purposes. The problem is that nobody seems to quite know exactly what the rendering differences between pure local prince and remote DocRaptor are. I'm working on a solution where we would switch out DocRaptor for Prince on the local machine and add PDF rendering to gulp watch plus look for a PDF viewer with live updates. This would make our workflow SOOO much easier. The other way it's a big hassle with ngrok on vagrant (very slow requests to DocRaptor) and no live results.

Cheers
Markus
dbrydon
Hi. We are looking for live preview for html+css typesetting of large books primarily for print.
At this point Windows is our environment.

I don't know of any pdf viewer that would refresh quickly enough to be called live for books of hundreds of pages with lots of graphics.

Please update if anyone knows of live preview solutions for windows.

Thanks, David
pjrm
There are two aspects of this: quickly regenerating a PDF with updated styling; and quickly seeing the updated PDF.

In the recent thread https://www.princexml.com/forum/topic/4640/faster-style-iteration I suggested approaches such as running Prince on just a small part of the document, to get around the problem of having hundreds of pages to render.

evince is one PDF viewer that refreshes its display as soon as the underlying PDF changes; though most PDF viewers make it not too difficult to reload the PDF, whether with a keyboard shortcut, or by going to the next then previous page.