You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Andreas Lehmkühler (Jira)" <ji...@apache.org> on 2021/02/07 12:25:00 UTC

[jira] [Commented] (PDFBOX-5086) DataFormatException after saving

    [ https://issues.apache.org/jira/browse/PDFBOX-5086?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17280483#comment-17280483 ] 

Andreas Lehmkühler commented on PDFBOX-5086:
--------------------------------------------

The lock mechanism doesn't work as expected, it would introduce some side effect: the input file is locked for reading as well, so that ist isn't possible to open a file twice (some of the tests are doing so and maybe there are some real life scenarios as well.

IMHO we have the following options:
* lock the input file -> concurrent reading isn't possible anymore
* don't overwrite an existing file at all -> one has to choose a new file name for each save operation
* don't do anything and leave it to the user to ensure the input file isn't used as target

The first solutions won't work at all if an outputstream is used as target. In such cases the damage is done once the outputstream is created.

I tend to leave it to the user to take care of the issue.


> DataFormatException after saving
> --------------------------------
>
>                 Key: PDFBOX-5086
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5086
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 3.0.0 PDFBox
>            Reporter: Tilman Hausherr
>            Assignee: Andreas Lehmkühler
>            Priority: Major
>             Fix For: 3.0.0 PDFBox
>
>         Attachments: SalesUseTaxLA_R-5402_20060705.pdf, SalesUseTaxLA_R-5402_20060705_BAD.pdf
>
>
> Attached file gets corrupted when saved in 3.0.0, but not in 2.0.*.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org