Problem with ToolProperties, StichyNotes, InsertEmptyPages

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

Hans Lecker
User
Posts: 13
Joined: Wed Aug 20, 2008 10:05 am

Problem with ToolProperties, StichyNotes, InsertEmptyPages

Post by Hans Lecker »

We are using the ActiveX Control PDF-XChange (Build 407) in our application an try to achieve a kind of reader mode for the control.
So I use "Commands[Name].State = offline" to prevent changes through certain functions at the current pdf-document.

In this context i wasn't able to find a CommandName for the function which is responsible for inserting empty pages. This function is new in build 407. Maybe you can tell me the function id für this command or any other possibility to reach my goal.

We have another problem with Commands[ToolProperties].State = offline. It is still possible to change the properties of an annotation in the toolbar, if the annotation is not locked. In our application context, i also want to prevent the user from moving annotations. I can prevent this, if i lock the annotation. But the problem is that i cannot change every annotation in this document to locked state. Is ist possible to tell the PDF-XChange Control to treat every annotation as locked?

I am looking forward to your competent answers.

HL
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: Problem with ToolProperties, StichyNotes, InsertEmptyPages

Post by Vasyl - PDF-XChange »

Maybe you can tell me the function id für this command(inserting empty pages) or any other possibility to reach my goal.
ID==36305
Name="InsertEmptyPages" (note: will be added into the next build==[41.8]) :oops:
We have another problem with Commands[ToolProperties].State = offline. It is still possible to change the properties of an annotation in the toolbar, if the annotation is not locked. In our application context, i also want to prevent the user from moving annotations. I can prevent this, if i lock the annotation. But the problem is that i cannot change every annotation in this document to locked state. Is ist possible to tell the PDF-XChange Control to treat every annotation as locked?
For prevent of all user's changes you can use:
SetDocumentProperty(<DocID>, "ReadOnly", "True");
If you wanted to lock annotations only you can use Java Script below (by RunJavaScript method):

Code: Select all

function LockAnnotsOnPage(nPage)
{
    var annots = this.getAnnots(nPage);
    if (annots == null)
        return;
    for (var i = 0; i < annots.length; i++)
    {
        annots[i].lock = true;
    }
}
function LockAllAnnots()
{
    for (var i = 0; i < this.numPages; i++)
        LockAnnotsOnPage(i);
}
LockAllAnnots();
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.
Rad1
User
Posts: 108
Joined: Wed May 13, 2009 2:21 pm

Re: Problem with ToolProperties, StichyNotes, InsertEmptyPages

Post by Rad1 »

Hi,

I can't open document in ReadOnly mode. I use the following code :

Code: Select all

PDFView.OpenDocument("C:/test.pdf","",DocID,0)

PDFView.SetDocumentProperty(DocID,"Documents.ReadOnly", "True", 0)
thanks for help.
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: Problem with ToolProperties, StichyNotes, InsertEmptyPages

Post by Corwin - Tracker Sup »

When you use "SetDocumentProperty" function you don't need to specify "Documents" in property name.
So, next code will work fine:

Code: Select all

PDFView.SetDocumentProperty(nDocID, "ReadOnly", "True", 0)
or

Code: Select all

PDFView.SetProperty("Documents[#"+nDocID+"].ReadOnly", "True", 0)