Open nicolasr75 opened 4 weeks ago
I don't think there is an option to set the title --> https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-printToPDF
Try this (from stackoverflow) --> https://stackoverflow.com/questions/26905908/chrome-save-to-pdf-custom-filename
I try to have a look in the code to see if I can add it as an option and then inject some JavaScript in the dom object before converting it to PDF. But if you need a quick solution than try the stack overflow suggestion.
Thanks for looking into this. After reading the Stack Overflow suggestions I found out that it's much easier, at least for my application: simply set the title tag in the html head to the desired name and Chrome will respect that. In my application I create the html file from scratch, so I have full control over the content. For others, however, this may not be possible.
I noticed today that the input filename is used as the document title for the PDF. Ex. my output filename is Report_2024.pdf, my input filename is input.html.
When I open the PDF in Adobe Viewer and Adobe already has files opened, it displays tabs for the PDFs which contain the document title. In my case the title is input.html which is confusing to the user.
Is there any way to explicitly set the document title?
Thanks for your great work!