Page 1 of 1

Find out if document is protected for modification

Posted: Wed Jun 01, 2016 12:35 pm
by Tom Princen
How do i know what is allowed with the PDF?

I found out these 2 functions but they are not documented on the site

GetSecurityData
and
GetSecurityHandler

Re: Find out if document is protected for modification

Posted: Thu Jun 02, 2016 11:15 am
by Sasha - Tracker Dev Team
Hello Tom,

The correct method to use is this:
http://sdkhelp.tracker-software.com/vie ... Permission
And here's the code sample that would hopefully be enough for your cause:

Code: Select all

private void checkDocumentSecurityToolStripMenuItem_Click(object sender, EventArgs e)
{
	PDFXEdit.PXC_PermStatus ps = pdfCtl.Doc.CoreDoc.RequestPermission(PDFXEdit.PXC_RequestObj.Perm_ObjDoc, PDFXEdit.PXC_RequestOper.Perm_OperModify, System.IntPtr.Zero);
	if (ps == PDFXEdit.PXC_PermStatus.Perm_ReqGranted)
		MessageBox.Show("Granted");
	else
		MessageBox.Show("Denied");
}
Cheers,
Alex

Re: Find out if document is protected for modification

Posted: Fri Jun 10, 2016 2:00 pm
by Tom Princen
OK thx!

Re: Find out if document is protected for modification

Posted: Fri Jun 10, 2016 2:04 pm
by Sasha - Tracker Dev Team
:)

Re: Find out if document is protected for modification

Posted: Wed Jun 29, 2016 7:32 am
by Tom Princen
whats the PXC_RequestOper constant for requesting the page extraction right?
once again the documentation not complete...

http://sdkhelp.tracker-software.com/vie ... equestOper

Re: Find out if document is protected for modification

Posted: Wed Jun 29, 2016 7:47 am
by Sasha - Tracker Dev Team
Hello Tom,

Well many enumeration values' names are self explanatory in many cases. Also these are taken for the PDF documentation. In this case the Perm_OperExport should be used as you are using the export pages feature (judging from your description). If you are using the Copy Pages feature then the Perm_OperCopy should be used. If you are moving pages then the Perm_OperDelete should be also checked as you are removing them from their original position in the document.

Cheers,
Alex