PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Encryption breaks hyperlinks?
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2859
Page 1 of 1

Author:  AndyM [ Tue Jul 08, 2014 4:00 pm ]
Post subject:  Encryption breaks hyperlinks?

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?
Thanks

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/