You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Chance Rose <ch...@gmail.com> on 2014/07/09 21:27:34 UTC

zoom

Is there any way to implement zoom capabilities with pdfbox?

I can provide source code if necessary but essentially what I have done so
far is this:

- Extend JPanel into ZoomJPanel. In this class I added zoom methods which
keep track of the scale factor. I override the paint method which applies a
AffineTransform to the graphics object which scales the graphic by the
scale factor. I then call super.paint(Graphics g).

-Create a new PDFReader class (called NewPDFReader) which is the same as
PDFReader from org.apache.pdfbox except I added a couple buttons to the
JFrame and also declared document Panel as an instance of ZoomJPanel (see
above) so that I can make calls to the zoom methods.

This sort of works but I am having problems with the graphics object
drifting around.

Is there an easier way to do this or maybe some way that I could improve
the way I'm doing in now?

Re: zoom

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 09.07.2014 21:27, schrieb Chance Rose:
> This sort of works but I am having problems with the graphics object
> drifting around.

What do you mean?