pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chance Rose <chanceros...@gmail.com>
Subject zoom
Date Wed, 09 Jul 2014 19:27:34 GMT
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?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message