Type: “PDF” does not change the file name:
Type: “PDF” does not change the file name: No matter what is in fileName, the file name is equal to the page title. Tell me what I'm doing wrong. Thankyou.
Hi there. Thanks for using this library. You are doing nothing wrong. This is indeed a bug which affects pdf printable. I will work on it in the coming days and will keep you updated.
Thank you so much. I will wait for a solution to the problem.
The printer which actually generates the pdf is fired by the execCommand.print(). In fact it is the browser which fires up the print dialog. Unfortunately from the code we don't have any access to these methods. In some cases object.src=<title> can be used but for our case it won't work as we have a framework.
There is one solution which is not the best and is to change the page title to your file name right before the print job triggers. Afterwards you can set the page title back to what it was.
Is it worth looking into https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeprint to change title before print and then move it back to what it was after print has happened.
@mfsbo could you give it a try to resolve this issue with your suggestion?