Hello,
Is there a method in Merger to check if document is signed before I manipulate it?
Thanks,
Anna
Can I check if PDF is signed?
Re: Can I check if PDF is signed?
Support · Oct 8, 2018Hello,
Merger does not have the capability to detect if a PDF is signed or not. We don’t have any other products that can detect signed PDFs.
Thanks,
ceTe Software Support Team.
Re: Can I check if PDF is signed?
Forum member · Apr 5, 2020Has there been any change since this was originally brought up? Even if it were a simple boolean "IsSigned" would be extremely useful.
What we need to do is change our workflow of what we do with the PDF if it's signed or not and this may be a show stopper for us.
Were you able to find a work around or did you have to go with a different product that offered the functionality (if so, which one did you go with)?
Thanks,
Re: Can I check if PDF is signed?
Forum member · Apr 6, 2020Hello,
This is what we did
private bool IsSigned(string pdfAsText)
{
int part1 = pdfAsText.IndexOf("/Adobe.PPKLite");
if (part1 < 0) return false;
int part2 = pdfAsText.IndexOf("/M(D:");
if (part2 < 0) return false;
int part3 = pdfAsText.IndexOf(")/Name(");
if ((part3 <= part2) || (part2 <= part1)) return false;
// scan for "/M(D:" soon followed by ")/Name("
return true;
}
Been using it for 4 years now, seems to work.
Re: Can I check if PDF is signed?
Support · Apr 6, 2020Hello,
Our developers are working on this feature and we will be releasing it soon. We will update this post once it’s ready for download.
Thanks,
ceTe Software Support Team
Re: Can I check if PDF is signed?
Support · Apr 10, 2020
Hello,
This feature is included in the latest release, DynamicPDF for .NET v10.27. You can download latest from Nuget (product ID: ceTe.DynamicPDF.CoreSuite.NET) or from our website here
.
Please use the Signed Boolean property of the PdfDocument object to check whether the PDF is singed or not. Below is a code sample.
PdfDocument pdf = new PdfDocument(@"Input PDF file path");
bool isSigned = pdf.Signed;
Thanks,
ceTe Software Support Team
Re: Can I check if PDF is signed?
Support · May 7, 2020Hello,
The feature to detect whether an existing PDF is protected with a user or owner password is included in latest release, DynamicPDF for .NET v10.28. You can download latest from Nuget (product ID: ceTe.DynamicPDF.CoreSuite.NET) or from our website here
.
Here is a code sample:
EncryptionInfo info = PdfDocument.GetEncryptionInfo("PDF file path or byte array");
bool hasOwnerPasword = info.HasOwnerPassword;
bool hasUserPassword = info.HasUserPassword;
Thanks,
ceTe Software Support Team