I’ve modified helloworld from the github examples as follows
public class HelloWorld
{
public static void Run()
{
// ExStart:1
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_AsposePdf_QuickStart();
// Initialize document object
Document document = new Document();
// Add page
Page page = document.Pages.Add();
// Add text to new page
Aspose.Pdf.Text.TextFragment tf = new Aspose.Pdf.Text.TextFragment("안녕");
Pdf.Text.FontSourceCollection sources = Aspose.Pdf.Text.FontRepository.Sources;
//Aspose.Pdf.Text.Font font = Aspose.Pdf.Text.FontRepository.OpenFont(dataDir + "NotoSansKR-Regular.otf");
Aspose.Pdf.Text.Font font = Aspose.Pdf.Text.FontRepository.FindFont("Batang");
font.IsEmbedded = true;
tf.TextState.Font = font;
page.Paragraphs.Add(tf);
// Save updated PDF
document.Save(dataDir + "HelloWorld_out.pdf");
// ExEnd:1
Console.WriteLine("\nPDF file password changed successfully.\nFile saved at " + dataDir);
}
}
When using batang, it is rendered correctly. But when I use notosanskr-black it is rendering Chinese characters?
@inyeolsohn
The font you are using should support have complete support of all the characters of the language that you are adding text in. Furthermore, can you please explain a bit more about the issue by sharing screenshot and sample font files so that we can further proceed to assist you accordingly.
The font I’m using definitely has all the characters of the language.
I do not have result pdfs on me but I will get back to you asap with them when I get back from work.
I’ve uploaded the fonts on my google drive and the link is as follows;
You can also get them from google fonts
Here are the resulting pdfs from running the code
I’ve noticed that the characters from the faulty pdf file renders correctly when pasted to other text editors such as notepad
ohh my god… the faulty pdf renders correctly when opened in google chrome, but renders in Chinese when opened in adobe pdf reader.
It’s fine for me to use google chrome as a pdf reader, but I’d love an explanation if possible?
Thanks in advance
@inyeolsohn
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): PDFNET-54664
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Ohh okay.
I’m going to use google Chrome as a main pdf reader till a fix gets published, or maybe even after, then
Thank you very much!.