Do you own a Debenu Quick PDF Library 12/11/10/9/8/7? Upgrade to Debenu Quick PDF Library 13!

Foxit Quick PDF Library

Frequently Asked Question:

Return to FAQ Index

Does Quick PDF support adding Chinese characters into PDF files?

Question

Does Quick PDF support adding Chinese characters into PDF files?

Answer

Yes, you can add Chinese text to a PDF using Quick PDF Library by using the AddSubsettedFont function. Here is a Visual Basic example showing how to subset a font and draw text using Unicode characters.

Dim PDF As TQuickPDF0718
Set PDF = CreateObject("TQuickPDF0718")
Call PDF.UnlockKey (" - your license key here - " )

Dim S As String
S = "Hello: " & ChrW(&H4F60) & ChrW(&H597D)
Call PDF.AddSubsettedFont ("Verdana", 7, S)
Call PDF.DrawText (100, 500, PDFSq.GetSubsetString (S))
Call PDF.SaveToFile ("c:\unicode.pdf")
Set PDF = Nothing

It's also possible to add Chinese, Japanese and Korean text into PDF files using the AddCJKFont function. Here's a sample in C#:

int fontid = QP.AddCJKFont(1);
string inputText = "这是中文文本。"; // Chinese text
string UTF16inputText = QP.ToPDFUnicode(inputText);
QP.SelectFont(fontid);
QP.DrawText(100, 600, UTF16inputText);
QP.SaveToFile("Unicode.pdf");

If you want to write Japanese or Korean text just update the inputText string.


© 2015 Debenu & Foxit. All rights reserved. AboutBuyContactBlogNewsletterSupportFAQProduct UpdatesForum