ahochsteger/gmail-processor

Conversion from text/html to application/pdf failed

xeniagda opened this issue · 1 comments

Hi. When attempting to save a thread with no attachments by converting the generated HTML to PDF, the script fails with the following message:

Conversion from text/html to application/pdf failed.

processThreadToPdf @ Code.gs:208
Gmail2Drive @ Code.gs:50

After further dissecting of the code, it seems like the error occurs when calling folder.createFile, but I think the issue originates from the blob.getAs("application/pdf") call.

The issue doesn't seem to be due to quotas exceeding; even though "Files converted" is a qouta'd feature the issue did occur in the first execution, when no quota had been used.

The HTML does not contain any strange or unusual elements, and if I hardcode something simple like the following, the issue still shows up.

<!DOCTYPE html
<html><body><p> hello world </p></body></html>

I'm not sure how reproducible the underlying issue is; the only place I've seen this error message documented is this StackOverflow thread, and none of the answers there seem to work. Unlike in the question, the conversion fail every time for me, and the HTML does not have to be particularly large.

The issue is present regardless of whether the Chrome V8 runtime is enabled or not, though I doubt that matters.

Alright, this seems to be an issue with the platform itself, reported here. As the issue doesn't originate from this repo itself, I will close the issue.