Lock command / toolbar / pane

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

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

cew
User
Posts: 213
Joined: Tue Feb 01, 2011 8:14 am

Lock command / toolbar / pane

Post by cew »

Hi there,

how do I lock commands / toolbar / panes?

E.g. I don't allow the users of my application to annotate any PDFs.
Therefore I have to lock the "Comment and markup Toolbar".
Is this possible??

Best regards
cew
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: Lock command / toolbar / pane

Post by Corwin - Tracker Sup »

Hi,
cew wrote: how do I lock commands / toolbar / panes?
You may set "View.Locked" property to true (using SetProperty function), or use LockedView property of Viewer Ax component.
cew wrote: I don't allow the users of my application to annotate any PDFs.
For this you may use "General.DenyAllModifyOperations" property.

HTH.
cew
User
Posts: 213
Joined: Tue Feb 01, 2011 8:14 am

Re: Lock command / toolbar / pane

Post by cew »

This seems to restrict the user to a predefined set of commands and
your 2nd approach means setting the document to readonly, right?

Is it possible to just deny the use of some single commands like "open" and allow the user toolbar customization anyway?
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: Lock command / toolbar / pane

Post by Vasyl - PDF-XChange »

Hi,

Please see our SDK example named "Commands"...

HTH.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
cew
User
Posts: 213
Joined: Tue Feb 01, 2011 8:14 am

Re: Lock command / toolbar / pane

Post by cew »

Thanks for you help!

Now I know how to disable commands.
Is it possible to hide or dynamic add/remove commands from toolbars?

Best
cew
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: Lock command / toolbar / pane

Post by Vasyl - PDF-XChange »

Hi, cew.

Now you may disable command by (example):

Code: Select all

ctrl.SetProperty("Commands["Open"].State", "Offline", 0); // to disable "Open..." command in all toolbars and menu
You will be able to add/remove/hide commands in the next version V3.

HTH
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
cew
User
Posts: 213
Joined: Tue Feb 01, 2011 8:14 am

Re: Lock command / toolbar / pane

Post by cew »

Are the commands "grouped", so I can disable all comment/annotation-commands with one call or do i have to find out which command allows modifying a document on my own?
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: Lock command / toolbar / pane

Post by Vasyl - PDF-XChange »

You may make the document read-only for end-user:

Code: Select all

ctrl.SetDocumentProperty(docId, "ReadOnly", "true", 0);
All commands are ungrouped. Look to our SDK help, [Reference/Named Items/Objects/Commands/Commands List] section (first column in table):
AreaTool,
ArrowTool
CalloutTool
CloudTool
CrossOutTextTool
DistanceTool
EraserTool
FileAttachmentTool
LineTool
OvalTool
PencilTool
PerimeterTool
PolygonTool
PolyLineTool
QuadLinkTool
RectangleTool
RectLinkTool
StampTool
StickyNoteTool
TextBoxTool
TypewriterTool
UnderlineTextTool
HighlightTextTool
---------------------------
AddBookmark
AddFileAttachment
AddLink
AddNote
AddNoteToSelText
AddReply
ApplyDefaultProperties
ApplyDefaultTextFormatting
HighlightSelText
CrossOutSelText
DeleteReply
FlattenAnnots
FlipLine
ImportComments
MeasureDeleteLabel
MeasureEditLabel
MeasureRestoreCaptionPos
OpenAllPopups
OpenPopup
ToggleAnnotLockState
UnderlineSelText
---
There are main commands for commenting/editing...

HTH
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
cew
User
Posts: 213
Joined: Tue Feb 01, 2011 8:14 am

Re: Lock command / toolbar / pane

Post by cew »

Thanks a lot!

Great support! :!: :!:

Best regards
cew
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19885
Joined: Mon Jan 12, 2009 8:07 am

Re: Lock command / toolbar / pane

Post by Stefan - PDF-XChange »

Kudos to Vasyl :)

And support is one of the things we do stress on most :)

Cheers,
Stefan