Welcome Guest Search | Active Topics | Sign In | Register

Errors while parsing document. Link to attached docs expires in 7 days Options
Raul F
Posted: Monday, February 10, 2025 9:27:22 AM
Rank: Member
Groups: Member

Joined: 9/23/2019
Posts: 15
We are getting the following error:
Error parsing input stream at offset 591305. Expected to read 'R', actually got 'o'.
at EO.Internal.hfac.jlsl(PdfDocumentSecurity daj)
at EO.Internal.hfac.vxcf(Boolean dag, Boolean dah, PdfDocumentSecurity dai)
at EO.Internal.hezr.xvyy(Stream cvm, Boolean cvn, Boolean cvo)
at EO.Internal.hezr..ctor(Stream cuz, PdfDocumentSecurity cva, Boolean cvb, Boolean cvc)
at EO.Internal.hezr..ctor(Stream cvd, PdfDocumentSecurity cve)
at EO.Pdf.PdfDocument..ctor(Stream stream)

When trying to execute the following line (EO.pdf version 23.4.26.0):
var attachmentsPdf = new EO.Pdf.PdfDocument(pdfStream);

Our pdfStream is created in the following way:

var reader = new EO.Pdf.PdfDocument(fileStream);
var docs = new List<EO.Pdf.PdfDocument>();
docs.Add(reader);
var document = EO.Pdf.PdfDocument.Merge(docs.ToArray()); // there is only 1 document in the docs array


and we return CopyPdfDocumentToStreamAsync(document);

private static MemoryStream CopyPdfDocumentToStreamAsync(EO.Pdf.PdfDocument document)
{
var outputStream = new MemoryStream();
document.Save(outputStream);
outputStream.Position = 0;
return outputStream;
}


!!! pdfStream = CopyPdfDocumentToStreamAsync(document);

In this WeTransfer link I've attached the PDF that causes issues and in the txt file also the pdfStream that causes the issues.
https://we.tl/t-CAS9rak9LV (expires in 7 days)

!!Note the .pdf can be opened manually with no problem, but for some reasons that line crashes in the code
eo_support
Posted: Tuesday, February 11, 2025 11:41:03 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,273
Hi,

We tested your file with the latest build (25.0.86) and it seems to work fine. Can you try it and see if it works for you?

Thanks!
Raul F
Posted: Wednesday, February 12, 2025 2:50:51 AM
Rank: Member
Groups: Member

Joined: 9/23/2019
Posts: 15
Hello, have you tried running the following line with the pdfstream provided?

var attachmentsPdf = new EO.Pdf.PdfDocument(pdfStream);

this is where it crashes
Raul F
Posted: Wednesday, February 12, 2025 4:31:15 AM
Rank: Member
Groups: Member

Joined: 9/23/2019
Posts: 15
Also we have license for 23.4.26 not for 25.0.86 so that does not help us.
eo_support
Posted: Wednesday, February 12, 2025 10:38:56 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,273
Hi,

Whether you load from a file name or a stream does not matter because even if you load from a file name, internally it opens a stream from the file and then load from that stream.

When you purchase our product, it automatically includes maintenance for one year. The maintenance covers tech support and version upgrade. After one year if you wish to continue receive tech support and version upgrades, you can renew the maintenance. So if your original purchase is for v23, you might be able to receive v24 for free. If you have renewed your maintenace, it might even cover the current version. If you can PM us your order number or your license key, we can double check this for you for sure. If the current version is not covered, then depending on how old your last order is, you will need to either place a renew order or new order in order to use the current version.

Thanks!
Raul F
Posted: Wednesday, February 12, 2025 10:56:53 AM
Rank: Member
Groups: Member

Joined: 9/23/2019
Posts: 15
Doesn't really help, since we need to upgrade to version 25.0.86 no?

Give me an email so i can give you the license key.
eo_support
Posted: Wednesday, February 12, 2025 11:14:19 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,273
You may or may not. Your license may cover an older version that is newer than your version. In that case you can give that version a try.

You can send us your license by clicking the "PM ME" button under any of our post. Or you can find our email address here:

https://www.essentialobjects.com/forum/test_project.aspx

Needless to say, do not post your license key publically in the forum. The "PM ME" button sends a private message, so it's safe.
Raul F
Posted: Thursday, February 13, 2025 8:37:57 AM
Rank: Member
Groups: Member

Joined: 9/23/2019
Posts: 15
Sent the key to the support email.
eo_support
Posted: Thursday, February 13, 2025 10:21:50 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,273
Hi,

Your order actually covers the current version. However you will need a new key to use the current version. We will email you the new key. Please switch to the current version and use the new key instead and let us know if you continue to have any issues.

Thanks!
Raul F
Posted: Friday, February 14, 2025 3:22:56 AM
Rank: Member
Groups: Member

Joined: 9/23/2019
Posts: 15
Still does not work even after updating the library. Please try to replicate with the code above that i mentioned.
The problem is not with opening the file, the file can be opened with no problem.

The problem is when using the following line:

var attachmentsPdf = new EO.Pdf.PdfDocument(pdfStream);

Added earlier how we create the pdfStream from this file using only eo.pdf library methods.
If you do not want to create the pdfStream, i added it in the wetransfer link.

Thanks.
eo_support
Posted: Friday, February 14, 2025 10:38:24 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,273
Hi,

We found the root of the problem. The issue does not have anything to do with stream or file, but has to do with the contents. There is a minor error in the contents that we will change our code to ignore. So our next build will be able to load this contents without throwing an error. We will reply here again as soon as the new build is available.

Thanks!
Raul F
Posted: Friday, February 14, 2025 10:56:32 AM
Rank: Member
Groups: Member

Joined: 9/23/2019
Posts: 15
Thanks a lot! :)
Raul F
Posted: Friday, February 21, 2025 3:01:42 AM
Rank: Member
Groups: Member

Joined: 9/23/2019
Posts: 15
Any updates?


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.