Is there a way to make sure the file may not be altered?

Feb 7, 2012 at 9:29 PM

Is there any way that Silverlight could enforce some security ? At least a readonly protection ?

Coordinator
Feb 7, 2012 at 9:42 PM

look at this http://pdfsharp.com/PDFsharp/index.php?option=com_content&task=view&id=39&Itemid=50 

this is an example how you could "UNPROTECT" a document... so, if you can "unprotect" then it's mean that you can "protect" it using same method.

Feb 8, 2012 at 12:06 AM

THere is also a sample how to protrect (http://www.pdfsharp.net/wiki/ProtectDocument-sample.ashx).

 

I'm just wondering if SilverPDF supports this...

 

Anyone got it to work? I don't want my users to be able to alter the documents and I don't want them to key a password to view the file.

Coordinator
Feb 8, 2012 at 12:21 AM

I know that my question my sound stupid to you... but... why don't you just try to implement PdfSharp example with SilverPDF? :)

I'll say it again. SilverPDF is 99% based on PdfSharp. The two main problems in SilverPDF is luck of "printing" support and Images support (it's a little bit laggy for some type of images)

PS: don't forget to download source code - you can find a lot of examples how to use SilverPDF up there.

Feb 8, 2012 at 12:34 AM

I did.

PdfSecuritySettings securitySettings = document.SecuritySettings;

securitySettings.PermitAccessibilityExtractContent = false;                

 securitySettings.PermitAnnotations = false;               

securitySettings.PermitAssembleDocument = false;               

securitySettings.PermitExtractContent = false;             

securitySettings.PermitFormsFill = false;               

securitySettings.PermitFullQualityPrint = false;               

securitySettings.PermitModifyDocument = false;               

securitySettings.PermitPrint = false;               

securitySettings.DocumentSecurityLevel = PdfDocumentSecurityLevel.None;               

document.Save(dlg.OpenFile());

 

Still produces a PDF that requests me for a password (no where supplied!), and when I supply "owner" as the password I see protection levels that bear no ressemblance to what I set...

Coordinator
Feb 8, 2012 at 1:03 AM

Well, it seems that i have to digg into that.  I can't say for sure right now is it SilverPDF bug or is it PDFSharp bug. Give me some time, I'll give you a response as soon as i get some results.

Feb 8, 2012 at 1:06 AM

My bad : a caching problem in Chrome, the browser was still using the old code. 

 

But I'm note sure it has everything I want in any case.

 

Certificates would really be the way. I know IText (Java) has it, I have already used it.

Coordinator
Feb 8, 2012 at 1:12 AM

I have to dissapoint you here. IText code used in this project only for Image support. There is nothing i can help you right now. I will try to solve that in the next version

Feb 8, 2012 at 1:32 AM

Well, Ai_Boy thank you for your responsiveness.

Coordinator
Feb 8, 2012 at 1:33 AM

np :)