Hello everybody,
I would like to ensure that a pre-existing PDF/UA document is still conformant
after flattening its form.
The issue is that the added text elements which are displaying the text fields
contents are not marked accordingly.
My current approach is to read all PDFormXObject parse
ixup)
>
> BR
> Maruan
>
> Am Donnerstag, dem 23.12.2021 um 15:52 +0200 schrieb Constantine
> Dokolas:
> > I need to make sure I understand how flattening is supposed to
> > operate.
> >
> > I have a PDF that, as far as I can tell, was an AcroForm that
&g
existing widget annotations.
PDDocumentCatalog.getAcroForm(PDDocumentFixup)
BR
Maruan
Am Donnerstag, dem 23.12.2021 um 15:52 +0200 schrieb Constantine
Dokolas:
> I need to make sure I understand how flattening is supposed to
> operate.
>
> I have a PDF that, as far as I can tell, was
I need to make sure I understand how flattening is supposed to operate.
I have a PDF that, as far as I can tell, was an AcroForm that underwent
some sort of partial flattening. What I see when opening it with the
debugger, is a normal AcroForm object but without any fields. Instead, the
widget
samples to showcase the flattening problem.
As one can see, flattening did not remove the fields. One can see that
the field names are stil there.
The Flattening of the fields did not work.
Expected Results
I expected all fields, that were read only to be removed. Itext 2.1.7
does exactly that
> From: Ranjeet Kuruvilla
> Sent: Wednesday, June 23, 2021 7:14 AM
>
> Here is the code.
>
Can you post the test pdf files on github or similar?
>
> I finally manage to send samples to showcase the flattening problem.
>
> As one can see, flattening did not remove t
here's some code that fixes your PDF until we manage to fix the bug:
for (PDField field : acroForm.getFieldTree())
{
if (!(field instanceof PDTerminalField))
{
continue;
}
PDTerminalField terminalField = (PDTerminalField) field;
List widgets = terminalField.getWidgets
Am 26.06.2021 um 08:08 schrieb Ranjeet Kuruvilla:
Thanks for the reply. I am aware that the release just happened, but if
the next one comes in the next months, that is fine by me.
I've created https://issues.apache.org/jira/browse/PDFBOX-5225 . Feel
free to comment.
Tilman
---
Hey.
Thanks for the reply. I am aware that the release just happened, but if
the next one comes in the next months, that is fine by me.
Cheers.
On 26.06.21 06:05, Tilman Hausherr wrote:
> Hi,
>
> In the meantime, another solution could be to fix this PDF. Some
> fields have widgets that are not
Hi,
In the meantime, another solution could be to fix this PDF. Some fields
have widgets that are not connected to a page. These widgets should be
removed or corrected. Maybe this is the result of another tool that ran
over these PDFs?
Tilman
Am 26.06.2021 um 05:30 schrieb Ranjeet Kuruvilla
Am 26.06.2021 um 05:30 schrieb Ranjeet Kuruvilla:
I am glad you agree. May I ask when a fix can be expected? I fathom this
to be a major issue relevant to others as well.
We usually do releases every 3-4 months and just had a release.
We release snapshot builds when a bug is fixed. It is 5 am
I think I understand the problem:
The code from buildPagesWidgetsMap that is run when there are widgets
with missing page references does not consider the field list. So all
widgets end up in the map instead of only those we care about.
Tilman
Am 26.06.2021 um 05:15 schrieb Tilman Hausherr:
I am glad you agree. May I ask when a fix can be expected? I fathom this
to be a major issue relevant to others as well.
On 26.06.21 05:15, Tilman Hausherr wrote:
> I can reproduce the problem also with this code, where only a single
> field is flattened:
>
> PDAcroForm acroForm = doc.getD
I can reproduce the problem also with this code, where only a single
field is flattened:
PDAcroForm acroForm = doc.getDocumentCatalog().getAcroForm();
List list = new ArrayList<>();
list.add(acroForm.getField("VN_NAME"));
acroForm.flatten(list, true);
All annotat
I don't have Acrobat 5 but I did find a problem using the code you
suggested:
ALL page widget annotations are gone, instead of only those that were
flattened. For example VP_TELEFON_FREIW is not readonly and it is still
in the field list but missing from the page.
The OK file does not bring
Am 24.06.2021 um 10:44 schrieb ranjeet.kuruvilla:
I tried with 2.0.24. The fields are still there. SourceFailure is the important
one.
I did the same now with 2.0.24 (but with my short code) and the fields
are gone.
I assume you tested your 500 lines code. Please test my short code too.
If
I tried with 2.0.24. The fields are still there. SourceFailure is the important
one.
Original message From: Tilman Hausherr
Date: 6/24/21 08:46 (GMT+01:00) To: users@pdfbox.apache.org Subject: Re:
Flattening Part 1 Am 24.06.2021 um 08:03 schrieb Ranjeet Kuruvilla:> Wai
Am 24.06.2021 um 08:03 schrieb Ranjeet Kuruvilla:
Wait a minute: Did you save it to file or did you transform it into
byte[]. I can not save it into a file!
I saved it into a file:
doc.save(new File("X","SourceFailure-saved.pdf"));
Tilman
On 24.06.21 05:52, Ranjeet Kuruvilla wrote:
Wait a minute: Did you save it to file or did you transform it into
byte[]. I can not save it into a file!
On 24.06.21 05:52, Ranjeet Kuruvilla wrote:
> I was aware of that. I prepared an example jar and a project, but that
> project was larger than 1MB and so I was unable to send it!
>
>
> Thank
I was aware of that. I prepared an example jar and a project, but that
project was larger than 1MB and so I was unable to send it!
Thank you for the help. I will try it out.
On 24.06.21 05:50, Tilman Hausherr wrote:
> I tried this code on the 3.0 version on the SourceFailure.pdf file.
>
>
I tried this code on the 3.0 version on the SourceFailure.pdf file.
PDAcroForm acroForm = doc.getDocumentCatalog().getAcroForm();
List list = new ArrayList<>();
for (PDField field : acroForm.getFieldTree())
{
list.add(field);
}
acroForm.
Here is the code.
Forwarded Message
Subject:Fwd: flattening
Date: Wed, 23 Jun 2021 13:12:18 +0200
From: Ranjeet Kuruvilla
To: users@pdfbox.apache.org
I finally manage to send samples to showcase the flattening problem.
As one can see, flattening did not
#x27;ve tested with the result is fine.
BR
Maruan
>
> In PdfBox every field is flattened, even though I delivered a list of
> fields, that were meant to be flattened.
>
> It seems the PDF is destroyed by flattening.
>
> I have attached the code.
>
> On 25.05.2
Hello,
Please tell what PDFBox version you're using and create a MINIMAL
reproducer. Your current code does not flatten at all (because flatten
is commented out), and uses an external class do do something that isn't
related to flattening. Your reproducer should just load the fi
flattening.
I have attached the code.
On 25.05.21 19:27, Tilman Hausherr wrote:
> Here's a PDF flattened by itext
> https://github.com/itext/i7js-examples/blob/develop/cmpfiles/sandbox/acroforms/cmp_checkbox_flatten.pdf
>
> and they do something similar to what we do, i.e. remove
sahy...@fileaffairs.de:
Am Dienstag, dem 25.05.2021 um 18:33 +0200 schrieb Ranjeet Kuruvilla:
Hallo.
It is clear, that flattening does have a bug. Compare flattening of
PDFBox with IText and you realize, that PDFBox destroys all fields,
once
I call
acroform.flatten(fields, true) or acroform.flatten(fields,
njeet Kuruvilla:
Hallo.
It is clear, that flattening does have a bug. Compare flattening of
PDFBox with IText and you realize, that PDFBox destroys all fields, once
I call
acroform.flatten(fields, true) or acroform.flatten(fields, false)
.
How can I request someone to fix flattening and make it work
Am Dienstag, dem 25.05.2021 um 18:33 +0200 schrieb Ranjeet Kuruvilla:
> Hallo.
> It is clear, that flattening does have a bug. Compare flattening of
> PDFBox with IText and you realize, that PDFBox destroys all fields,
> once
> I call
>
> acroform.flatten(fields, true
Hallo.
It is clear, that flattening does have a bug. Compare flattening of
PDFBox with IText and you realize, that PDFBox destroys all fields, once
I call
acroform.flatten(fields, true) or acroform.flatten(fields, false)
.
How can I request someone to fix flattening and make it work like in
; > Just to be sure, I've also downloaded:
> > - PDFpen 11.2.1
> > - PDFelement Version 7.5.9.2925.5262(20200214)
> >
> > and the issue is only reproducible in macOS' Preview.
> >
> > All the other PDF viewers treat the flattened PDF document as f
On Sun, Feb 23, 2020 at 2:26 PM Thad Humphries
wrote:
>
> Is this bug report posted somewhere that others may look and comment on it?
> Others at my company have a history with Apple's PDFKit and other topics.
> I'd like to point them to this issue.
>
Hello Thad
this is the URL to the bug repor
Aleksandar,
Is this bug report posted somewhere that others may look and comment on it?
Others at my company have a history with Apple's PDFKit and other topics.
I'd like to point them to this issue.
Thank you.
On Sun, Feb 23, 2020 at 6:34 AM Aleksandar Simic wrote:
> On Sun, Feb 23, 2020 at 1
On Sun, Feb 23, 2020 at 11:04 AM Tilman Hausherr
wrote:
> Am 23.02.2020 um 11:50 schrieb Aleksandar Simic:
>
> > Should this issue be raised somewhere? (With Apple maybe?)
>
> Yes, please submit the file to apple.
>
Done.
I've also included the link to this discussion in the bug report.
Thank
e issue is only reproducible in macOS' Preview.
All the other PDF viewers treat the flattened PDF document as flat,
where you can't check the checkboxes after flattening.
Should this issue be raised somewhere? (With Apple maybe?)
Yes, please submit the file to apple. Ask them if there is anyt
he other PDF viewers treat the flattened PDF document as flat,
where you can't check the checkboxes after flattening.
Should this issue be raised somewhere? (With Apple maybe?)
Does it need to be documented somewhere, like in the FAQ, so that others
don't stumble on it?
Because I implemen
I'll take some of that back--I can add new checkboxes, but I can't remove
checks placed before flattening.
On Sat, Feb 22, 2020 at 3:28 PM Thad Humphries
wrote:
> I am seeing the same behavior that Dick is seeing with Tillman's file in
> Preview (Version 10.1 (944.6.16.1))
macOS' Preview PDF viewer, I can still check the
> > checkboxes.
> > > But *not* in Adobe's Acrobat Reader DC version 2020.006.20034.
> > >
> > > The upgraded the Clojure project and the behaviour is the same:
> > > - I can check the checkboxe
is the same:
> > - I can check the checkboxes in Preview
> > - I can't check the checkboxes in Acrobat Reader DC
> >
> > What PDF viewer did you use to verify the flattening ?
>
>
> Adobe Reader DC.
>
> Here's my result file:
>
> http://www.filedropp
graded the Clojure project and the behaviour is the same:
- I can check the checkboxes in Preview
- I can't check the checkboxes in Acrobat Reader DC
What PDF viewer did you use to verify the flattening ?
Adobe Reader DC.
Here's my result file:
http://www.filedropper.com/interactiveform-
ur is the same:
- I can check the checkboxes in Preview
- I can't check the checkboxes in Acrobat Reader DC
What PDF viewer did you use to verify the flattening ?
Btw using getFields() is not correct (see javadoc why)
>
Looking at:
https://pdfbox.apache.org/docs/2.0.13/javadocs/org/apache
Hi,
What PDFBox version are you using?
I tested it with the trunk and it works fine.
PDDocument doc = Loader.loadPDF(new File("XXX",
"interactiveform.pdf"));
PDAcroForm acroForm = doc.getDocumentCatalog().getAcroForm();
for (PDField field : acroForm.getFields())
Hello PDFBox users
I'm trying to flatten a PDF form so that it's no longer editable.
I can flatten the text fields, but the checkboxes are still editable
(you're able to check them).
I am doing this in Clojure, but that should not (I hope) do anything special
I get a PDF, get its forms and then
ok. for extra layer, would that be the Overlay class? it looks limited.
maybe doing vector graphics , i will try.
im trying to avoid annotations since im also doing annotations separately
and i do not want that to appear in the annotations list since it will be
just a watermark
On Fri, May 31, 20
Using that approach the text will be selectable and as it's part of the regular
content stream that's not easy to change.
Potential options (just running some ideas - havn't tested these):
- use a vector graphics as Tilman suggested
- use an annotation and try to get that protected
- put the water
hi maruan.
Yes everything should stay as is. I only wish to add a watermark text to
every page and watermark page should not be selectable.
so using PDPageContentStream currently, this is what i got.
On Fri, May 31, 2019 at 2:10 PM Maruan Sahyoun
wrote:
> shall the regular text of the PDF still
Am 31.05.2019 um 07:31 schrieb chitgoks:
so i show some text in PDPageContentStream using showText() but these are
selectable.
is there a way to make these not selectable? like they're drawn in the page
itself?
anyone got ideas?
You could add it as a vector graphic. I did this for the text anno
shall the regular text of the PDF still be selectable?
> no. sorry. watermark as part of the page. instead of using images, i want
> to use text as watermarks.
>
> On Fri, May 31, 2019 at 1:53 PM Maruan Sahyoun
> wrote:
>
> > as part of an annotation?
> >
> > > Am 31.05.2019 um 07:47 schrieb
no. sorry. watermark as part of the page. instead of using images, i want
to use text as watermarks.
On Fri, May 31, 2019 at 1:53 PM Maruan Sahyoun
wrote:
> as part of an annotation?
>
> > Am 31.05.2019 um 07:47 schrieb chitgoks :
> >
> > im creating watermark text. should i be using something d
as part of an annotation?
> Am 31.05.2019 um 07:47 schrieb chitgoks :
>
> im creating watermark text. should i be using something different?
>
> On Fri, May 31, 2019 at 1:41 PM Maruan Sahyoun
> wrote:
>
>> text at a page level is normally selectable - why do you want to prevent
>> that?
>>
>>
im creating watermark text. should i be using something different?
On Fri, May 31, 2019 at 1:41 PM Maruan Sahyoun
wrote:
> text at a page level is normally selectable - why do you want to prevent
> that?
>
> Or is that content stream part of a AcroForm field?
>
> BR
> Maruan
>
> > Am 31.05.2019
text at a page level is normally selectable - why do you want to prevent that?
Or is that content stream part of a AcroForm field?
BR
Maruan
> Am 31.05.2019 um 07:31 schrieb chitgoks :
>
> so i show some text in PDPageContentStream using showText() but these are
> selectable.
> is there a way
so i show some text in PDPageContentStream using showText() but these are
selectable.
is there a way to make these not selectable? like they're drawn in the page
itself?
anyone got ideas?
s 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 lon
tate 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
> &g
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
id 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
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
sh.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
ntStream = new PDPageContentStream(doc, page,
> >>> PDPageContentStream.AppendMode.APPEND, true);
> >>> contentStream.drawImage(image, 246, 36 );
> >>> contentStream.close();
> >>> doc.save(tempFile);
> >>> doc.close();
> >>>
&
rintout. (They do appear when I open the doc
in Preview.)
I don't really know why; I just tried updating to the latest on a
lark. It feels like the flattening failed on 2.0.11. The printer is
a bit dated and I think I went with flattening in the first place
because that was the only way to
> > With PDFBox 2.0.11 when I do the same, the form fields all come
> > through as empty on the printout. (They do appear when I open the doc
> > in Preview.)
> >
> > I don't really know why; I just tried updating to the latest on a
> > lark. It feels lik
g to the latest on a
lark. It feels like the flattening failed on 2.0.11. The printer is
a bit dated and I think I went with flattening in the first place
because that was the only way to get the doc to print correctly from
the command line.
I will stick with 2.0.5 for now because for this case it
.0.11 when I do the same, the form fields all come
through as empty on the printout. (They do appear when I open the doc
in Preview.)
I don't really know why; I just tried updating to the latest on a
lark. It feels like the flattening failed on 2.0.11. The printer is
a bit dated and
COSName{BaseFont}:COSName{Times-Roman};COSName{Encoding}:316217735;COSName{Name}:COSName{TiRo};COSName{Subtype}:81291287;COSName{Type}:2195567;}};COSName{ZaDb}:COSDictionary{COSName{Type}:2195567;COSName{Subtype}:81291287;COSName{BaseFont}:COSName{ZapfDingbats};};};}
> -Original Message--
SName{Subtype}:81291287;COSName{BaseFont}:COSName{ZapfDingbats};};};}
-Original Message-
From: Maruan Sahyoun [mailto:sahy...@fileaffairs.de]
Sent: Thursday, January 25, 2018 11:44 AM
To: users@pdfbox.apache.org
Subject: Re: "Could not find font: /TimesNewRoman" when flatt
> Sent: Thursday, January 25, 2018 2:11 AM
> To: users@pdfbox.apache.org
> Subject: Re: "Could not find font: /TimesNewRoman" when flattening form with
> refreshAppearances set to true.
>
> Hi,
> What version are you using?
> Tilman
>
> Am 25.01.2018 um 0
Sent: Thursday, January 25, 2018 2:11 AM
To: users@pdfbox.apache.org
Subject: Re: "Could not find font: /TimesNewRoman" when flattening form with
refreshAppearances set to true.
Hi,
What version are you using?
Tilman
Am 25.01.2018 um 08:03 schrieb David Fertig:
> I am loading a PDF file
Hi,
What version are you using?
Tilman
Am 25.01.2018 um 08:03 schrieb David Fertig:
I am loading a PDF file into a PDDocument , using its PDAcroForm.importFDF to
import FDF field data, and then using PDAcroForm.flatten.
When refreshAppearances is false PDAcroForm.flatten works, but when
refre
I am loading a PDF file into a PDDocument , using its PDAcroForm.importFDF to
import FDF field data, and then using PDAcroForm.flatten.
When refreshAppearances is false PDAcroForm.flatten works, but when
refreshAppearances is true, I get the exception below. This happens on linux
(where I've a
tic pdf
>> form
>> Test.pdf. The result is pippo.pdf. The texts were set but there's a shift
>> of the string to right of a char (see Capture.PNG)...I suppose that is
>> caused by the flattening..
>>
>> I wonder whether that has to do with my Form...but a
JzSzl2NXc
>>
>> The Test tries to set all the fields texts to 'test' in the static pdf form
>> Test.pdf. The result is pippo.pdf. The texts were set but there's a shift
>> of the string to right of a char (see Capture.PNG)...I suppose that is
>> caused
pdf. The result is pippo.pdf. The texts were set but there's a shift
of the string to right of a char (see Capture.PNG)...I suppose that is
caused by the flattening..
I wonder whether that has to do with my Form...but as I try to set the
values by hand, the texts aren't shifted...
set but there's a shift
of the string to right of a char (see Capture.PNG)...I suppose that is
caused by the flattening..
I wonder whether that has to do with my Form...but as I try to set the
values by hand, the texts aren't shifted...
Thank you very much!
Regards Fabio
2017-06-
Hi,
Make sure you're using the latest version, 2.0.6. Please upload your
files (including your PDF file) to a sharehoster.
Tilman
Am 30.06.2017 um 18:42 schrieb Fabio Salvi:
Hi all,
I'm using PDFBox to full a PDFForm and it works very well. I have
a Problem as I try to flatten
> Hi all,
>
> I'm using PDFBox to full a PDFForm and it works very well. I have a
> Problem as I try to flatten the Document. The field texts are moved to the
> right by a char and not aligned with the label.
>
> Have you an idea what can cause such a problem?
>
> [image: Inline-Bild 1]
>
> Hier my
ontent on the page, if possible. I gather this is called
"flattening" and I saw something that said I should just remove the
AcroForm fields and the annotations would remain, or something like
that.
But my override goes in an element like this:
21 0 obj
<< /Type /Annot /T (SomeLa
hese reasons I would prefer to eliminate the form fields
when I append to the original document, and make my appearance streams
just be content on the page, if possible. I gather this is called
"flattening" and I saw something that said I should just remove the
AcroForm fields and the annotati
Hi,
> Am 01.04.2016 um 08:25 schrieb Maruan Sahyoun :
>
> Hi,
>
> flatten() will flatten the form fields but without refreshing the fields
> appearance i.e. how you see it on the form. Now, as NeedAppearances is set to
> true, the prior setValue() call also didn't refresh the fields appearance
Hi,
flatten() will flatten the form fields but without refreshing the fields
appearance i.e. how you see it on the form. Now, as NeedAppearances is set to
true, the prior setValue() call also didn't refresh the fields appearance as
the NeedAppearances flag tells the viewer to handle that.
The
Hi Thomas,
thanks for your advice!
Unfortunately your advice does not work. If I get the Fields over the
COSDictionary (as you recommend) AdobePdfReader still shows the form-fields.
Just PDFBox does not recognise the form-fields any more.
Do you (or someone else) have any idea whether I have to
Am 22.01.2013 13:25, schrieb Lukas Baab:
Hi!
Hi Lukas,
How do I "flatten" a PDF-form (remove the form-field but keep the
text of the field)?
Jason asked this question already.
(see
http://mail-archives.apache.org/mod_mbox/pdfbox-users/201009.mbox/%3c4c9a326f.60...@rayman2200.de%3E)
The answ
Hi!
How do I "flatten" a PDF-form (remove the form-field but keep the text of the
field)?
Jason asked this question already.
(see
http://mail-archives.apache.org/mod_mbox/pdfbox-users/201009.mbox/%3c4c9a326f.60...@rayman2200.de%3E)
The answer was this:
> a quick way to do this, is to remove the
Hi all,
I have a PDF with form fields created on Acrobat 9, and I would like to
fill this fields and save the PDF flattened, without the form.
I saw on the mailing list that just by removing the fields would do the
trick:
document.getDocumentCatalog().getAcroForm().getFields().clear();
Hi folks,
PDFBox is great and I have used it to programmatically create some
annotations (TextMarkups and AnnotationLinks) in existing PDF files.
However, not all PDF viewers support annotations. Is there any way to
flatten the annotations programmatically using PDFBox, so that the
full content w
Hi Thomas
Thanks for your reply! I'll experiment with that approach.
Regards
Jason
Subject:Re: Flattening <http://markmail.org/message/w6tdf2hnimwx4uw3> [image:
permalink] <http://markmail.org/message/w6tdf2hnimwx4uw3> From:Thomas
Chojecki (in...@rayman2200.de) Date:Sep 22
Hi Jason,
a quick way to do this, is to remove the fields from the acrofrom.
For this you just need to get the document catalog, then the acroform
and then remove all fields from this acroform.
The graphical representation is linked with the annotation and stay in
the document.
Am 22.09.201
I'm looking for a way to "flatten" a pdf (basically, "merge" the interactive
form fields directly into the pdf pages) , but haven't discovered how this
can be done with PDFBox. Is this supported?
Thanks much!
Jason
87 matches
Mail list logo