It looks like they behave the same way. I added the generated files to the Dropbox folder. Andrea
Il giorno lun 13 mag 2019 alle ore 22:38 Maruan Sahyoun < [email protected]> ha scritto: > Hi Andrea, > > would you mind testing with 2.0.14 and 2.0.13 just to see if that is a > regression? > > BR > Maruan > > > Understood, thanks for clarifying. > > So in my algorithm, given I don't modify the form I could use > > refreshAppearance=true only when the NeedAppearance=true in the form, > > correct? > > Andrea > > > > Il giorno lun 13 mag 2019 alle ore 16:26 Maruan Sahyoun < > > [email protected]> ha scritto: > > > > > Hi, > > > > > > in theory you should get the same result but the rendering is > dependent on > > > the forms content stream. Letting PDFBox reconstruct > > > the content stream might leasd to differences compared to Adobe Reader > as > > > the details of formatting content such as text is not > > > part of the PDF specification. Adobe is using it's own layout model > which > > > is not published so the current state was achieved by > > > looking at sample PDFs and reworking that. > > > > > > I'll look into the PDF provided to get an idea where the difference is > > > coming from. > > > > > > Having said that - as long as you didn't change the form content - > using > > > refreshAppearance=true should't be neccesary when > > > flattening. > > > > > > BR > > > Maruan > > > > > > > Hi, we are having some issue when we try to flatten the form in the > file > > > > f1040_sample.pdf > > > > We get slightly different results depending on the value of refresh > > > > appearance, in particular when we set it to true we get a slightly > wrong > > > > positioning of the text field value. > > > > Shouldn't we expect the same result in both cases? > > > > This is the test code (PDFBox 2.0.15): > > > > > > > > @Test > > > > public void testFlatten() throws IOException { > > > > PDDocument testPdf = PDDocument.load(new > > > > File("/home/torakiki/tmp/delete/f1040_sample.pdf")); > > > > PDAcroForm form = testPdf.getDocumentCatalog().getAcroForm(); > > > > List<PDField> fields = new ArrayList<PDField>(); > > > > > > > > > > > > fields.add(form.getField("topmostSubform[0].Page1[0].YourSocial[0].f1_04[0]")); > > > > testPdf.getDocumentCatalog().getAcroForm().flatten(fields, > > > false); > > > > File file = new > > > > File("/home/torakiki/tmp/delete/f1040_sample_pdfbox_no_refresh.pdf"); > > > > testPdf.save(file); > > > > } > > > > > > > > I isolated the field in the test case but we also get the same result > > > when > > > > flattening the whole form, I included the Acrobat version of the > > > flattened > > > > pdf. > > > > If we flatten the whole form with refreshAppearance=false we get > pretty > > > > much the same result as Acrobat, same number From XObjects, but if we > > > > flatten with refreshAppearance=true we get a lot of Form XObjects (I > > > guess > > > > one for each field, even empty ones) and a slightly wrong > positioning of > > > > the text field. > > > > Could you please help me understand what's the issue here? > > > > Thanks > > > > > > > > Here the files: > > > > > > > > https://www.dropbox.com/sh/rmywlrmftolvwil/AADcz1Djfe59YAm8ykKnpIN5a?dl=0 > > > -- > > > Maruan Sahyoun > > > > > > FileAffairs GmbH > > > Josef-Schappe-Straße 21 > > > 40882 Ratingen > > > > > > Tel: +49 (2102) 89497 88 > > > Fax: +49 (2102) 89497 91 > > > [email protected] > > > www.fileaffairs.de > > > > > > Geschäftsführer: Maruan Sahyoun > > > Handelsregister: AG Düsseldorf, HRB 53837 > > > UST.-ID: DE248275827 > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [email protected] > > > For additional commands, e-mail: users-help@ > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >

