e.pagesView.ready / CmdPaneBottom / CmdLine(s) missing for "compare results" document  SOLVED

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, 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
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

e.pagesView.ready / CmdPaneBottom / CmdLine(s) missing for "compare results" document

Post by zarkogajic »

Hi Support,

I'm using e.pagesView.ready to add/remove some commands from PagesView CmdPaneBottom.

For "normal" document I would catch e.pagesView.ready and remove/add commands from the only CmdLine it is there:

image.png
image.png (11.34 KiB) Viewed 1138 times

In the above I'm removing "cmdbar.docOptions".

I want to do the same for the "compare result" document - but when e.pagesView.ready fires for it - the CmdPaneBottom has no lines - even though they do appear on UI.

What event to catch to do the needed ?

p.s.
For normal documents CmdPaneTop has no lines.
For "compare result" Top pane has comparison commands (sidebyside, new, old, next change...) - however CmdPaneTop.Count also returns 0.

p.s.2
I do not want to remove that bar permanently for all documents (but per document), therefore cannot use Inst.ShowCmdBar().



-žarko
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: e.pagesView.ready / CmdPaneBottom / CmdLine(s) missing for "compare results" document

Post by Vasyl-Tracker Dev Team »

The 'comparison-docs-report' document is visualized in special way and has special panes layout. The its main pane has ID="cmpDocsPagesView". And this pane contains cmdbar.cmpDocsRes on the top and cmdbar.docOptions, cmdbar.pageNav, cmdbar.pageLayout, cmdbar.pageZoom, cmdbar.launchApp on the bottom. So in this case you need to catch the e.documentView.ready and then:

Code: Select all

docView = (IPXV_DocumentView)pFrom;
IPXV_View view = docView.ActiveView[Str2ID("cmpDocsPagesView")];
if (view)
{
     view.CmdPaneBottom;
     ... 
}
HTH.
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.
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: e.pagesView.ready / CmdPaneBottom / CmdLine(s) missing for "compare results" document

Post by zarkogajic »

Vasyl,

Great, thanks, will try.

Btw, how do I check if a document is a "compare document"?

(say also a compare doc created by Ad*be)

-žarko
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: e.pagesView.ready / CmdPaneBottom / CmdLine(s) missing for "compare results" document

Post by Vasyl-Tracker Dev Team »

You may check it via:

bool bIsCmpReport = docView.ViewType == PXV_DocumentViewType_CmpReport;

OR (equivalent):

cmpView = docView.ActiveView[Str2ID("cmpDocsPagesView")];
bool bIsCmpReport = (cmpView != null);
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.
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: e.pagesView.ready / CmdPaneBottom / CmdLine(s) missing for "compare results" document

Post by zarkogajic »

Hi Vasyl,

Thanks.

I've already tested the ViewType (PXV_DocumentViewType) expecting to have PXV_DocumentViewType_CmpReport for "compare results" document - but the result is always PXV_DocumentViewType_Normal. So, maybe a bug?

The "cmpView = docView.ActiveView[Str2ID("cmpDocsPagesView")];" does work as you suggested.

Anyhow, how to check on the Core (or pxs) level if a document is a "comparison doc"?

p.s.
I see when opening a comparison document done using Ad*be - you properly figure out it is such a document.

-žarko
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: e.pagesView.ready / CmdPaneBottom / CmdLine(s) missing for "compare results" document

Post by Vasyl-Tracker Dev Team »

I've already tested the ViewType (PXV_DocumentViewType) expecting to have PXV_DocumentViewType_CmpReport for "compare results" document - but the result is always PXV_DocumentViewType_Normal. So, maybe a bug?
Unfortunately there is a bug :(
We will fix it in the near future.
Anyhow, how to check on the Core (or pxs) level if a document is a "comparison doc"?
You may try this:

Code: Select all

bool bIsCmpReport = false;

IPXC_Document coreDoc;
...
IPXS_Document cosDoc = coreDoc.CosDocument;

cosDoc.LockDocument();

IPXS_PDFVariant root = cosDoc.Root;
if (root != null)
{
     IPXS_PDFVariant  pieceInfo = root.Dict_Get("PieceInfo");
     if (pieceInfo != null)
         bIsCmpReport = pieceInfo.Dict_Get("ComparePDF") != null;
}

cosDoc.UnlockDocument();
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.
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8438
Joined: Wed Jan 03, 2018 6:52 pm

e.pagesView.ready / CmdPaneBottom / CmdLine(s) missing for "compare results" document

Post by TrackerSupp-Daniel »

:)
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