pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maruan Sahyoun <sahy...@fileaffairs.de>
Subject Re: Pdfbox 2.0 Forms
Date Wed, 22 Jun 2016 09:07:30 GMT
Hi,

> Am 22.06.2016 um 10:55 schrieb DJ.Larry@gmx.de:
> 
> 
> 
> Hello,
>  
> i have a little problem after update from 1.8 to 2.0.
>  
> I open a pdf form, witch was created from libreoffice, fillout the form, and show it
with pdfrenderer.
> After update to 2.0 the fill out form fields was not shown at image.
> When i save the document to file, the fill out data are included.
>  
> Code:
> ---------------------------
> PDDocument doc = PDDocument.load(new File(Client.class.getResource("/resources/pdf/template.pdf").getFile()));
> PDAcroForm form = doc.getDocumentCatalog().getAcroForm();
> for(int i = 0; i<list.size(); i++) {
> String fieldname = "field"+(i+1);
> form.getField(fieldname).setValue(((ListObject)list.get(i)).getText());
> }
>  
> PDFRenderer pdfRenderer = new PDFRenderer(doc);
>         try {
>             ImagePanel panel = new ImagePanel(pdfRenderer.renderImageWithDPI(viewPage,
300, ImageType.RGB),zoom);
>             scpanel.setViewportView(panel);
>             panel.repaint();
>            
>         } catch (IOException e) {
>             // TODO Auto-generated catch block
>             e.printStackTrace();
>         }
> ---------------------------
> Anyone has an idea, why the form data not shown but save?


without looking at the PDF it's difficult to tell but it might be realted to https://issues.apache.org/jira/browse/PDFBOX-3356

BR
Maruan


>  
> Greets
> Lars
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message