Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Acrobat Always Asks to Save Changes to "unmodified" File on Close of PDF #225

Open
jamesbley-rhythm opened this issue Aug 25, 2022 · 5 comments
Labels
bug needs-info This issue is on hold, until more information becomes available.

Comments

@jamesbley-rhythm
Copy link

I have the following problem:
See this playground.

If you download the PDF and open it in Acrobat Reader, make no changes, then close the PDF, Acrobat will ask if you want to Save the File.

I expected this to happen:
I didn't make any changes to the PDF, I expected Acrobat not to ask me to save the file on close.

I tried this:
The above svg2pdf playground and our own use of this to create pdfs from svg.

But this is what happened instead:
Both result in the same issue.

@yGuy
Copy link
Member

yGuy commented Aug 31, 2022

To me this sounds more like a bug in jspdf. Or actually in Acrobat Reader. If the program does not edit the file, who could have modified the file and how, anyway?

I don't have Acrobat Reader installed, here. Does this also happen with an empty SVG or even if you omit the call to svg2pdf altogether? There aren't that many calls that go into jspdf when the svg is empty so this might be "easy" to debug with an almost empty pdf.

@yGuy yGuy added bug needs-info This issue is on hold, until more information becomes available. and removed question labels Aug 31, 2022
@jamesbley-rhythm
Copy link
Author

According to my development team, if they create a pdf using jspdf only, Acrobat Reader does not issue the same "save changes to modified file" prompt. But if they use svgtopdf using an svg, then they get the "save changes" prompt.

My guess is that acrobat reader does not like what it's seeing in the .pdf file and is "modifying" it to its liking as it's loaded. Almost like it's "converting" it when it's opened. This is how it's becoming "modified".

Using the "playground" link above, I cleared out the text and this resulted in an empty svg. I downloaded it and still get the prompt to save the file when I close it from acrobat reader. I tried this on both chrome and edge, to be sure the browser wasn't adding anything.

@jamesbley-rhythm
Copy link
Author

jamesbley-rhythm commented Aug 31, 2022

Attaching 2 pdf files. Both originate from "playground" link above. I removed the "text" node and "viewbox" attribute and had it generate a pdf.
"svg2pdf_blank_before_adobe_save.pdf" is what was downloaded directly.
"svg2pdf_blank_after_adobe_save.pdf" is what the file was after adobe acrobat reader asked me to save it.
svg2pdf_blank_before_adobe_save.pdf
svg2pdf_blank_after_adobe_save.pdf

@yGuy
Copy link
Member

yGuy commented Aug 31, 2022

We should probably compare the output of the empty jspdf export with the "empty svg" case. The file saved by Acrobat Reader is very different from the "before" file (different file version to begin with). We'll probably need to bisect the instructions that are issued when we write the empty SVG to find out which ones Acrobat does not "like".

@HackbrettXXX
Copy link
Member

Using jspdf 2.5 instead of 2.0 seems to resolve the issue, can you confirm @jamesbley-rhythm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs-info This issue is on hold, until more information becomes available.
Projects
None yet
Development

No branches or pull requests

3 participants