Hi, I’m evaluating the Aspose PDF/Java library. I have a need to convert PDF’s for archiving (PDF/A, flattened forms, etc). The library seems to be doing most of what I need, but I’m having issues with a few documents. I’ve attached one that has about 20 pages of forms. The curious thing is that the vast majority of the document is flattened with no issues, however the forms on the first page seem to have lost some of their values.
I tried calling Form.flattenAllFields() per the documentation, as well as grabbing all the fields, iterating through them and calling Form.flattenField() directly (which flattenAllFields() probably does internally).
Another potential problem is performance. The flattening process is really slow. I don’t know if there are some ways to speed this up. I was thinking of getting the field list then calling Form.flattenField() using multiple threads, I just don’t know if the API can handle concurrent flattenField calls.
Hello, any update on this issue?
Hi Erich,
com.aspose.pdf.Document d = new
com.aspose.pdf.Document(“C:\pdftest\sourceForm.pdf”);<o:p></o:p>
d.getForm().flatten();
d.save(“c:/pdftest/source_Flattened.pdf”);
Hi, Thanks for getting back to me. I tried your call and yes it works much faster. However it does not actually flatten the fields. I can still edit them in the document. I’m using your Form facade class, per your documentation. This does in fact, flatten the vast majority of the fields in the doc, but with the issue I originally described. The tables on the first page seem to lose their values. And doing it this way is in fact much slower, presumably because the work is actually being done.
Form pdfForm = new Form();
pdfForm.bindPdf(“input.pdf”);
pdfForm.flattenAllFields();
pdfForm.save(“output.pdf”);
Hi Erich,
Hi, I’ve been able to download your file, it may be uneditable in Reader, but I am able to edit it in Acrobat Pro. When I use the facade Form class, most of the fields are uneditable as expected even in Acrobat Pro, but there’s the ‘corruption’ with one of first forms. I’ve attached two screenshots. One is your file, where I was able to select the dropdown in the ‘Basis’ column, which I shouldn’t be able to. The second, showing an opened 'flat3.pdf is the same as my original attachment. As you can see, say ‘Basis’ is uneditable, as expected, however the ‘Percentage of Time’ column has lost its value.
Hi Erich,
Hi is there an update on when these issues will be fixed. We are trying to make a final decision and I need at least the 35027 fixed in order to move forward.
Hi Erich,
Hi Erich,
Thanks for your patience and cooperation.
Best Regards,
Hi, any updates on this?
Hi Erich,
Hello, is there an ETA on the resolution of this issue. It’s kind of a deal-breaker for us at the moment.
Hi Erich,
Hello, following up on this again? Is there an ETA for resolution?
Hi Erich,
Hi Erich,
I am using the facades as described earlier in the thread. Has the issue been fixed? Which release? I’m currently on 10.6.2 and still see the problem
Hi Erich,
Thanks for your patience.
The team started investigating the earlier reported issues but due to complexity of these issues, they are not yet resolved. However when using source_Flattened.pdf file (for which an issue PDFNEWJAVA-35029 was logged), please try using following code snippet as during my testing with Aspose.Pdf for Java 10.8.0, the output is properly being generated. For your reference, I have also attached the output generated over my end.
[Java]
com.aspose.pdf.facades.Form pdfForm = new
com.aspose.pdf.facades.Form();
pdfForm.bindPdf(“c:/pdftest/source_Flattened.pdf”);
pdfForm.flattenAllFields();
pdfForm.save(“c:/pdftest/source_Flattened_Fac.pdf”);
<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>ZH-TW</w:LidThemeAsian>
<w:LidThemeComplexScript>AR-SA</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
<w:UseFELayout/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><!–[if gte mso 10]>
<![endif]–>
The issues you have found earlier (filed as PDFNEWJAVA-35028) have been fixed in Aspose.Pdf for Java 11.0.0.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.