auto open/close attachment pane

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
EricAriens
User
Posts: 130
Joined: Tue May 03, 2016 1:11 pm

auto open/close attachment pane

Post by EricAriens »

Hi,

I want to automatically open the attachment pane when the pdf has attachments, and close the pane if the document has no attachments.
I can detect the what document is showed with the e.activeDocChanged event.
The problem is determining if the active doc has attachments. I checked the online software sdk page but could not find anything.

How can I detect if the active doc has attachments?

Regards
Eric
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: auto open/close attachment pane

Post by Sasha - Tracker Dev Team »

Hello Eric,

The source for the attachments in the Attachments View can be ether the EmbeddedFiles Tree or the annotations on pages. You can look here, how to get to the Tree:
https://sdkhelp.pdf-xchange.com/vie ... ments_edit
As for the attachments on pages, you should look for the FileAttachment annotations.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
EricAriens
User
Posts: 130
Joined: Tue May 03, 2016 1:11 pm

Re: auto open/close attachment pane

Post by EricAriens »

Hi,

Yep thats it.

Part one.

Code: Select all

PDFXEdit.IPXC_NameTree Tree = doc.CoreDoc.GetNameTree("EmbeddedFiles");
uint nAttachmentsCount = Tree.Count;
if (nAttachmentsCount > 0)
{
    ShowPane(IDS.attachmentsView, true);
}
else
{
    ShowPane(IDS.attachmentsView, false);
}
Part two will follow soon ;-)

Regards
Eric
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: auto open/close attachment pane

Post by Sasha - Tracker Dev Team »

:wink:
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply