mogsdad / SheetConverter

Google Apps Script library - interprets Google Sheets Formats, converts to formatted text or html
49 stars 26 forks source link

Convert to html, then to PDF #5

Closed gernei09 closed 8 years ago

gernei09 commented 8 years ago

I wanted to add an additional attachment to the emails that I send, so along with the email, I wanted to attach a PDF document that represented the HTML content that was sent in the body of the email using your SheetConverter.convertRange2html(rangeObject). I used this small tutorial to go about this, however there is one small issue: it doesn't seem to convert colored ranges over into the PDF. Most of the formatting looks correct. Just no background color is showing. I did a small test without SheetConverter and just a small piece of html with an h1 and color set to red, and it worked just fine. Any ideas on how we can go about this to correct it?

Also wanted to check on any progress that might have been made to fixing merging cells to show up properly through HTML.

Best, Gerneio

mogsdad commented 8 years ago

Hi Gerneio,

I imagine that there is some deficiency in the way that Google is handling the inline style info that is produced by my library. An H1 element is different than a TD, and 'color' is different than background color, so you're probably not comparing apples and apples in your small test.

What I'd recommend is to find how to convert a small html table with the background color you're interested in into a PDF. Once you know what style attributes are necessary for that, you could modify my library (or its output) to give you what you need.

WRT Merging - no progress.

gernei09 commented 8 years ago

You are correct, I was not comparing apples to apples. However I made a few test later on with a small table, however the inline styling still did not take in the PDF for the background color. I will continue to test to see what attributes will work or how to get them to work.