Is there a way to ask the control if document has attachment

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

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

Post Reply
docu-track99
User
Posts: 528
Joined: Thu Dec 06, 2007 8:13 pm

Is there a way to ask the control if document has attachment

Post by docu-track99 » Fri Oct 07, 2011 8:07 pm

Hello Tracker Support,

Item 1:
Is there a way to ask the control if a document has any attachments? The reason for this is that the attachment indicator is on the 'Document Options' toolbar which we have disabled for other reasons.

Item 2:
When the viewer control property READONLY=TRUE:
a-Should the Add Attachment button be disabled? (It does ignore the click which is good.)
b-You should not be able to delete attachments but you can.

Thanks.

Ivan - Tracker Software
Site Admin
Posts: 3651
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: Is there a way to ask the control if document has attach

Post by Ivan - Tracker Software » Fri Oct 07, 2011 9:07 pm

to check if document has embedded files (not via file attachment annotations), you can use the following javascript code

Code: Select all

this.dataObjects.length
which will return the number of embedded files in the document.
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.

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

Re: Is there a way to ask the control if document has attach

Post by Vasyl-Tracker Dev Team » Mon Oct 10, 2011 9:57 am

Item 1:
Is there a way to ask the control if a document has any attachments?
Code sample (pseudocode):

Code: Select all

variant dataInStub;
variant attachmentsCount;
pdfViewer.DoDocumentVerb(docId, "", "GetAttachmentsCount", dataInStub, out attachmentsCount, PXCVA_Sync);
boolean docHasAttachments = (attachmentsCount != 0);
Item 2:
When the viewer control property READONLY=TRUE:
a-Should the Add Attachment button be disabled? (It does ignore the click which is good.)
b-You should not be able to delete attachments but you can.
a - yes
b - it is bug
We will check and fix these bugs. Please wait for next build. Thanks.

Best
Regards.
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.

Post Reply