WM18 - Android and Html doc

Startbeitrag von James Smiths am 18.07.2013 21:47

Hi all

Any advice about how to generate HTML docs.

The idea is to use it instead of pdf, so I can generate reports and let the user send them by email to print them.

I do not see any example of this in WM

Thanks


James.

Antworten:

Hi james

an html doc is just a text file with html tags for formatting, so it can be constrcuted from scratch inside your code... However, a simpler way is to create a template with any html generator, including in it TAGS that you'll replace at run time with your data...

Just be careful about the images... Only a LINK is included in the html doc, which means that your images should be somewhere on a server, and the links to them should be public URLs

best regards

von Fabrice Harari - am 19.07.2013 00:17
Thank you Fabrice, I will give it a try.

James.

von James Smiths - am 19.07.2013 01:00
Quote
Fabrice Harari
Just be careful about the images... Only a LINK is included in the html doc, which means that your images should be somewhere on a server, and the links to them should be public URLs

Actually you are right here but I have managed to embed images HTML doc itself by converting each image to Base64.

The exact syntax is data:image/png;base64,

Here is an example. It is a bit tooooo long though ;) You will have to click on Quote link below this message to view the complete sample code.





von Yogi Yang - am 19.07.2013 04:21
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.