|
Rank: Member Groups: Member
Joined: 3/18/2014 Posts: 15
|
Using the latest EO on nuget (19.1.25) I get a "last block incomplete in decryption" exception trying to open a (specific) PDF. It happens w/EO 19.0.69 as well, can't speak to other versions. Sample code and exception are below. The PDF is not password protected, but it is signed. I can share the PDF, but not over open forums.
Code: C#
using System;
static class Program
{
static void Main()
{
var p = new EO.Pdf.PdfDocument(@"E:\tmp\BadPDF.pdf");
}
}
Code: C#
EO.Internal.fp
HResult=0x80131500
Message=last block incomplete in decryption
Source=EO.Base
StackTrace:
at EO.Internal.ap7.a(Byte[] A_0, Int32 A_1)
at EO.Pdf.PdfDocumentSecurity.a.a(Byte[] A_0, Byte[] A_1, Byte[] A_2, Boolean A_3, Boolean A_4)
at EO.Pdf.PdfDocumentSecurity.a.a(Stream A_0, Byte[] A_1, Stream A_2, Boolean A_3)
at EO.Pdf.PdfDocumentSecurity.a.a(Int64 A_0, Int64 A_1, Stream A_2, Stream A_3, Boolean A_4)
at EO.Pdf.PdfDocumentSecurity.a(Int64 A_0, Int64 A_1, Stream A_2, Stream A_3, Boolean A_4)
at EO.Internal.vx.a(PdfDocumentSecurity A_0, Int32 A_1, Int32 A_2)
at EO.Internal.akt.a.a(a5c A_0)
at EO.Internal.al.c(a5c A_0)
at EO.Internal.al.a(a5c A_0)
at EO.Internal.al.a(IEnumerable`1 A_0)
at EO.Internal.akt.a(PdfDocumentSecurity A_0)
at EO.Internal.akt.a(Boolean A_0, Boolean A_1, PdfDocumentSecurity A_2)
at EO.Internal.gh.a(Stream A_0, Boolean A_1, Boolean A_2)
at EO.Internal.gh.a(String A_0)
at EO.Internal.gh..ctor(String A_0, PdfDocumentSecurity A_1)
at EO.Pdf.PdfDocument..ctor(String fileName)
at Program.Main() in f:\dev\TestPDF\TestPDF\Program.cs:line 7
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi, This usually indicates a corrupted PDF file. In such case we can look into it and see if we can ignore the block in question and still load the rest. You can send the PDF file to us and we will be happy to take a look. Please see here for our email address: https://www.essentialobjects.com/forum/test_project.aspxThanks!
|
|
Rank: Member Groups: Member
Joined: 3/18/2014 Posts: 15
|
EMail Sent.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi,
This is just to let you know that we have found the root of the problem. This will be resolved in our next build.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 3/18/2014 Posts: 15
|
Terrific, thanks. Does the code change work around a bad PDF, or was there a bug. Just curious. And any ETA on the build? Rough numbers is fine, next week? Next month? Next quarter? :-)
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
It was a bug on our end. We should have an update next week.
|
|
Rank: Member Groups: Member
Joined: 3/18/2014 Posts: 15
|
Awesome work as always. Thanks. Have a great weekend.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi,
This is just to let you know that we have posted a new build that should resolve the issue. You can download the new build from our download page. Please take a look and let us know how it goes.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 3/18/2014 Posts: 15
|
Passes my sample test at least, so I'd say it's good. Build 19.1.40 is what I got from nuGet.
Thanks for the help, call it resolved! :-)
-W
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Great. Thanks for confirming the fix!
|
|
Rank: Newbie Groups: Member
Joined: 7/25/2019 Posts: 4
|
Hi, unfortunately I have exactly the same issue, but I am already using the lastest Version (19.1.95.0) of EO.PDF.dll.
Code: Visual Basic.NET
at EO.Internal.an2.a(Byte[] A_0, Int32 A_1)
at EO.Pdf.PdfDocumentSecurity.a.a(Byte[] A_0, Byte[] A_1, Byte[] A_2, Boolean A_3, Boolean A_4)
at EO.Pdf.PdfDocumentSecurity.a.a(Stream A_0, Byte[] A_1, Stream A_2, Boolean A_3)
at EO.Pdf.PdfDocumentSecurity.a.a(Int64 A_0, Int64 A_1, Stream A_2, Stream A_3, Boolean A_4)
at EO.Pdf.PdfDocumentSecurity.a(Int64 A_0, Int64 A_1, Stream A_2, Stream A_3, Boolean A_4)
at EO.Internal.us.a(PdfDocumentSecurity A_0, Int32 A_1, Int32 A_2)
at EO.Internal.aiz.a.a(a2r A_0)
at EO.Internal.ak.c(a2r A_0)
at EO.Internal.ak.a(a2r A_0)
at EO.Internal.ak.a(IEnumerable`1 A_0)
at EO.Internal.aiz.a(PdfDocumentSecurity A_0)
at EO.Internal.aiz.a(Boolean A_0, Boolean A_1, PdfDocumentSecurity A_2)
at EO.Internal.fz.a(Stream A_0, Boolean A_1, Boolean A_2)
at EO.Internal.fz.a(String A_0)
at EO.Internal.fz..ctor(String A_0, PdfDocumentSecurity A_1)
at EO.Pdf.PdfDocument..ctor(String fileName)
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi,
Can you send us the PDF file in question through our contact us page? Once we have the file, we will look into it and see what we can find.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 7/25/2019 Posts: 4
|
Hi,
File sent.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi, This is just to let you know that we have found the root of the problem. This is a slightly different problem than the original problem mentioned in this thread, even though they both cause the same error message. The original problem was that an encrypted PDF file allows metadata in the file NOT to be encrypted and our code did not handle that scenario (our older version treated metadata as always encrypted). The issue in your file is that there is an empty 0 byte data block that is marked as encrypted, this is obviously not necessary and our code did not properly skip such block. This will be fixed in our next build. Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 7/25/2019 Posts: 4
|
Hi,
thanks for the quick Response.
When will the next build be available?
Regards
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
We post updates quite frequently. It should be out in maybe two weeks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi,
This is just to let you know that we have posted a new build that should fix this problem. You can download the new build from our download page. Please take a look and let us know how it goes.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 7/25/2019 Posts: 4
|
Hi,
yes, it works again with the current Version.
Thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Great. Thanks for confirming the fix!
|
|