Error [Pdf Structure Library]: Invalid object structure.

PDF-XChange Editor SDK for Developers

Moderators: Tracker Support, TrackerSupp-Daniel, Sean - Tracker, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
khho
User
Posts: 43
Joined: Fri Mar 11, 2022 11:02 am

Error [Pdf Structure Library]: Invalid object structure.

Post by khho »

Hi Team,
I got a scanned document (PDF/A 1b, see attachment), which I open from stream. It is shown properly in the AxPXV_Control.
The document is not modified, but when it is saved (IPXV_Document.Save), the failure 'Error [Pdf Structure Library]: Invalid object structure.' occurs.

Other documents are working.

Would you please check this document?

ScannedDocument.pdf
(2.46 MiB) Downloaded 7 times
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 18113
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Error [Pdf Structure Library]: Invalid object structure.

Post by Tracker Supp-Stefan »

Hello khho,

You seem to be using the Editor SDK.
With your permission I will move this topic to the correct Editor SDK forum.

Can you please confirm the exact build of the SDK that you are using?
As the end user Editor (build 386) does not seem to have any issues with saving that file.
However the End user Editor does not show this file to being a PDF/A one either.
Or are you trying to take this as source, and save it as PDF/A 1b file?

Kind regards,
Stefan
khho
User
Posts: 43
Joined: Fri Mar 11, 2022 11:02 am

Re: Error [Pdf Structure Library]: Invalid object structure.

Post by khho »

Hi,
sorry, yes I'm using the PDF-XChange Editor SDK, so please move it to right forum.

The DLL-Files we use are 381. I tried it with 386 - same problem.

Kind regards,
k.
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2367
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Error [Pdf Structure Library]: Invalid object structure.

Post by Vasyl-Tracker Dev Team »

Hi khho.

We cannot reproduce that error with the latest 10.3.0.386 build. The test app saves the doc successfully.

Can you provide simple codesnippet to reproduce the problem on our side?

Cheers.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
khho
User
Posts: 43
Joined: Fri Mar 11, 2022 11:02 am

Re: Error [Pdf Structure Library]: Invalid object structure.

Post by khho »

Hi Vasyl,
the code is very 'distributed' - that will take a while.

Can you delete page 2 and save? And when you reload that saved document, is there a hint that problems where found?

Best regards
k.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 18113
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Error [Pdf Structure Library]: Invalid object structure.

Post by Tracker Supp-Stefan »

Hello khho,

Just tested with the end user Editor - deleting page 2 and saving the file afterwards worked without any errors or warnings!

Kind regards,
Stefan
khho
User
Posts: 43
Joined: Fri Mar 11, 2022 11:02 am

Re: Error [Pdf Structure Library]: Invalid object structure.

Post by khho »

Hi,
can you do it via the AxPXV_Control, too?

k.
khho
User
Posts: 43
Joined: Fri Mar 11, 2022 11:02 am

Re: Error [Pdf Structure Library]: Invalid object structure.

Post by khho »

Hi,
here's some C# code:

pdfView is the AxPXV_Control

the document is loaded from a stream

Code: Select all

var comStreamWrapper = new COMStreamWrapper(binaryData);
pdfView.OpenDocFrom(comStreamWrapper, null);
when delete pages is called document restrictions are removed

Code: Select all

var pdfDocument = pdfView.Doc;
if (pdfDocument != null)
{
    pdfDocument.CoreDoc.SetRestrictedPermissions(0);
}
cmd.document.deletePages is called

Code: Select all

DeletePagesEventMonitor myDeletePagesMonitor = new DeletePagesEventMonitor(pdfView.Inst.Str2ID("DlgDeletePages"), this);
var uiInst = (IUIX_Inst)pdfView.Inst.GetExtension("UIX");
uiInst.CurrentThreadCtx.RegisterEventMonitor(myDeletePagesMonitor);
pdfView.Inst.ExecUICmd(commandName, pdfView.Doc.ActiveView.Obj);
uiInst.CurrentThreadCtx.UnregisterEventMonitor(myDeletePagesMonitor);
Marshal.ReleaseComObject(uiInst);
if the dialogue wasn't canceled save the document

Code: Select all

var doc = pdfView.Doc;
if (doc != null)
{
    try
    {
        doc.Save();
        Marshal.ReleaseComObject(doc);
    }
    catch (Exception exp)
    {
        HandlePdfXChangeException(exp);
    }
}
Then (often) the error occurs on doc.Save().

We use the x86 Version of the AxPXV_Control.

Is there a way to check if the structure is right by the SDK? And a way to try to repair?
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2367
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Error [Pdf Structure Library]: Invalid object structure.

Post by Vasyl-Tracker Dev Team »

I suppose something can be wrong in the 'COMStreamWrapper<->binaryData' bound. Can you provide the implementation of your COMStreamWrapper? Seems it isn't a standard type from the .NET framework...

OR/AND - can you reproduce the same issue with the normal local file?

And what kind of container for binaryData do you use?
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
khho
User
Posts: 43
Joined: Fri Mar 11, 2022 11:02 am

Re: Error [Pdf Structure Library]: Invalid object structure.

Post by khho »

Hi Vasyl,
thank you for your post. Due to a public holiday my reply is delayed.

I can't reproduce the issue if I load the pdf file with AxPXV_Control.OpenDocFromPath.

Find the COMStreamWrapper class attached. 'binaryData' is a Stream (usually a MemoryStream).

Kind regards
k.


COMStreamWrapper.zip
(1.43 KiB) Downloaded 2 times
khho
User
Posts: 43
Joined: Fri Mar 11, 2022 11:02 am

Re: Error [Pdf Structure Library]: Invalid object structure.

Post by khho »

Hi,
sometimes the program chrashes with an unhandled exception:
Exception at 0x2DD35532 (PDFXEditCore.x86.dll) in dmp: 0xC0000005: Access violation while reading at position 0x00000020

k.
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2367
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Error [Pdf Structure Library]: Invalid object structure.

Post by Vasyl-Tracker Dev Team »

Finally, we found an issue with saving documents on our side, especially when saving to the same source stream. We will fix it soon. Also, later, I will provide you the fixed COMStreamWrapper.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
khho
User
Posts: 43
Joined: Fri Mar 11, 2022 11:02 am

Re: Error [Pdf Structure Library]: Invalid object structure.

Post by khho »

Hi Vasyl,
thank you for your answer!

Keep me up to date.
k.
User avatar
Dimitar - Tracker Supp
Site Admin
Posts: 1837
Joined: Mon Jan 15, 2018 9:01 am

Error [Pdf Structure Library]: Invalid object structure.

Post by Dimitar - Tracker Supp »

:)
khho
User
Posts: 43
Joined: Fri Mar 11, 2022 11:02 am

Re: Error [Pdf Structure Library]: Invalid object structure.

Post by khho »

Hello Tracker team,
can you already estimate when the fix will be available?

Kind regards
k.
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8787
Joined: Wed Jan 03, 2018 6:52 pm

Re: Error [Pdf Structure Library]: Invalid object structure.

Post by TrackerSupp-Daniel »

Hello, khho

With our very small dev team (some of whom are located in Ukraine, and may need to pack up on short notice), all reports, requests, and otherwise are unfortunately not something we can offer solid timelines on at this time.

From Vasyl's reply above, I can infer that he "hopes" to have this resolved in time for the next release, whenever that is.
Build 386 was released less than a month ago. It is possible we will see a smaller (10.3.1) bugfixing release in the next few weeks. However, this build has widely been very stable, so it is also possible the next release will be a larger (10.4.0) feature release. In the latter case, that would put a release estimate somewhere in the ballpark of 1-3 months from now.

Kind regards,
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Post Reply