this is word:
TS0910Temp2_Templete.docx (23.2 KB)
this is convert result:
TS0910Temp2_9_Sep_18_2024.pdf (81.6 KB)
this is key code:
public static bool ConvertDocumentToPDF(string docPath, string pdfPath, string title = "")
{
var doc = new Document(docPath);
if (!string.IsNullOrEmpty(title))
{
PdfSaveOptions options = new PdfSaveOptions();
options.CustomPropertiesExport = PdfCustomPropertiesExport.Standard;
doc.BuiltInDocumentProperties.Title = title;
doc.Save(pdfPath, options);
}
else
{
doc.Save(pdfPath);
}
return true;
}