Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Sun Aug 01, 2021 12:26 pm

Hi,

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
    }
}

danielscoggins
 
Posts: 15
Joined: Fri Jul 03, 2020 11:48 am

Mon Aug 02, 2021 8:27 am

Hello,

Thank you for your inquiry.
I did not find your sample PDF in this post, hence I simulated a PDF file and tested it with the code you provided, but did not reproduce your problem. The version I used is the latest Spire.PDF(Spire.PDF Pack(Hot Fix) Version:7.7.10 ). If you were not using the latest version, please first give it a try. If the issue still exists after trying, please provide your sample PDF file again for our further investigation. You could attach it here or send to us via email ([email protected]). Thanks in advance.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Wed Aug 04, 2021 2:18 pm

Hi Annika,

We are on 7.5.0. but I also tried 7.7.10 and 7.8.2. the behavior across each version is the same.

I couldn't upload the file, I've emailed it to support.

Thanks,
Daniel

danielscoggins
 
Posts: 15
Joined: Fri Jul 03, 2020 11:48 am

Thu Aug 05, 2021 3:34 am

Hello,

Thank you for sharing the file via email.
I tested your PDF file and reproduced your issue. I have logged the issue into our Bug tracking system with the ticket number SPIREPDF-4531. Our development team will investigate and fix it. Once it is resolved, I will inform you. Sorry for the inconvenience caused.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.PDF