We are using Aspose.PDF to convert a document created by
Aspose.Words to PDF. The generated PDF is PDF version 1.4. Is there
any way we can target PDF version 1.5? Here is the code we are using
to generate:
private static void SaveAsPdf(Document doc, string fileName)
{
//Save the document in Aspose.Pdf.Xml format into a memory stream.
MemoryStream stream = new MemoryStream();
doc.Save(stream, SaveFormat.AsposePdf);
//Seek to the beginning so it can be read by XmlDocument.
stream.Seek(0, SeekOrigin.Begin);
//Load the document into an XmlDocument
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(stream);
//Load the XML document into Aspose.Pdf
Aspose.Pdf.Pdf pdf = new Aspose.Pdf.Pdf();
//Make sure the images that were saved by Aspose.Words into Windows temporary
//folder are automatically deleted by Aspose.Pdf when they are no longer needed.
pdf.IsImagesInXmlDeleteNeeded = true;
pdf.BindXML(xmlDoc, null);
//*** Aspose.Pdf font cache, see comments below.
//pdf.IsTruetypeFontMapCached = false;
//If you convert to PDF multiple files in your application,
//uncomment the following lines to improve the speed of conversion.
pdf.IsTruetypeFontMapCached = true;
pdf.TruetypeFontMapPath = Path.GetTempPath();//<some path where you have read/write access>
//Now produce the PDF file.
pdf.Security = new Aspose.Pdf.Security();
pdf.Security.IsCopyingAllowed = false;
pdf.Save(fileName);
}