jsPDF-AutoTable icon indicating copy to clipboard operation
jsPDF-AutoTable copied to clipboard

jsPDF-AutoTable not support utf8 in Vietnamese country?

Open ntruongvux opened this issue 3 years ago • 2 comments

I use version

"jspdf": "^2.5.1",
"jspdf-autotable": "^3.5.25",

Codes:

filePDF.autoTable({
      body: [
        [
          {
            content: 'PHIẾU GIAO XUẤT KHO GIAO HÀNG',
            styles: {
              halign: 'center',
              fontStyle: 'bold',
            },
          },
        ],
      ],
      theme: 'plain',
      styles: {
        font: 'times',
      },
    });

Resutls:

image

ntruongvux avatar Aug 01 '22 09:08 ntruongvux

You likely need to add a new font to jspdf supporting the characters you want. See en example in the custom styles example.

simonbengtsson avatar Aug 01 '22 10:08 simonbengtsson

@simonbengtsson Thank you, I add font and it worked

ntruongvux avatar Aug 02 '22 08:08 ntruongvux

This issue will soon be closed since issues in this project are mainly meant to be bugs or feature requests. Questions are directed to stackoverflow.

github-actions[bot] avatar Aug 10 '22 02:08 github-actions[bot]