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
Problem with ToolProperties, StichyNotes, InsertEmptyPages
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- User
- Posts: 13
- Joined: Wed Aug 20, 2008 10:05 am
-
- Site Admin
- Posts: 2448
- Joined: Thu Jun 30, 2005 4:11 pm
Re: Problem with ToolProperties, StichyNotes, InsertEmptyPages
ID==36305Maybe you can tell me the function id für this command(inserting empty pages) or any other possibility to reach my goal.
Name="InsertEmptyPages" (note: will be added into the next build==[41.8])

For prevent of all user's changes you can use: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?
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.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 108
- Joined: Wed May 13, 2009 2:21 pm
Re: Problem with ToolProperties, StichyNotes, InsertEmptyPages
Hi,
I can't open document in ReadOnly mode. I use the following code :
thanks for help.
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)
-
- User
- Posts: 664
- Joined: Tue Nov 14, 2006 12:23 pm
Re: Problem with ToolProperties, StichyNotes, InsertEmptyPages
When you use "SetDocumentProperty" function you don't need to specify "Documents" in property name.
So, next code will work fine:or
So, next code will work fine:
Code: Select all
PDFView.SetDocumentProperty(nDocID, "ReadOnly", "True", 0)
Code: Select all
PDFView.SetProperty("Documents[#"+nDocID+"].ReadOnly", "True", 0)