We have a word document with a structure and when we convert this word document to pdf, it does not keep that structure.
We attach the word document, the pdf generated from the conversion with spire.Doc and the pdf generated from the Word application itself, this document is the result we expect from the conversion by spire.Doc.
We are working with .Net Core 2.2
We have a license.
We have the nuget Spire.Office version 7.12.5
Next we put a fragment of the code of how we read the Word document and make the conversion to PDF.
- Code: Select all
MemoryStream ms = new MemoryStream();
using (Document document = new Document(System.IO.File.OpenRead("c:\\borrar\\toPDF.docx"), true))
{
ToPdfParameterList toPdfParameter = new ToPdfParameterList
{
UsePSCoversion = true,
IsEmbeddedAllFonts = false,
PdfConformanceLevel = PdfConformanceLevel.None,
DisableLink = false,
UpdateFields = false
};
//Convert Word to PDF
document.SaveToStream(ms, toPdfParameter);
document.SaveToFile("c:\\borrar\\toPDF.PDF", toPdfParameter);
}