You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Chris Joelly <ch...@joelly.net> on 2010/01/06 12:34:30 UTC
Use of AWTRenderer/Java2dRenderer
Hi all,
i managed to use the AWTRenderer within my own Swing application and
want to adapt the size of the AWT viewer window whithin the PDF preview
image is displayed.
Is it possible to set the window size and then adjust the image of the
PDF to the window size?
And is it possible to hide the debug and fop inf button which are
displayed in the toolbar?
Thanks,
Chris
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: Use of AWTRenderer/Java2dRenderer
Posted by Chris Joelly <ch...@joelly.net>.
Hi Peter,
unfortunately this seems to be more complicated then i have expected :)
I think i do not understand the renderer and its specific purpose
correct.
If i subclass the AWTRenderer and build my own renderer from it, and
then i set the renderer to the fouseragent, am i able to build whatever
component i like (jpanel, jframe...) and the renderer calls the
paintComponent method feeding in the rendered pdf image data?
And from that point i can place and do with the image data what i want?
hm. :)
Chris
On Don, Jän 07, 2010, Peter Hancock wrote:
> Hi Chris,
>
>
> I think it should be able to fetch the images of the pdf pages out of
> the renderer and display in my own frame and image component?
>
>
> This is what PreviewPanel does with help from ImageProxyPanel. If you want to
> resize the embedded PreviewPanel you call setScaleFactor method on it. You can
> listen for resizing events of your parent window, and resize the Panel
> accordingly.
>
> I hope this helps,
>
> Peter
>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: Use of AWTRenderer/Java2dRenderer
Posted by Peter Hancock <pe...@gmail.com>.
Hi Chris,
I think it should be able to fetch the images of the pdf pages out of
> the renderer and display in my own frame and image component?
>
This is what PreviewPanel does with help from ImageProxyPanel. If you want
to resize the embedded PreviewPanel you call setScaleFactor method on it.
You can listen for resizing events of your parent window, and resize the
Panel accordingly.
I hope this helps,
Peter
On Thu, Jan 7, 2010 at 8:43 AM, Chris Joelly <ch...@joelly.net>wrote:
> Hi Peter,
>
> thanks for your response. As i am curious i already looked at the source
> to investigate what possibilities i have :)
>
> Yes. This seems to be the only possibility to get rid of those two
> buttons :) Should be no problem.
>
> Whats more interesting is the sizing of the preview image and the
> possibility to align the image size to the preview dialogs frame. I
> looked through the source but did not find an easy solution for that
> issue by now...
>
> I think it should be able to fetch the images of the pdf pages out of
> the renderer and display in my own frame and image component?
>
> Is this the way of working when one needs to embed the preview images
> into an application?
>
> Thanks,
>
> Chris
>
>
> On Mit, Jän 06, 2010, Peter Hancock wrote:
> > Hi Chris,
> >
> > Did you compile fop yourself? You will need a local checkout of the
> code-base
> > to address this issue:
> > The AWTViewer instance creates a PreviewDialog instance (by calling the
> > factory method PreviewDialog.createPreviewDialog) which is a JFrame
> composed
> > of the toolbar and the page preview. The inclusion of the debug and info
> > buttons along with the frame size is declared in PreviewDialog's
> constructor.
> > You may want to create a more configurable PreviewDialog (subclassing
> > PreviewDialog and perhaps just overriding the constructor?) and then
> change
> > AWTViewer to use that instead. Recompile and create your new fop.jar by
> > running ant from the root of your local fop code-base.
> >
> > I hope that helps you,
> >
> > Peter
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
Re: Use of AWTRenderer/Java2dRenderer
Posted by Chris Joelly <ch...@joelly.net>.
Hi Peter,
thanks for your response. As i am curious i already looked at the source
to investigate what possibilities i have :)
Yes. This seems to be the only possibility to get rid of those two
buttons :) Should be no problem.
Whats more interesting is the sizing of the preview image and the
possibility to align the image size to the preview dialogs frame. I
looked through the source but did not find an easy solution for that
issue by now...
I think it should be able to fetch the images of the pdf pages out of
the renderer and display in my own frame and image component?
Is this the way of working when one needs to embed the preview images
into an application?
Thanks,
Chris
On Mit, Jän 06, 2010, Peter Hancock wrote:
> Hi Chris,
>
> Did you compile fop yourself? You will need a local checkout of the code-base
> to address this issue:
> The AWTViewer instance creates a PreviewDialog instance (by calling the
> factory method PreviewDialog.createPreviewDialog) which is a JFrame composed
> of the toolbar and the page preview. The inclusion of the debug and info
> buttons along with the frame size is declared in PreviewDialog's constructor.
> You may want to create a more configurable PreviewDialog (subclassing
> PreviewDialog and perhaps just overriding the constructor?) and then change
> AWTViewer to use that instead. Recompile and create your new fop.jar by
> running ant from the root of your local fop code-base.
>
> I hope that helps you,
>
> Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: Use of AWTRenderer/Java2dRenderer
Posted by Peter Hancock <pe...@gmail.com>.
Hi Chris,
Did you compile fop yourself? You will need a local checkout of the
code-base to address this issue:
The AWTViewer instance creates a PreviewDialog instance (by calling the
factory method PreviewDialog.createPreviewDialog) which is a JFrame
composed of the toolbar and the page preview. The inclusion of the debug
and info buttons along with the frame size is declared in PreviewDialog's
constructor.
You may want to create a more configurable PreviewDialog (subclassing
PreviewDialog and perhaps just overriding the constructor?) and then change
AWTViewer to use that instead. Recompile and create your new fop.jar by
running ant from the root of your local fop code-base.
I hope that helps you,
Peter
PreviewDialog, whilst the size of the
On Wed, Jan 6, 2010 at 11:34 AM, Chris Joelly <ch...@joelly.net>wrote:
> Hi all,
>
> i managed to use the AWTRenderer within my own Swing application and
> want to adapt the size of the AWT viewer window whithin the PDF preview
> image is displayed.
>
> Is it possible to set the window size and then adjust the image of the
> PDF to the window size?
>
> And is it possible to hide the debug and fop inf button which are
> displayed in the toolbar?
>
> Thanks,
>
> Chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>