Skip to content

html2pdf reduces font quality #733

@Tamagotchi9

Description

@Tamagotchi9

This method takes html canvas (previously rendered PDF file with other lib) and generates new PDF with bad quality of text:

canvasToBase64Pdf (element, width, height) { const options = { image: { type: 'jpeg', quality: 1 }, html2canvas: { scale: 1 }, jsPDF: { orientation: width > height ? 'landscape' : 'portrait' } } return window.html2pdf() .from(element) .set(options) .outputPdf('datauristring') .then(result => result) }

I tried increasing scale in html2canvas and many other configs of html2canvas and jsPDF options, nothing works well for me. This screenshots show diffrence between quality before (first screenshot) and after (second screenshot) usage of html2pdf. Do you know how can I change my approach in order to achieve better quality ?
Image
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions