Sorry, did not recognize that I did not forward to entire list.


-------- Forwarded Message --------
Subject:        Re: Form Flatten
Date:   Thu, 13 May 2021 17:47:23 +0200
From:   [email protected] <[email protected]>
To:     Ranjeet Kuruvilla <[email protected]>



Am Donnerstag, dem 13.05.2021 um 09:58 +0200 schrieb Ranjeet Kuruvilla:
> One question:
>
> What is
>
> List<> widgets = field.getWidgets();
>
> widget.setLocked, widget.setLockedContent and widget.setReadOnly

you can set a field to read only using PDField.setReadOnly. The
difference to flatten is that the field still exists (and might be
changed later on to remove the read only flag) where flatten removes
the field completely and the fields content becomed part of the regular
page content.

BR
Maruan
>
> doing.
>
> Will those methods do the trick?
>
> On 12.05.21 19:44, [email protected] wrote:
> > Am Mittwoch, dem 12.05.2021 um 19:33 +0200 schrieb Ranjeet
> > Kuruvilla:
> > > If I have a value > 0 will switch off Autosize. I want Autosize
> > > to
> > > work
> > > well and not to underscale the font.
> > using a value > 0 will fix the font size so the result is more
> > predictable. Maybe you could do a small sample form with only one
> > field
> > using font size 0 and compare the flatten output of PDFBox with
> > other
> > software. I'm happy to look at the PDF before flatten and after
> > flatten
> > with/without PDFBox if you can share these. Other than that I don't
> > think that I can provide more input.
> > > BR
> > Maruan  > > > On 12.05.21 19:25, [email protected] wrote:
> > > > Am Mittwoch, dem 12.05.2021 um 17:24 +0200 schrieb Ranjeet
> > > > Kuruvilla:
> > > > > Honestly I do not know whether flatten worked. I thought it
> > > > > did,
> > > > > but
> > > > > now
> > > > > that You asked, I am not sure anymore.
> > > > > > > > > The /DA String is in some cases
> > > > > > > > > /Arial 0 Tf 0 g
> > > > /Arial 0 means that the font being used is Arial and the
> > > > content > > > should scale into the form field rectangle.
> > > > > > > I sthat the field where you are experiencing a difference
> > > > between
> > > > how
> > > > PDFBox and iText handle the display of the value?
> > > > > > > > and in other cases or
> > > > > > > > > /Arial 6 Tf 0 g
> > > > Do you also get differences for fields with such definitions?
> > > > Having a
> > > > value > 0 fixes the font size so that in this case 6pt shall be
> > > > used.
> > > > > > > > and in other cases or
> > > > > > > > > /Arial 14 Tf 0 g
> > > > > > > > > .
> > > > > > > > > I never open the form via Adobe until it comes out of the
> > > > > last
> > > > > Software.
> > > > > I open it via PDFBox 2.0.23. A C++ Backend generates the PDF
> > > > > and
> > > > > sends
> > > > > it via Socket to the Webservice with PDFBox.
> > > > > > > > > On 12.05.21 17:00, [email protected] wrote:
> > > > > > Hi
> > > > > > > > > > > Am Mittwoch, dem 12.05.2021 um 14:54 +0200 schrieb
> Ranjeet
> > > > > > Kuruvilla:
> > > > > > > I can not provide a sample, but a picture. So the context
> > > > > > > is
> > > > > > > as
> > > > > > > following. The PDF will be used by other software. The
> > > > > > > processing
> > > > > > > Software however has a tendency to resize the fontsize.
> > > > > > > > > > > > If I understand correctly when you say it fails
> what it
> > > > > > does is
> > > > > > that
> > > > > > after flatten with PDFBox the size of the font is reduced
> > > > > > compared
> > > > > > to
> > > > > > doing flatten with iText? But flatten itself works?
> > > > > > > > > > > Can you provide the /DA string for the sample
> field you
> > > > > > mentioned?
> > > > > > When
> > > > > > you open the form using Adobe Reader before flatten - how
> > > > > > does
> > > > > > the
> > > > > > sample field look like?
> > > > > > > > > > > BTW. if there is no specific visual appearance but
> it's
> > > > > > being
> > > > > > created
> > > > > > on the fly the PDF specification - other than provding the
> > > > > > basics
> > > > > > of
> > > > > > how to create the visual appearance - doesn't provide the
> > > > > > details
> > > > > > about
> > > > > > laying out data within a form field (padding, line spacing
> > > > > > ...).
> > > > > > The
> > > > > > PDFBox tests typically compare the results with how the
> > > > > > results
> > > > > > would
> > > > > > look like in Adobe Reader. So it might well be that the
> > > > > > result
> > > > > > differs.
> > > > > > > > > > > Without a sample PDF it will be difficult to further
> > > > > > analyze
> > > > > > and
> > > > > > potentially fix.
> > > > > > > > > > > BR
> > > > > > Maruan
> > > > > > > > > > > > > > > > > Before Software that processes PDF
> > > > > > > After Software that processes PDF
> > > > > > > With IText I did
> > > > > > >                      for(String key: readonlyFields)
> > > > > > >                      {
> > > > > > >                               
> > > > > > > stamper.partialFormFlattening(key);
> > > > > > >                      }
> > > > > > >                      stamper.setFormFlattening(true);
> > > > > > > The result is that all fields, that were readonly, will
> > > > > > > no
> > > > > > > longer
> > > > > > > be
> > > > > > > changed and the fontsize is acceptable.
> > > > > > > That is not the case in PDFBox. I tried
> > > > > > >                     acroform.flatten(readonlyFields,
> > > > > > > true);
> > > > > > > but it does not do the job in PDFBox (see 2. Picture
> > > > > > > above).
> > > > > > > What
> > > > > > > is
> > > > > > > the PdfBox equivalent?
> > > > > > > On 12.05.21 08:37, Maruan Sahyoun wrote:
> > > > > > >  
> > > > > > > > Hi
> > > > > > > > > > > > > > > could you describe what doesn‘t work in
> more detail?
> > > > > > > > What
> > > > > > > > is
> > > > > > > > the
> > > > > > > > expected outcome and what do you get? Is it for all
> > > > > > > > files
> > > > > > > > or
> > > > > > > > only
> > > > > > > > some? Do you have a sample file to replicate which you
> > > > > > > > could
> > > > > > > > upload
> > > > > > > > to a shared location?
> > > > > > > > > > > > > > > BR
> > > > > > > > Maruan > > > > > > > > > > > > > >  
> > > > > > > > > Am 12.05.2021 um 08:04 schrieb Ranjeet Kuruvilla <
> > > > > > > > > [email protected]>:
> > > > > > > > > > > > > > > > > I have a problem with Form
> flattening. I am using
> > > > > > > > > PDFBox
> > > > > > > > > 2.0.23.
> > > > > > > > > I try
> > > > > > > > > to flatten fields, that are filled already. But that
> > > > > > > > > does
> > > > > > > > > not
> > > > > > > > > work.
> > > > > > > > > > > > > > > > > Flattening is important, because I do
> not want any
> > > > > > > > > other
> > > > > > > > > Software
> > > > > > > > > to
> > > > > > > > > change the font size of the readonly fields.
> > > > > > > > > > > > > > > > > > > > > > > > > But it seems
> > > > > > > > > > > > > > > > > AcroForm.flatten(readOnlyFields, true)
> does not work.
> > > > > > > > > > > > > > > > > > > > > > > > >
> -----------------------------------------------------
> > > > > > > > > ----
> > > > > > > > > ----
> > > > > > > > > ----
> > > > > > > > > ----
> > > > > > > > > To unsubscribe, e-mail: > > > > > > > >
> [email protected]
> > > > > > > > > For additional commands, e-mail: > > > > > > > >
> [email protected]
> > > > > > > > > > > > > > > >
> -------------------------------------------------------
> > > > > > > > ----
> > > > > > > > ----
> > > > > > > > ----
> > > > > > > > --
> > > > > > > > To unsubscribe, e-mail: > > > > > > >
> [email protected]
> > > > > > > > For additional commands, e-mail: > > > > > > >
> [email protected]
> > > > > > > > > > > > > >  

-- 
-- 
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

Reply via email to