We run a batch to generate about 600 PDF files. Each PDF file is 3 pages, about 500 KB, with some text and PNG images, and a PNG image from Bing map. every once a while (like 1/400) in one of the PDF file, there is a gray rectangle about 2’‘X4’’ or 4’'X4"" on the map image. (the map image file is fine) see below for the code snippet.
If I un-commented out those lines related to “outputTmp”, then the result PDF files seem always good (over thousands of pdf files). But the performance is much worse (~50% slower). Do you have any idea what happens? is there any fix? thanks!
-----code------------
Pdf pdf = null;
MemoryStream output = null;
//MemoryStream outputTmp = null;
try {
pdf = new Pdf();
output = new MemoryStream();
//outputTmp = new MemoryStream();
pdf.BindFO(fodoc);
pdf.FoMetaData = GetMetaData();
//workaround
//pdf.Save(outputTmp);
pdf.Save(output);
return output.ToArray();
} catch (Exception ex) {
throw ex;
} finally {
if (output != null) output.Dispose();
//if (outputTmp != null) outputTmp.Dispose();
}
----endofcode------