On one of our projects, Evernote is one of the services that users can share data to. Every time users update some data, changes will be posted to Evernote as an Evernote note. But we found some problems when we tried to create an Evernote note via Evernote API.
Problems of creating ENML
The notes we post to Evernote have a kind of complicated structure: HTML documents with an annotated Google map at the bottom. This raises two questions: how could we use existing templates instead of creating another inline-styled ENML versions; and how could we render Google maps inside ENML documents;
We contacted the tech team of Evernote to see if there was any way to help solve the problems, or at least some way to allow us not to convert HTML to inline styling ENML. Unfortunately answers to both questions were no, but one of the developers suggested that we could upload Google maps as attached images and use Evernote Web Clipper, a Chrome extension, to help create ENML from the existing HTML. Although it was not a complete solution, it’s a direction we could try to go in.
Creating ENML content with the Evernote Web Clipper
The Evernote Web Clipper is a great tool to save anything you like on the internet, including text, links and images. It really helps a lot for most people converting HTML into ENML, but it doesn’t support web fonts very well. Also, maintaining two versions of the template in our system is really not a good choice.
Create PDF as ENML attachment
What we want is a copy of the existing template that we can post to Evernote, instead of ENML content. An image or PDF attachment is acceptable, also Evernote is capable of searching text inside PDFs, which is another big plus. With PDF attachments, we don’t need to think about duplicated documents, inline stylings, web fonts and other issues we met when creating ENML documents. With a simple and popular shell utility wkhtmltopdf in hand, we can easily convert our HTML to PDF easily using the webkit rendering engine.