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.

Tue Nov 19, 2019 2:53 pm

Hello,
I am using the Spire.Pdf Nuget package for my Azure function.
Sometimes, than I use the large PDF files, I've the OutOfMemory Exception in LoadFromStream line.
Spire.Pdf.PdfDocument pdfdoc = new Spire.Pdf.PdfDocument();
pdfdoc.LoadFromStream(msPdf);
System.OutOfMemoryException:
at spr⠇.ᜀ (Spire.Pdf, Version=5.9.6.2046, Culture=neutral, PublicKeyToken=663f351905198cb3)
at spr⠇.ᜀ (Spire.Pdf, Version=5.9.6.2046, Culture=neutral, PublicKeyToken=663f351905198cb3)
at spr⠇..ctor (Spire.Pdf, Version=5.9.6.2046, Culture=neutral, PublicKeyToken=663f351905198cb3)
at Spire.Pdf.PdfDocument.LoadFromStream (Spire.Pdf, Version=5.9.6.2046, Culture=neutral, PublicKeyToken=663f351905198cb3)
at DematJob.Business.Jobs.ImportFilesJob+<CheckFilesContent>d__5.MoveNext (DematJob.Business.Jobs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=nullDematJob.Business.Jobs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: D:\a\1\s\DematJob.Business.Jobs\ImportFilesJob.csDematJob.Business.Jobs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: 320)

juliame2307
 
Posts: 3
Joined: Tue Nov 19, 2019 2:34 pm

Wed Nov 20, 2019 3:15 am

Hi,

Thanks for your inquiry.
To help us investigate your issue accurately. Please offer us your input Pdf file.
You could upload it here or send us(support@e-iceblue.com) via email.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Mon Jan 27, 2020 6:51 pm

Hello,
The OutOfMemory exception is fixed, but we have an another error in signature certificats validation, than the pdf document has more than 450 pages.
I've attached the pdf file with signature, than I try to verify the signature certificates, I receive an error at the line

Code: Select all
string thumbPrint="3D763835849616F9CF991388645070C0530F8B40";

 using (var doc = new PdfDocument())
      {
        doc.LoadFromStream(ms); //load from memory stream object
        List<Spire.Pdf.Security.PdfSignature> signatures = new List<Spire.Pdf.Security.PdfSignature>();
        var form = (PdfFormWidget)doc.Form;
        for (int i = 0; i < form.FieldsWidget.Count; ++i)
        {
          var field = form.FieldsWidget[i] as PdfSignatureFieldWidget;
          if (field != null && field.Signature != null)
          {
            Spire.Pdf.Security.PdfSignature signature = field.Signature;
           
         
            foreach (X509Certificate2 cert in signature.Certificates) //[b]Here an error, than we have a pdf with more than 450 pages[/b]
            {
              if (cert.Thumbprint == thumbPrint)
                return true;
            }
           

          }
        }
      }

juliame2307
 
Posts: 3
Joined: Tue Nov 19, 2019 2:34 pm

Tue Jan 28, 2020 11:43 am

Hello,

Thanks for your contacting.
I did a test with your file and found it threw the exception “Invalid signature object”. This issue has been logged into our bug tracking system with the ticket SPIREPDF-3018. If there is any update, I will inform you. Sorry for the inconvenience caused.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Tue Feb 11, 2020 6:28 pm

Hi,
Do you have any updates about the ticket SPIREPDF-3018?
We have this problem in our production environment and It really bothers.
Thanks,
Yulia

juliame2307
 
Posts: 3
Joined: Tue Nov 19, 2019 2:34 pm

Wed Feb 12, 2020 2:46 am

Hello,

Thanks for your following up.
After our Dev team’ further investigation, we found that the digital signature data of your document is wrong, causing our product to fail to parse it. Thus, it would throw the exception “Invalid signature object”.
Our Spire.PDF follows the PDF standard. And when validating the signature in Adobe, it will also get the error information “Error during signature verification”, as shown in the attached screenshot. Hope you can understand.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.PDF