Skip to content

Conversation

@eKoopmans
Copy link
Owner

It's supposed to be possible to use a canvas as a direct source, with either of:

  1. html2pdf().from(canvas).save() etc.
  2. html2pdf().set({ canvas: canvas }).save() etc.

But there were two errors preventing this from working:

  1. Typo in getType when using toLowerCase(), meaning the .from() approach didn't work
  2. Missing pageSize initialization in toPdf, meaning both approaches didn't work

This PR should solve the issue - added the all-tags_canvas.pdf snapshot test to verify the fix.

Closes #699

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Function "toLowerCase" not called, impossible to insert a canvas directly

2 participants