[
https://issues.apache.org/jira/browse/PDFBOX-5369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17483910#comment-17483910
]
the blue mountain commented on PDFBOX-5369:
-------------------------------------------
Herr Lekhmkühler,
A:
sorry for being so late at replying (was under the heat of other pdf related
issues)
i will update the code to test, replacing use of COSObject with related object
it points to and i will keep you updated so that we can close this issue.
fiy: i've been using similar code (running on prod for a while) and it was
producing pdf that could be displayed on acrobat: but the code was using the
PDDocument.save () method.
my understanding is therefore:
"{*}when saving incrementally,{*} either you have to ensure that such
references are dereferenced or removed before using those objects or you simply
copy the needed values from the imported object to a new created one. The
latter is done in {{{}org.apache.pdfbox.tools.ImportFDF{}}}".
Q: is my understanding correct?
B: i was noticing as well other issues relating to duplicate objects being
rewritten with same id ...
it certainly is a consequence of this original mistake: however, i will keep
you updated if such duplication is still found.
many thanks for this pdfbox project,
> PDDocument.saveIncremental () and stack exhaustion
> --------------------------------------------------
>
> Key: PDFBOX-5369
> URL: https://issues.apache.org/jira/browse/PDFBOX-5369
> Project: PDFBox
> Issue Type: Bug
> Components: Writing
> Affects Versions: 3.0.0 PDFBox
> Reporter: the blue mountain
> Priority: Major
> Attachments: PDFBOX-20220126.zip
>
>
> Merge of fdf annotations into pdf file exhausts stack
> attempting to merge an fdf file in a pdf file, using the
> PDDocument.saveIncremental () method, program stack is exhausted because of
> infinite recursion.
> looking further in the code, it seems the infinite recursion is being started
> from the private boolean COSIncremental.collect(COSBase base) method.
> i have attached a zip file carrying:
> - mini.pdf: a minimal pdf file to reproduce the issue
> - mini.fdf: an fdf annotation file carrying a /Text annotation and related
> /Popup to reproduce the issue
> - COSIncrement.java: a modified source that generate extra traces (+ possible
> work-around)
> - COSIncrement-fix.java: a modified source to avoid the problem
> - Sample.java: a sample program that loads pdf, copies annotations and saves
> incrementally.
> - sample_run.xlsx: an extract of the Sample output to compare a working vs
> non-working
>
> notes:
> 1- I was not able to reproduce the problem using annotations created
> dynamically in the code.
>
> 2- It is possible to avoid this issue by altering the COSIncrement.java class
> (COSIncrement-fix.java):
> it records objects beING collected through enter () method ensuring object is
> not being collected multiple times
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]