printable Document

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

Rad1
User
Posts: 108
Joined: Wed May 13, 2009 2:21 pm

printable Document

Post by Rad1 »

Hi,

Have you any idea how to set document as no printable ?

An other question is how to intercept the chnage active document event. I want to get a notification when I change the current active document in the view.

Thanks for help.
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: printable Document

Post by Corwin - Tracker Sup »

On changing active document you will receive "Documents.Active" propery changed event.
So in _IPDFXCviewEvents::OnEvent if Type = PXCVA_OnPropertyChanged and Name = "Documents.Active" that indicates that active document was changed. For more information, pleese see Help or provided samples.
To restrict printing document from Viewer UI you can turn off "Print" (57607) command.

Code: Select all

PDFView.SetProperty("Commands[#57607].state", "Offline", 0);
Rad1
User
Posts: 108
Joined: Wed May 13, 2009 2:21 pm

Re: printable Document

Post by Rad1 »

I work on MDI Mode, I have different documents opned with different permissions. I want to make one document no printable like Readonly for no change. Like this :

Code: Select all

PDFView.SetProperty("Documents[#"+DocID+"].Printable", 0, 0)


How can I intercept this the change active document in th JavaScript ?

Thanks.
Rad1
User
Posts: 108
Joined: Wed May 13, 2009 2:21 pm

Re: printable Document

Post by Rad1 »

I look for this preperty :
Image

I want to deny it for one or more document that I choose.

Thanks.
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: printable Document

Post by Corwin - Tracker Sup »

In JavaScript for web pages you can use the following code to receive document changed event

Code: Select all

<script>
..........
	function PDFXCviewEvent(Type, Name, DataIn, DataOut, Flags)
	{
		if ((Type == 1) && (Name == "Documents.Active"))
			alert("Changed active document");
	}
..........
</script>
.................
<object id="PDFView" classid="CLSID:FE36F0F3-F082-41B7-9EED-772505A7C054" width="100%" height="90%">
</object>

<script language=javascript for="PDFView" event="OnEvent(Type, Name, DataIn, DataOut, Flags)">
    PDFXCviewEvent(Type, Name, DataIn, DataOut, Flags);
</script>
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: printable Document

Post by Corwin - Tracker Sup »

PDFView.SetProperty("Documents[#"+DocID+"].Printable", 0, 0)
Sorry, I don't think that PDF-XChange ActiveX will ever support such property. But you can easily disable or enable "Print" command when you receive "Documents.Active" event.
Rad1
User
Posts: 108
Joined: Wed May 13, 2009 2:21 pm

Re: printable Document

Post by Rad1 »

yes, it's what I do.
Thanks for help
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: printable Document

Post by John - Tracker Supp »

;)
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com