Mon Nov 21, 2022 10:07 am
We have been facing issue while converting business word document (docx) to PDF since long time. I tried all settings and timely upgrading package and hotfixes, unfortunately nothing work out for us. When we convert same document from Microsoft word by save as PDF then there is no formatting issue. Please see an attached one example for more details
Please see below line of codes that we used on our application
//Load & Convert Word Document
using (Document document = new Document(System.IO.File.OpenRead(filePath), true))
{
document.ClearMacros();
document.KeepSameFormat = true;
ToPdfParameterList toPdfParameter = new ToPdfParameterList
{
UsePSCoversion = true,
IsEmbeddedAllFonts = false,
PdfConformanceLevel = PdfConformanceLevel.None,
DisableLink = false,
UpdateFields = false
};
//Convert Word to PDF
document.SaveToStream(originalPdfStream, toPdfParameter);
}
Hot Fix Version: 7.11.0
.Net framework 4.6
Programming Language C#
Login to view the files attached to this post.