logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
adammckay  
#1 Posted : Thursday, March 9, 2023 3:47:21 PM(UTC)
adammckay

Rank: Member

Groups: Registered
Joined: 6/22/2022(UTC)
Posts: 10
United States
Location: Pennsylvania

I have a PDF that is Secured in Adobe Acrobat (File-->Properties-->Change-->Permissions section).

When I load that PDF in PDFium 9.70.39.472, it will load - though it should give me an InvalidPasswordException.


try
{
using (var doc = PdfDocument.Load("secured.pdf"))
{
ProcessDocument(doc);
}
}
catch (InvalidPasswordException)
{
throw new Exception("This PDF has a password and you don't know what it is!");
}


My code never hits the catch. It just loads the PDF without issue. To make matters worse, if I save the PDF:
doc.Save(@"secured-newpwd.pdf", SaveFlags.NoIncremental | SaveFlags.RemoveSecurity);



It actually saves a new PDF without the password even though I am never supplying the password.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.