Forum How do I...?

How to set the open mode of pdf

csawjer
In Adobe Professional I used to cut the pdf to open as single page. How can I do this with prince?
dauwhe
csawjer
The pdf uses a single column. The default is already show single column.

I want the pdf to open in the pdf reader showing a complete full page. Default it opens now in such a way that the pdf fills out the full width of the window. It should show in such a zoom factor to fit a whole page in the reader window.

My question is: Is there a way to set this opening attribute in prince?
mikeday
I don't think there is any way to set this attribute in Prince at the moment. Checking the PDF specification, the cleanest way to do it seems to be specifying an OpenAction to go to the first page with a zoom level of "Fit". For some reason the ViewerPreferences dictionary doesn't have any way to set a default zoom level, so this is probably the best we can do. Hopefully we can support this in a future release of Prince.
csawjer
Thank you mikeday

Do I understand it correctly: This is presently not possible, but could be a feature of a coming release.?
mikeday
Right.
joelmeador
Would also like to see a solution for this in the future.

Try DocRaptor - PrinceXML web service and official PrinceXML partner

mikeday
You could try specifying "prince-pdf-open-action: command(FitPage)", however this might only work in Acrobat and not other PDF viewers. In the next build we will support other zoom options, however these also only appear to work in Acrobat unfortunately. :(

(When delivering PDF files over the web it is possible to add viewer preferences to the fragment identifier as well).
mark_anderson_us
Did anyone get this to work? I'm using acrobatDC. I tried this (from the examples)

@prince-pdf {
prince-pdf-open-action: command(FitPage)
}

Not sure where it goes in CSS though, is it a standalone item in the style node?
joelmeador
@mark_anderson_us Yeah, just in a style node outside of other directives.

Try DocRaptor - PrinceXML web service and official PrinceXML partner

mikeday
In Prince 12 we also support "prince-pdf-open-action: zoom(fit-page)" and you can also specify fit-width or fit-height or a percentage. This uses a different mechanism (a GoTo action) but again is most likely only supported by Acrobat at this time.