hi aspose,
we are using aspose.pdf.pdf, and aspose.words.
i am converting word document to pdf and showing the pdf in page using respose.Outputstream().i have given a folder for temporary folder to use for images. but after completing conversion it is not deleting temporary files in folders. iam using following code .
srcDoc is a aspose words document.
DataTable dtCustomerValues = objEOCNotification.GetCutomerRelatedInfo(customerId);
srcDoc.MailMerge.Execute(dtCustomerValues);
string outFileName = Server.MapPath("./") + @"UploadImages\";
srcDoc.SaveOptions.ExportImagesFolder = Path.GetDirectoryName(outFileName);
MemoryStream xmlDoc = new MemoryStream();
srcDoc.Save(xmlDoc, Aspose.Words.SaveFormat.AsposePdf);
xmlDoc.Position = 0;
Aspose.Pdf.Pdf pdf = new Aspose.Pdf.Pdf();
pdf.BindXML(xmlDoc, null);
pdf.IsImagesInXmlDeleteNeeded = true;
MemoryStream objMemoryStream = new MemoryStream();
try
{
pdf.Save(objMemoryStream);
byte[] b = objMemoryStream.ToArray();
Response.Clear();
Response.Charset = "";
Response.ContentType = "application/pdf";
Response.OutputStream.Write(b, 0, Convert.ToInt32(b.Length));
Response.Flush();
Response.Close();
}
catch (Exception ex)
{
// throw new Exception(ex.Message);
Response.Clear();
Response.Write(ex.Message);
}
aspose is not deleting the temporary images from the folder UploadImages,which i have mentioned and i am using
pdf.IsImagesInXmlDeleteNeeded = true;
please give us a solution to delete the files ASAP.
Thanks and Regards,
bhaskar.