PDF to HTML Email?

115 views
Skip to first unread message

Roger Cauvin

unread,
Feb 5, 2017, 2:17:50 PM2/5/17
to pdf2htmlEX
I'd like to use pdf2htmlEX to convert a PDF to an HTML email. I've successfully converted the PDF to HTML, embedding images, CSS, JS, and fonts in the HTML file. The HTML renders well on the browsers I've tested.

However, when I send the HTML via email, there are some glitches with the fonts. Some of the text seems to render with a different font, and links on the text don't align properly.

I was wondering if there are some options or tweaks I should try to make the generated HTML more suitable for emails.

Lu Wang

unread,
Feb 6, 2017, 1:50:53 AM2/6/17
to Roger Cauvin, pdf2htmlEX
Is HTML file sent as attachment or is it part of the email body? I wonder if the email client/server tries to "optimized" it.


regards,
- Lu

--
You received this message because you are subscribed to the Google Groups "pdf2htmlEX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdf2htmlex+unsubscribe@googlegroups.com.
To post to this group, send email to pdf2h...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pdf2htmlex/b40f6a4d-9e23-4b58-aaa5-49411c139dea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ro...@cauvin.org

unread,
Feb 6, 2017, 6:14:07 AM2/6/17
to Lu Wang, pdf2htmlEX
The HTML is the body of the email. I paste the raw HTML into a mail sending service that sends HTML emails. The service doesn't alter the HTML in any way, but when I view the received mail in various mail clients, some of the fonts aren't right.

Roger

You received this message because you are subscribed to a topic in the Google Groups "pdf2htmlEX" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pdf2htmlex/fov7zch4scI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pdf2htmlex+...@googlegroups.com.

To post to this group, send email to pdf2h...@googlegroups.com.

Roger Cauvin

unread,
Aug 8, 2020, 9:56:51 AM8/8/20
to pdf2htmlEX
Just an update now that a few years have passed. This tool is great, and it generates HTML that the various browsers I have tried render beautifully. However, sending HTML emails converted from PDF still doesn't work for me.

The conventional wisdom is that the CSS in HTML emails should be "inlined", which is not the same thing as "embedding" the CSS in the same file as the HTML. Accordingly, I have taken the HTML and run it through a couple of conversion tools that inline the CSS. Unfortunately, these tools have generated HTML that does not look right at all, even when opening the files in Chrome.

It seems the CSS inlining tools aren't smart enough to recognize or handle some of the CSS in the HTML that pdf2htmlEX generates.

In any case, I am still interested in a solution that creates HTML suitable for emails.

Roger

On Monday, February 6, 2017 at 5:14:07 AM UTC-6 Roger Cauvin wrote:
The HTML is the body of the email. I paste the raw HTML into a mail sending service that sends HTML emails. The service doesn't alter the HTML in any way, but when I view the received mail in various mail clients, some of the fonts aren't right.

Roger

On Feb 6, 2017 12:50 AM, Lu Wang <coolw...@gmail.com> wrote:
Is HTML file sent as attachment or is it part of the email body? I wonder if the email client/server tries to "optimized" it.


regards,
- Lu
On Sun, Feb 5, 2017 at 8:17 PM, Roger Cauvin <ro...@cauvin.org> wrote:
I'd like to use pdf2htmlEX to convert a PDF to an HTML email. I've successfully converted the PDF to HTML, embedding images, CSS, JS, and fonts in the HTML file. The HTML renders well on the browsers I've tested.

However, when I send the HTML via email, there are some glitches with the fonts. Some of the text seems to render with a different font, and links on the text don't align properly.

I was wondering if there are some options or tweaks I should try to make the generated HTML more suitable for emails.

--
You received this message because you are subscribed to the Google Groups "pdf2htmlEX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdf2htmlex+...@googlegroups.com.

To post to this group, send email to pdf2h...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pdf2htmlex/b40f6a4d-9e23-4b58-aaa5-49411c139dea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

Ebon Elza

unread,
Aug 28, 2020, 3:07:55 PM8/28/20
to pdf2htmlEX
I'm in a similar boat as Roger. Our company is considering sponsoring work on fixing some issues with converting PDFs to HTML suitable for display in various major email clients, especially Outlook, Gmail, and iOS Mail. If any interested parties see this, please feel free to reach out to me to discuss.

@Roger, I've had some success with sending the output of pdf2htmlex as a multipart MIME message. I have some sample Python code I'm willing to share if you're interested. I might just post it anyhow for posterity.

Ankala Akhilesh

unread,
Apr 16, 2021, 4:12:14 PM4/16/21
to pdf2htmlEX
Hi,
Can you please help me understand if pdftohtmlex can be run within google apps script (and a high-level procedure)? My objective is to convert a google-doc to html but due to google apps script's own limitation, the html document is rendered badly without page-breaks and such things.
However conversion to pdf is perfect using the pdf-API and from there I have done a pdf to html which is again perfect. So my question: is there a way to embed the pdf to html code inside of google's apps script so that we can easily convert to html at the click of a button?

Will await your response.

Thanks,
Akhilesh.


On Monday, February 6, 2017 at 12:20:53 PM UTC+5:30 LuWang wrote:
Is HTML file sent as attachment or is it part of the email body? I wonder if the email client/server tries to "optimized" it.


regards,
- Lu

On Sun, Feb 5, 2017 at 8:17 PM, Roger Cauvin <ro...@cauvin.org> wrote:
I'd like to use pdf2htmlEX to convert a PDF to an HTML email. I've successfully converted the PDF to HTML, embedding images, CSS, JS, and fonts in the HTML file. The HTML renders well on the browsers I've tested.

However, when I send the HTML via email, there are some glitches with the fonts. Some of the text seems to render with a different font, and links on the text don't align properly.

I was wondering if there are some options or tweaks I should try to make the generated HTML more suitable for emails.

--
You received this message because you are subscribed to the Google Groups "pdf2htmlEX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdf2htmlex+...@googlegroups.com.

Nikhil Ranka

unread,
Aug 26, 2021, 6:27:10 AM8/26/21
to pdf2htmlEX
Hello Roger and Ebon, 

Had been looking to build a similar solution. However, no success yet. So, started looking at building an in-house solution. After realising that poppler, a library used by pdf2htmlEX, outputs an XML with location info of text and images started working on it. But the XML output has its own sets of challenges though, like, missing images, missed text formatting, etc. Despite all that, poppler might be worthwhile to look at.

Did you guys find any other solution to this? Eager to know. 

Thanks!
Reply all
Reply to author
Forward
0 new messages