I've been using Spire.Doc to convert Word Documents to pdf using memory streams, using the following method:
- Code: Select all
protected static Stream ConvertWordToPdfStream(Stream stream)
{
Document doc = new Document(stream);
var pdfStream = new MemoryStream();
doc.SaveToStream(pdfStream, FileFormat.PDF);
pdfStream.Position = 0;
return pdfStream;
}
On a Linux based container, I've been running into an issue, that the disk runs full over time and was able to localize it to this piece of code using Spire.PDF creating some files in the /tmp/ folder that all begin with "ff" (like for example "ffhDuqq8" or "ffr1qeqk") and contain binary data. These files aren't removed after the conversion is finished, which causes them to accumulate until the disk runs full. I've tried using "using" declarations to dispose of the Document object and stream but the files are not removed.
I can't reproduce this issue on Windows. Is this a bug in Spire.Doc or is there a leak in the above code, I'm not aware of?
Thanks in advance!