[ 
https://issues.apache.org/jira/browse/PDFBOX-1863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13881011#comment-13881011
 ] 

Álison Fernandes edited comment on PDFBOX-1863 at 1/24/14 2:48 PM:
-------------------------------------------------------------------

I've tested that it doesn't work, the page is drawn with the same size but in a 
different location (might be drawing in the middle of the specified size). I 
think the problem relies on PageDrawer not correctly scaling the pdf content to 
the desired dimension.


was (Author: vvolkgang):
I've tested that it doesn't work, I think the problem relies on PageDrawer not 
correctly scaling the pdf content to the desired dimension.

> Can't resize PDFPagePanel render
> --------------------------------
>
>                 Key: PDFBOX-1863
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1863
>             Project: PDFBox
>          Issue Type: Bug
>            Reporter: Álison Fernandes
>
> 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).



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to