PdfCjkFontFamily
16 Dec 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 = document.embedFont(PdfCjkFontFamily.heiseiMinchoW3, 20, PdfFontStyle.regular, true);
// Create a new PDF string format
let format: PdfStringFormat = new PdfStringFormat(PdfTextAlignment.right, PdfVerticalAlignment.bottom);
// Draw the text
page.graphics.drawString('こんにちは世界', font, {x: 0, y: 180, width: page.size.width, height: 40}, new PdfBrush({r: 0, g: 0, b: 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.