Can there be Password in XPS File so that only authorised C# code can open it in WPF Document Viewer? [closed]

StackOverflow https://stackoverflow.com/questions/10780921

  •  11-06-2021
  •  | 
  •  

Question

We have all heard that XPS is Microsoft's answer to Adobe's PDF. Since PDF File has password facility so i was wondering is there any such facility in XPS Files also.

Why and where I want it :-

I need to display some books which are stored in file system in XPS format. I do not want user to open them without my app because in my app i have Document Viewer where i have disabled printing and copying.

Now can I provide password in those XPS files so that they cannot be opened outside my app?

Was it helpful?

Solution

I was also looking such thing. and finally i got to know that XPS files are xml formatted files. and its also globally known so if some how you get the knowledge to how to protect. Than it self its not quite safe. May be you change the extension for these files. What I did for this is I created a custom file extension for these files and provided my own encryption and then after I could open these files only into my wpf application. Here are some link these could help you.

http://msdn.microsoft.com/en-us/library/ms748388.aspx

http://msdn.microsoft.com/en-us/magazine/cc163664.aspx

http://xpsreader.codeplex.com/

http://www.ericsink.com/wpf3d/B_Printing.html

http://blogs.msdn.com/b/ptallett/archive/2006/05/11/595612.aspx

OTHER TIPS

You might look at

Cryptographic Services

You would have the decryption key (certificate) in your app. But they could hack your app to extract the certificate.

More involved but using RMS you can lock down XPS documents. Your organization’s intellectual property should be safe and highly secure. Active Directory Rights Management Services (AD RMS), a component of Windows Server 2008 R2, is available to help make sure that only those individuals who need to view a file can do so. AD RMS can protect a file by identifying the rights that a user has to the file. Rights can be configured to allow a user to open, modify, print, forward, or take other actions with the rights-managed information. With AD RMS, you can now safeguard data when it is distributed outside of your network.

SecureXPS

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top