jsPDF icon indicating copy to clipboard operation
jsPDF copied to clipboard

JsPDF needs to be able to render HTML

Open cnizzardini opened this issue 14 years ago • 7 comments

We were going to use this excellent library at work, but dealing with the formatting was going to prove to be too time consuming. Instead we went with a server-side pdf library since it could render html to pdf. If JsPDF rendered html to pdf it would make this library super awesome :-)

cnizzardini avatar Aug 16 '12 04:08 cnizzardini

See july 2012 commits 12f29d7c31 and 6e72e17353

https://github.com/willowsystems/jsPDF/commits/stable

This is "work-in-progress"

dvdotsenko avatar Aug 16 '12 16:08 dvdotsenko

This is an awesome library. The HTML to PDF does not support tables and images as of now. Is there any plan to support it?

nrsudhir avatar Sep 04 '12 22:09 nrsudhir

@nrsudhir User dvdotsenko (or [email protected]) - the person who wrote the the "fromHTML" plugin does NOT have any short or long-term plans to implement support for HTML tables or images for "fromHTML" plugin.

However, this being an open-source project, nothing stops anyone else from doing that.

dvdotsenko avatar Sep 05 '12 00:09 dvdotsenko

Hi,

Pull requests for 'fromHTML' are welcome.

dvdotsenko's contributions are valuable and very much appreciated.

Kind regards, James

On 5 Sep 2012, at 01:06, "D. Dotsenko" [email protected] wrote:

@nrsudhir https://github.com/nrsudhir User dvdotsenko (or [email protected]) - the person who wrote the the "fromHTML" plugin does NOT have any short or long-term plans to implement support for HTML tables or images for "fromHTML" plugin.

However, this being an open-source project, nothing stops anyone else from doing that.

— Reply to this email directly or view it on GitHubhttps://github.com/MrRio/jsPDF/issues/28#issuecomment-8283450.

MrRio avatar Sep 05 '12 00:09 MrRio

I'm planning to add these features in the future :)

MrRio avatar Jan 08 '13 09:01 MrRio

The new "fromHTML" is a very nice feature. I found it easiest to render a very simple version in html that's hidden and print that version to html (as it struggled with my more involved html & css syntax - ie it seems to tokenize words in tables, putting a large tab where there are normally spaces).

Meanwhile, the new feature overall saved so much time (relative to reconstructing the entire page using doc.text commands) that I'm happily using it now - just a simple version that's just h1's and p's.

Nice work & thx.

mikedorsey avatar Oct 13 '14 19:10 mikedorsey

The fromHTML cannot render images present in table.

svankamamidi avatar Sep 04 '17 10:09 svankamamidi