Forum How do I...?

Is there a realtime previewer?

hyphz
Is there any program which can run a file through Prince and then display the PDF result in a pane parallel to the text editor?

I'm wondering if it might be possible to adapt a markdown editor with some modification to make a format specifically for making written documents but most of the markdown previewers use the HTML output, not the pdf.
mikeday
I think not, although it would be possible to construct one if you were sufficiently determined, either using the PDF viewers built-in to popular browsers, or using pdftoppm or a similar utility to convert the PDF output to images.
dauwhe
I know of several web apps where you can edit HTML using CKEditor, and have a PDF preview from Prince in an iframe. Infogrid Pacific's Digital Publisher is a sophisticated example, but doesn't support Markdown.
pepper69
+hyphz: I have programmed a PDF preview function using the PDF.js library from Mozilla.

To render just the element of interest, I set display: none in the CSS to most other elements except its parents. Setting the paper size to, say, A4 gives me ample space (btw: can I use an 'auto' setting for the page size? If so, I haven't tried it yet).

After rendering the PDF in PrinceXML, I open it using PDF.js and then, using the canvas element, crop all the outer white space of the resulting bitmap away before dispaying it.

mn4367
On the Mac the Preview app is already capable of refreshing a PDF file if the content is changed on the disk. All you have to do is to open the PDF in Preview and subsequently update it with Prince. As soon as the Preview app gets the focus, it reloads the PDF.

On Windows I can recommend Sumatra PDF which does the same thing. With Acrobat on Windows this doesn't work, Acrobat locks every PDF file opened in it which makes it impossible to update the PDF while being open in Acrobat.