pipwerks / PDFObject

A lightweight JavaScript utility for dynamically embedding PDFs in HTML documents.
http://pdfobject.com/
Other
2.39k stars 986 forks source link

change default download file name #301

Open tingtingcheng6 opened 6 months ago

tingtingcheng6 commented 6 months ago

Hello!

In the base64 scenario, how to change the default download file name?

PDFObject.embed(base64, '#pdfRoot');

Thanks a lot for the response

pipwerks commented 6 months ago

Hello

Unfortunately, the file name 'file.pdf' is currently hardcoded. You can fork the source and edit line 376 to accept a variable if needed. I will make a note to try and make this an option in the next update.