Free Support Forum - aspose.com

Aspose.Pdf.Pdf pdf it is not deleting temporary image fields

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.

Hi,

I have run some tests and was able to reproduce the error that you have reported. I have logged this as PDFNET-4052 in our issue tracking system. Our developers are working on it and wil try to provide the solution as soon as possible.

Thanks.

Hello!
Thank you for asking this.
Please take a new version of Aspose.Pdf 3.6.1.4 from this forum post:
http://www.aspose.com/Community/Forums/permalink/99800/100318/ShowThread.aspx#100318
There is the version advised by Hans fixing this issue before the official hotfix.
Regards,