pixelcog / gmail-to-pdf

A Google Apps Script library for converting Gmail messages to PDFs for easy archival.
http://bit.ly/1CsBl8U
123 stars 38 forks source link

messageToPdf - pdf generated file #9

Open TheBonaGitHub opened 5 years ago

TheBonaGitHub commented 5 years ago

Dear, thanks for your code !

Unfortunately I have a problem. The pdf generated file is blank. Every time is generated a 1.6KB pdf file .

Do you have an help, please ? Thanks you very much.

Best regards Andrea

webstermath commented 4 years ago

I am having the same issue. I was very excited when I found this library since I have similar functionality in production code but am not able to save pictures. As there seems to be issues with using this library with V8, I reverted my app back to the old engine. Now it generates a pdf file from the gmail message but the pdf is completely blank except for a email header at the top. Any suggestions for what I might be doing wrong?

emmanueljarri commented 3 years ago

I am having the same issue. I was very excited when I found this library since I have similar functionality in production code but am not able to save pictures. As there seems to be issues with using this library with V8, I reverted my app back to the old engine. Now it generates a pdf file from the gmail message but the pdf is completely blank except for a email header at the top. Any suggestions for what I might be doing wrong?

I had this issue as well (Just the email header was present, the rest of the pdf was blank). For me I solved it by changing the regex in function processStyleTags(html) : return html.replace(/(<style[^>]*>)(.*?)(<\/style>)/gi, function(m, tag, style, end) { instead of return html.replace(/(<style[^>]*>)(.*?)(?:<\/style>)/gi, function(m, tag, style, end) {

I created an issue for it, here : https://github.com/pixelcog/gmail-to-pdf/issues/18

Hope it helps solve your issue