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

Andreas Lehmkühler commented on PDFBOX-481:
-------------------------------------------

During my debugging I found an issue concerning the scaling of lines. Some 
lines are too thick. e.g. on the last page the 2 lines for the signature.
The solution is to scale the linewidth with the current transformation matrix. 
But at this point It is important that the scaling is done just before the path 
is stroked and not during setting the linewidth as implemented in my former 
patch (see PDFBOX-454). With version 782401 everything seems to be ok.

> renaming a field and not able to set value to the saved PDF document ...
> ------------------------------------------------------------------------
>
>                 Key: PDFBOX-481
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-481
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel.AcroForm
>    Affects Versions: 0.7.3
>         Environment: Windows XP Professional SP3, jre1.6.0_07/jdk1.6.0_11 , 
> PDFBox-0.7.3.jar
>            Reporter: Venkatesh Prasad.B.K.
>             Fix For: 0.7.3
>
>         Attachments: PDFBOX481-Source_Target_filled.pdf, Source_Original.pdf, 
> Source_Target.pdf
>
>
> I will explain what I want to do.
> 1. I have a PDF Document with Fields and let us call this 
> 'Source_Original.PDF'. The field names in this PDF document have to be 
> renamed and stored as 'Source_Target.PDF'. I then have to set/change the 
> values of form-fields in 'Source_Target.PDF'.
> The issue I am facing is given below:
> 1. I renamed the form fields in 'Source_Original.PDF" using the code given in 
> my earlier mail (below) and saved it as 'Source_Target.PDF'.
> 2. I checked the form fields in 'Source_Target.PDF" and form-fields were 
> renamed correctly.
> 3. However when I tried to set/change values of form-fields in 
> 'Source_Target.PDF' using PDFBox code, I was not able to do so.
> I used iText to set/change values of form-fields in 'Source_Target.PDF' and 
> was successful. But we want to use only PDFBox.
> To summarize - We are not able to set/change values of form fields of a PDF 
> Document whose form-fields have been renamed. There is no issue if the 
> form-fields are renamed manually using Adobe Acrobat 9. The issue is only
> when the form-fields are renamed using PDFBox option - 
> setPartialName(newFieldName);
> > Only to be sure, changing values in 'Source_Original.PDF'  works with the 
> > same code you use to 
> > manipulate 'Source_Target.PDF'??
> Yes
> I have attached the 2 files - "Source_Original.PDF' and 'Source_Target.PDF',
> ----- Code
>                               try
>                               {
>                                       PDDocument pdfDocument = 
> PDDocument.load(pdfSource);
>                                       try
>                                       {
>                                               if (pdfDocument.isEncrypted())
>                                               {
>                                                       pdfDocument.decrypt("");
>                                               }
>                                               PDDocumentCatalog docCatalog = 
> pdfDocument.getDocumentCatalog();
>                                               PDAcroForm acroForm = 
> docCatalog.getAcroForm();
>                                               if (acroForm != null)
>                                               {
>                                                       List pdfFields = 
> acroForm.getFields();
>                                                       if (pdfFields != null)
>                                                       {
>                                                               PDField 
> pdfField;
>                                                               for (int i = 0; 
> i < pdfFields.size(); i++)
>                                                               {
>                                                                       
> pdfField = (PDField) pdfFields.get(i);
>                                                                       String 
> fieldName = pdfField.getPartialName();
>                                                                       if( 
> pdfFieldNames.containsKey(fieldName) ){
>                                                                               
> String newFieldName = (String) pdfFieldNames.get(fieldName);
>                                                                               
> pdfField.setPartialName(newFieldName);
>                                                                       }
>                                                               }
>                                                               
> pdfDocument.save(pdfOutput);
>                                                       } else {
>                                                               return "No Acro 
> Form Fields found in PDF Document " + pdfSource + "!";
>                                                       }
>                                               } else {
>                                                       return "PDF document " 
> + pdfSource + " not able to access!";
>                                               }
>                                       } catch (Exception e) {
>                                               return "PDF Document " + 
> pdfSource + " is encrypted! Cannot process.";
>                                       }
>                                       pdfDocument.close();
>                               } catch (Exception e) {
>                                       return "PDF Document " + pdfSource + " 
> cannot be found!";
>                               }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to