Jspdf: html: add width option

Created on 23 Sep 2020  路  13Comments  路  Source: MrRio/jsPDF

Currently, there is no easy way to specify the desired width of the html in the PDF. The width can only be specified indirectly over html2canvas' scale option (similar to #2917). It would be very convenient, if we could simply supply a width (in PDF units) to the html method. This option should basically function like the width of a browser window (which means, it should not scale the content).

Feature Request medium hacktoberfest

Most helpful comment

@KamranMaqbool ask the two assignees ;)

All 13 comments

I can pick this up!

@hmajid2301 that would be really great!

One thought: the default value should be the width of the current page.

Sorry I'm afraid I won't be able to pick this up any more.

Thanks

Hi there, I'm a first-time contributor, any chance I can work on this?

can i take this?

@helpsdev you can try ;) I'm assigning you for now.

@rubiin Maybe you two can collaborate?

@HackbrettXXX any updates about this issue?

@KamranMaqbool ask the two assignees ;)

can i try this?

Since the others didn't make a contribution, sure go ahead ;)

@HackbrettXXX can you point some direction on this one?

@vbinithyanandamv I would assume, we can just pass the correct width or windowWidth options to html2canvas. We probably need to consider the internal.scaleFactor to convert the PDF unit to pixels. I hope this does the trick. Maybe we also need to set the width of the canvas.js module.

Updates?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MaxCodeDE picture MaxCodeDE  路  4Comments

baluMallisetty picture baluMallisetty  路  4Comments

arulmb0136 picture arulmb0136  路  4Comments

Pinank picture Pinank  路  3Comments

tarekis picture tarekis  路  4Comments