Summary: | PDF Extensions - Prototype | ||
---|---|---|---|
Product: | Fop - Now in Jira | Reporter: | Andreas L. Delmelle <adelmelle> |
Component: | general | Assignee: | fop-dev |
Status: | NEW --- | ||
Severity: | normal | CC: | bill.harrelson |
Priority: | P3 | ||
Version: | trunk | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Attachments: |
prototype implementation for pdf:dictionary + pdf:entry
Updated patch updated prototype; some more experimenting... |
Description
Andreas L. Delmelle
2008-07-13 14:26:22 UTC
Created attachment 22261 [details] Updated patch Added minimal support for subdictionaries and boolean entries, so the following now becomes possible: <pdf:dictionary type="catalog" xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf"> <pdf:entry name="PageMode" type="name">FullScreen</pdf:entry> <pdf:dictionary type="normal" name="ViewerPreferences"> <pdf:entry name="HideToolbar" type="boolean">true</pdf:entry> <pdf:entry name="HideWindowUI" type="boolean">true</pdf:entry> <pdf:entry name="FitWindow" type="boolean">true</pdf:entry> <pdf:entry name="CenterWindow" type="boolean">true</pdf:entry> <pdf:entry name="NonFullScreenPageMode" type="name">UseThumbs</pdf:entry> </pdf:dictionary> </pdf:dictionary> Created attachment 22286 [details] updated prototype; some more experimenting... The patch in attach disables processing of the extension in case PDF/A or PDF/X conformance is active. Better safe than sorry. For users that really don't mind the risk, we could still add a config option to override this. On another note, adding a quick-and-dirty implementation for simple PDF strings already allows adding some JavaScript as an OpenAction... Most complete example I tested so far: <pdf:dictionary type="catalog" xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf"> <pdf:name key="PageMode">FullScreen</pdf:name> <pdf:dictionary type="normal" key="ViewerPreferences"> <pdf:boolean key="HideToolbar">true</pdf:boolean> <pdf:boolean key="HideWindowUI">true</pdf:boolean> <pdf:boolean key="FitWindow">true</pdf:boolean> <pdf:boolean key="CenterWindow">true</pdf:boolean> <pdf:name key="NonFullScreenPageMode">UseThumbs</pdf:name> <pdf:name key="PrintScaling">None</pdf:name> </pdf:dictionary> <pdf:dictionary type="normal" key="OpenAction"> <pdf:name key="Type">Action</pdf:name> <pdf:name key="S">JavaScript</pdf:name> <pdf:string key="JS">this.print(false,0,this.numPages-1);</pdf:string> </pdf:dictionary> </pdf:dictionary> The JavaScript was borrowed from Bugzilla #12610, which also attempted to address this. I'd say it's about time to look into adding some basic validation, shaving off the rough edges (!!serialization!!), and adding some documentation and testcases. resetting P2 open bugs to P3 pending further review |