xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremias Maerki <...@jeremias-maerki.ch>
Subject Re: How navigate/scroll inside the PreviewPanel
Date Mon, 07 Jan 2008 08:50:56 GMT
Just a second, I think you're mixing things: PreviewPanel is not a "PDF
view". It's displaying the rendered document using Java2D/AWT. The PDF
format is not involved at all.

To your problem: If you switched to PDF (instead of PreviewPanel), i.e.
embed a PDF-capable browser (or Acrobat Reader directly) in your Swing
application you could make use of PDF named destinations like the
anchors in HTML. This is done using the fox:destination extension
element (which I just noticed is not documented anymore although it has
been reimplemented in the latest release, but I'll fix that right away).

How a browser or Acrobat Reader is embedded in a Swing application I
can't tell you off-hand but I'm sure there are solutions on the web
somewhere. I've done it in SWT once where it's certainly easier. But the
whole thing could become platform-dependent that way which is bad.

So the platform-independent solution would be to teach the AWTRenderer
(which is used to display the rendered document in PreviewPanel) to
process the named destination elements to keep a list of the
anchors/named destinations. You could then let the PreviewPanel jump to
the right place.

I hope that gives you a few first pointers where you can go.

On 27.12.2007 17:37:27 Giulio Buccini wrote:
> 
> Hi,
> 
> I'm developing a java stand-alone application structured on the screen as
> follows:
> 
> 1) a tree data structure on the left side of the screen (a JTree
> essentially);
> 
> 2) a pdf view of tree data on the right side of the screen.
> 
> My target is to provide a clear view of the final pdf document to the user. 
> FOP code is re-generated after any data modification (add, remove, edit and
> so on) operated on the tree.
> 
> I'm migrating my application from an HTML view to a PDF view cause of
> terrible troubles rising up when HTML is printed on a A4-size paper.
> 
> As I understand, the only component that I can use to embed a PDF view in my
> application is the PreviewPanel. Nevertheless, this component is very
> limited: user can only jump across pages.
> 
> What I need is a trick or a workaround to implement following behaviour:
> 
> "When user click on a element in the tree the preview panel automatically
> jumps to the right page and scroll to right place."
> 
> Somebody knows a workaround to make this possible?
> 
> In my old html-version of my application I have solved this problem by
> inserting many hidden anchor elements in the HTML code and using the
> "scrollToLink" method of the JDesktop pane component. Now I'm in troubles
> cause I cannot apply the same solution with the generated pdf document...
> 
> Suggestions? Ideas?
> 
> 
> -- 
> View this message in context: http://www.nabble.com/How-navigate-scroll-inside-the-PreviewPanel-tp14515390p14515390.html
> Sent from the FOP - Users mailing list archive at Nabble.com.



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message