PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Nov 13, 2018 5:36 am

All times are UTC

Forum rules

Please read this before posting on this forum: Forum Rules

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Tue Jul 08, 2014 4:00 pm 

Joined: Wed Jun 04, 2014 5:51 pm
Posts: 6
I have a PDFSharp project where I open a pdf template, update some of its text fields then save it out to a memory stream and eventually to acrobat. If i want the pdf to be read only, i need to access the pdfDocument's SecuritySettings, set the PermitModify property to false, and assign the OwnerPassword property. If i don't set the owner password none the of the other SecuritySettings properties take effect. However setting the password also encrypts the document (128bit). This is all fine, except that my document contains a hyperlink. When the doc is encrypted the hyperlink is broken...the field's text looks normal (ie "https://www.whatever.com") but when i mouse over the link, it looks... well encrypted. When i click on the link it causes an error. If i don't set the OwnerPassword, the doc isn't encrypted and the link works fine.

Is this a known issue and is there a work around? I don't really care if the doc is encrypted or not - as long as it's readonly.

I can make the document in effect read only by iterating through all the acroform fields and individually setting them all to readonly. However the document itself is still not readonly and when the user closes the doc, they get that annoying popup window asking if they want to save their "changes", even though there are no changes.

Has anyone run into this?

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: Baidu [Spider] and 8 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group