Am 28.07.21 um 22:22 schrieb Alexander Slonim:
Hello,
When I attempt to use PDDocument.save, the saved output file is corrupted,
even when no action is taken on the file other than saving it.
Works fine for me using the current trunk and my own code
Your test cases are probleatic.
The first one doesn't make that much sense, there isn't any PDDcoument.save
involved.
The second and the third one are using the very same file name. The only
difference is the current timestamp. But there is/was an issue on windows
systems where those timestamps aren't accurate so that those are maybe the same
if they are close enough. Saying, maybe oen tests overwrites the output of the
other one
Maybe you should follow Tilmans comment and double check if the ressources are
copied without filtering
Amdreas
For example:
```
File file = new
File("C:\\Users\\Public\\Desktop\\projects\\test-pdfbox-corruption\\src\\mai
n\\resources\\chicken.pdf");
PDDocument document = Loader.loadPDF(file);
document.save("C:\\Users\\Public\\Music\\file" + new
Date().getTime() + ".pdf");
document.close();
```
I am currently using PDFBox 3.0.1-RC, however, I also used 2.0.15 and
2.0.24, and experienced the same issues.
For a more complete example, I have posted the project to GitHub
(https://github.com/pdinc-oss/pdfbox-corrupt-test.git)
I am new to PDFbox and am unsure if this is a usage error on my end or a bug
within PDFBox itself.
Best,
Alex
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org