Resolution: Won't Fix
Affects Version/s: 1.8.7, 2.0.0
Fix Version/s: None
Component/s: Swing GUI
I tried to use PDFPagePanel to render a PDF to an applet but, I had to change my implementation because PDFPagePanel wasn't resizing the rendering so it could be bigger.
I've checked in the source code (of pdfbox-1.8.2 and in the SVN trunk), the Dimension drawDimension var that sets the rendering size isn't accessible from outside and it will draw using the dimension of the PDF Cropbox.
My current implementation to bypass this is:
- Create a JPanel
- Render the page to an image using PDPage.convertToImage(...)
- Add the image to the JPanel using JLabel picLabel = new JLabel(new ImageIcon(page.convertToImage(...)));
- Repeat for all the pages
- Set the panel as a viewport in a JScrollPane
Unfortunately, this method takes way too much time if you have to render things multiple times (~1 second for more complex pages with forms).