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 the hanyangSystemsGothicMedium CJK font family.
  • hanyangSystemsShinMyeongJoMedium - Specifies the hanyangSystemsShinMyeongJoMedium CJK font family.
  • heiseiKakuGothicW5 - Specifies the heiseiKakuGothicW5 CJK font family.
  • heiseiMinchoW3 - Specifies the heiseiMinchoW3 CJK font family.
  • monotypeHeiMedium - Specifies the monotypeHeiMedium CJK font family.
  • monotypeSungLight - Specifies the monotypeSungLight CJK font family.
  • sinoTypeSongLight - Specifies the sinoTypeSongLight CJK font family.