Q: I would like to remove securoty from PDF to make a backup of a
secured file to a
different location than the source.
internal void BackUpPDF(out string BackUpStatusMessage)
{
var doc = new PDFDoc(_pdfMetaData.SourcePathFile); // Open
the
encrypted document that we saved in the first example.
try
{
if (!doc.InitSecurityHandler())
{
doc.InitSecurityHandler();
}
doc.RemoveSecurity();
doc.Save(_pdfMetaData.BackUpPath + \"conv\" +
\"test.pdf\",SDFDoc.SaveOptions.e_hex_strings);
}
catch (PDFNetException ex)
{
}
}
However the saved file can't be opened in my PDF Reader.
----------------
A: The problem is that the attached document is protected with
password. To
open the document you need to provide a password in
doc.InitStdSecurityHandler("mypass"). Please see EncTest sample
project for
full sample code.