Vue.js PDF Download Fails in Safari Broswer and with Invalid Base64 Response #13259
Unanswered
manimoney468
asked this question in
Help/Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was implementing a PDF download feature in Vue.js using a base64 string without relying on jspdf. The PDF was expected to download properly across browsers, including Safari. However, I faced several issues:
In Safari, the popup blocker prevented the PDF from opening when using window.open().
In some cases, the atob() function failed with InvalidCharacterError due to improperly encoded or invalid base64 strings.
When testing, I received a misleading success response from the backend, but the base64 data was either malformed or not a valid PDF, leading to a download failure.
Root Causes Identified:
1 : Base64 data was not a valid or complete PDF (which atob() could not decode).
2 : Safari's popup blocker prevented automatic downloads via new tab.
Beta Was this translation helpful? Give feedback.
All reactions