Using aspnet web, the attached file is uploaded, file is copied to System.IO.MemoryStream.
When new PdfDocument(MemoryStream) is executed, it hangs indefinitely. It should crash, the first page is corrupt (bad xref).
Attached is a sample PDF.
- Code: Select all
using (var ms = new MemoryStream())
{
Request.Files[0].InputStream.CopyTo(ms);
ms.Flush();
ms.Seek(0,SeekOrigin.Begin);
using(var pdf = new PdfDocument(ms)){
//do stuff with the PdfDocument
}
}