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 03, 2015 1:48 pm

Dear support,

To check the latest hotfix, we did a run on all pdf files in out system. In the last 3 moths, 155 documents were added to our system which Spire.PDF cannot handle properly. The errors are
- Invalid/Unknown/Unsupported format Unsupported compressor (JPXDecode)
- Index was outside the bounds of the array
- Object reference not set to an instance of an object
- Signature 'Signature1' failed to verified
- StackOverflowException
- Unexpected token
- Value cannot be null

I created a small test tool to test some of the documents:
Code: Select all
 static void Main(string[] args)
        {
            string[] folders = Directory.GetDirectories(@"C:\DMSAnalyse\");

            foreach (string folder in folders)
            {
                if (!folder.EndsWith(@"InfiniteLoop") &&
                    !folder.EndsWith(@"StackOverflow"))
                {
                    string[] files = Directory.GetFiles(folder, "*.pdf");
                    TestMinimal(files);
                }
            }

            Console.WriteLine("Done. Press a key to continue");
            Console.ReadKey();

            // Method below causes a StackOverflowException in SaveAsImage
            string[] files1 = Directory.GetFiles(@"C:\DMSAnalyse\StackOverflow", "*.pdf");
            TestMinimal(files1);

            ////Metchod below causes an infinite loop in SaveAsImage
            //string[] files2 = Directory.GetFiles(@"C:\DMSAnalyse\InfiniteLoop\", "*.pdf");
            //TestMinimal(files2);
        }

        private static void TestMinimal(string[] files)
        {
            foreach (string file in files)
            {
                try
                {
                    // Constructor crashes on some files (Unexpected token)
                    using (PdfDocument doc = new PdfDocument(file))
                    using (PdfDocument mergedPDF = new PdfDocument(PdfConformanceLevel.Pdf_A1B))
                    {
                        // Conformance property throws NullReference on some files
                        PdfConformanceLevel level = doc.Conformance;
                        mergedPDF.InsertPageRange(doc, 0, doc.Pages.Count - 1);

                        using (MemoryStream pdfStream = new MemoryStream())
                        {
                            // SaveToStream causes invalid format in some pdf's
                            mergedPDF.SaveToStream(pdfStream);
                        }

                        // SaveAsImage causes several errors, sometimes stack overflow, sometimes index out of bounds etc.
                        using (Image bitmapTemp = doc.SaveAsImage(0, 72, 72))
                        {
                            // do nothing
                        }
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(file + ": " + ex.ToString());
                }
            }
        }


Due to privacy issues, I cannot share the documents on a public forum, our client will send the documents in an e-mail.

Please note that one particular document causes the doc.SaveAsImage(0, 72, 72) call to go in an infinite loop, however I cannot send you that document because it's a scan of a Dutch passport. I hope you can discover the cause by code inspection.

Kind regards,

Sikke Kooistra

[email protected]
 
Posts: 33
Joined: Fri Jun 27, 2014 1:39 pm

Wed Nov 04, 2015 7:22 am

Hello Sikke,

Thanks for your inquiry.
I have recreated your issues and forwarded them to our dev team. We will tell you when there is any update on them.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3011
Joined: Wed Jun 27, 2012 8:50 am

Wed Nov 04, 2015 2:13 pm

Hi Amy,

Could you prioritize the Invalid/Unknown/Unsupported format Unsupported compressor (JPXDecode) error? This one happens most of the times (130 of the 155 files gave that error).

Regards,

Sikke

[email protected]
 
Posts: 33
Joined: Fri Jun 27, 2014 1:39 pm

Thu Nov 05, 2015 2:22 am

Hi Sikke,

Ok, I have forwarded your message to our dev team.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3011
Joined: Wed Jun 27, 2012 8:50 am

Tue Nov 10, 2015 2:31 am

Hi Sikke,

Thanks for waiting.
The Invalid/Unknown/Unsupported format Unsupported compressor (JPXDecode) error has been fixed.
Please download and test spire.pdf_3.5.168.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3011
Joined: Wed Jun 27, 2012 8:50 am

Wed Nov 11, 2015 8:29 am

Dear Amy,

Thank you for your reply. I have tested the new dll's with the problem pdf's and the Unsupported compressor error is gone!

Are these dll's suitable for a production environment or are they for test purposes only?

And do you have a timeline for the other errors?

Kind regards,

Sikke Kooistra

[email protected]
 
Posts: 33
Joined: Fri Jun 27, 2014 1:39 pm

Wed Nov 11, 2015 9:51 am

Hello,

These dlls are suitable for the production environment. As the complexity of other issues, sorry that we can't give you the timeline.

Thanks,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Fri Nov 13, 2015 7:54 am

Hi,

All your issue have been resolved. We will provide you with a new version within next week.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3011
Joined: Wed Jun 27, 2012 8:50 am

Tue Nov 17, 2015 8:14 am

Hi,

Thanks for waiting.
Please download and test new version as below:
http://www.e-iceblue.com/downloads/Temp ... .5.183.zip

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3011
Joined: Wed Jun 27, 2012 8:50 am

Wed Nov 18, 2015 11:58 am

Hi Amy,

I tested the new release and most of the issues are resolved. However, the infinite loop problem still occurs. Is there no way for you to tackle this problem without the actual pdf? I am not allowed to share the pdf, it's a scan of a Dutch passport.


Regards,

Sikke Kooistra

[email protected]
 
Posts: 33
Joined: Fri Jun 27, 2014 1:39 pm

Thu Nov 19, 2015 1:21 am

Hi Sikke Kooistra,

Thanks for your feedback.
If we don't recreate the issue, we will have no way to find the cause which caused it. Thanks for understanding.
Would you please create an example file which can reproduce the issue?

Please kindly note that we take customer's confidential information as serious as them. We will never publish or disclose any information of our customer. This is always the promise we keep to our customer and the regulation we must obey.

Thank you.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3011
Joined: Wed Jun 27, 2012 8:50 am

Tue Dec 08, 2015 9:04 am

Hi Amy,

When can I expect 3.5.183 to become available on NuGet? We use NuGet to manage our dependencies in our project.

Kind regards,

Sikke

[email protected]
 
Posts: 33
Joined: Fri Jun 27, 2014 1:39 pm

Wed Dec 09, 2015 2:25 am

Hi Sikke,

Thanks for your inquiry.
We just update published version to NuGet, but 3.5.183 is a temporary version. We will release a new version of Spire.PDF and update it to NuGet soon. When it is ok, we will inform you.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3011
Joined: Wed Jun 27, 2012 8:50 am

Tue Dec 15, 2015 6:05 am

Hi,

Thanks for waiting.
We have updated new version to NuGet. Welcome to download Spire.PDF Pack Version:3.6 from http://www.nuget.org/packages/Spire.PDF/.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3011
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.PDF