Hi Anwender,
Apologize to ask questions on your topic.
Hi Awais.hafeez,
Thank you so much for your help.
I do as your advice, but the output in PDF file still not like in Word file. please see attached the output file.
32A76E7A-2832-4A66-AD23-09B63DC065F3.jpeg (303.9 KB)
*Note: The content in my file is “Thai” characters.
The command to convert the PDF file is as following:
Aspose.Words.Document docx = new
Aspose.Words.Document(sourcePath + @"\Source.docx");
string filePdf = destPath + @"\Destination.pdf";
string hyphenFile = hyphenDic + @"\th_TH.dic";
Aspose.Words.Hyphenation.RegisterDictionary(“th-TH”, hyphenFile);
string systemFontFolder = Environment.GetFolderPath(Environment.SpecialFolder.Fonts);
string fontsFolder = HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings[“FontsPdf”].ToString());
Aspose.Words.Fonts.FontSettings fontSetting = new Aspose.Words.Fonts.FontSettings();
fontSetting.SetFontsFolders(new string[] { systemFontFolder, fontsFolder }, true);
docx.FontSettings = fontSetting;
Aspose.Words.DocumentBuilder builderDoc = new Aspose.Words.DocumentBuilder(docx);
builderDoc.PageSetup.PaperSize = Aspose.Words.PaperSize.A4;
docx.UpdatePageLayout();
Aspose.Words.Saving.PdfSaveOptions saveOptions = new Aspose.Words.Saving.PdfSaveOptions();
saveOptions.SaveFormat = Aspose.Words.SaveFormat.Pdf;
docx.Save(filePdf, saveOptions);
Do you have a solution to this problem?
Best regards.