PdfCjkFontFamily
12 Sep 20251 minute to read
Public enum to define CJK font family.
// Load an existing PDF document
let document: PdfDocument = new PdfDocument(data, password);
// Gets the first page
let page: PdfPage = document.getPage(0) as PdfPage;
// Create a new PDF CJK standard font
let font: PdfCjkStandardFont = new PdfCjkStandardFont(PdfCjkFontFamily.heiseiMinchoW3, 20);
// Create a new PDF string format
let format: PdfStringFormat = new PdfStringFormat(PdfTextAlignment.right, PdfVerticalAlignment.bottom);
// Draw the text
page.graphics.drawString('こんにちは世界', font, [0, 180, page.size[0], 40], undefined, new PdfBrush([0, 0, 255]), format);
// Save the document
document.save('output.pdf');
// Destroy the document
document.destroy();-
hanyangSystemsGothicMedium- Specifies thehanyangSystemsGothicMediumCJK font family. -
hanyangSystemsShinMyeongJoMedium- Specifies thehanyangSystemsShinMyeongJoMediumCJK font family. -
heiseiKakuGothicW5- Specifies theheiseiKakuGothicW5CJK font family. -
heiseiMinchoW3- Specifies theheiseiMinchoW3CJK font family. -
monotypeHeiMedium- Specifies themonotypeHeiMediumCJK font family. -
monotypeSungLight- Specifies themonotypeSungLightCJK font family. -
sinoTypeSongLight- Specifies thesinoTypeSongLightCJK font family.