pcorless / icepdf

PDF Rendering and Viewing API in Java
Apache License 2.0
84 stars 21 forks source link

GH-25 Pass isNew to stateManager in various methods #296

Closed gtache closed 10 months ago

gtache commented 1 year ago

Possibly an oversight?

pcorless commented 1 year ago

Thanks for pointing this out. I'm pretty sure it was something I missed in the initial refactor. The param is missing in some cases when we don't want to prompt a user with a saying new changes have been made when the only thing, they did was open the document. There are a number of generators that don't provide the appearance streams and the library creates them on the fly

I need to do some more testing, but some changes need to be made. Was there a particular behaviour you observed that was out of place?

gtache commented 1 year ago

The problem appeared when automatically adding annotations to a page (without user input) and calling resetAppearanceStream on them. When the user closed the file without doing anything, ICEpdf would show them the save dialog, so I tracked it down to the 'isNew' parameter not being always transferred to the next methods.