voyent
Print Preview  XML
Forum Index -> ICEpdf General
Author Message
megaloni

Joined: 11/Mar/2011 10:02:57
Messages: 25
Offline


I am trying to use IcePDF as a print preview option for PDF documents. Is there a way to get the PDF to render in landscape mode before sending it to the printer as a "preview"?
patrick.corless

Joined: 26/Oct/2004 00:00:00
Messages: 1982
Offline


We don't have any pre-canned examples on how to do this. However you can take a look at the Thumbnail implementation as a potential template for implementing this feature.

In the ./viewer/ directory there are two class that may be of interest. The ThumbnailsPanel.java is a good point of reference for creating a custom PDF view and the PageThumbnailComponent is basically a stripped down page view which would work well for creating the pageView for the preview.
[Email]
megaloni

Joined: 11/Mar/2011 10:02:57
Messages: 25
Offline


Thanks for the direction. Is there a mechanism to use a custom PDF view with the SwingViewBuilder?
patrick.corless

Joined: 26/Oct/2004 00:00:00
Messages: 1982
Offline


Creating a custom page view is pretty easy as we have a pretty good class hierarchy and some pretty complete base classes. However the API isn't doesn't allow for the registration of a new view, you'll need to modify the viewer RI.

Each of the current view types:
org.icepdf.ri.common.views.*
OnePageView
OneColumnPageView
TwoPageView

Which all extend AbstractDocumentView implement DocumentView.

Once you've create you new view you can hook it up the DocumetViewControllerImpl method setViewType()
[Email]
 
Forum Index -> ICEpdf General
Go to:   
Powered by JForum 2.1.7ice © JForum Team