I have created a number of Docx files using the spire.doc component and it works great. I then tried to save the docx files as pdf files using the component and got mixed results. I have attached all of the files for your review.
here is the code I am using
Spire.Doc.Document spireDocClone = null;
try
{
Spire.Doc.Document spireDoc = new Spire.Doc.Document();
spireDoc.LoadFromFile(this.TemplatePath + "\\" + letter.RTFPath);
spireDocClone = spireDoc.Clone();
spireDoc.Close();
RunLetter(spireDocClone, letter);
string fileName = Guid.NewGuid().ToString() + "_" + letter.TemplateName + ".pdf";
this.OutputFile = System.IO.Path.Combine(this.PdfPath, fileName);
string docxfile = System.IO.Path.Combine(this.PdfPath, Guid.NewGuid().ToString() + "_" + letter.TemplateName + ".docx");
spireDocClone.SaveToFile(docxfile, FileFormat.Docx2010);
spireDocClone.SaveToFile(this.OutputFile, Spire.Doc.FileFormat.PDF);
catch (Exception ex)
{
string str = ex.Message;
}
finally
{
if(spireDocClone != null)
spireDocClone.Close();
}