Jorge M
Jorge M

Reputation: 135

Unknown encryption type opening pdf file

When opening a pdf file with the iTextSharp library I get the following error: Error: Unknown encryption type R = 6

The code is

 PdfReader reader = new PdfReader(new RandomAccessFileOrArray(file), null);

Many thanks, Jorge

Upvotes: 8

Views: 13664

Answers (1)

Yulian Gaponenko
Yulian Gaponenko

Reputation: 588

The R key in the standard security handler encryption dictionary denotes the revision of handler that shall be used to interpret this dictionary. The value of 6 is introduced in ISO32000-2 (PDF 2.0), it corresponds to AES encryption with a encryption key length of 256 bits.

PDF 2.0 is a new standard, and it's features are supported only by the new version of the library, iText7 for .NET, starting from 7.1.0.

Even though ISO32000-2 was released only a year ago, this encryption type was confirmed to be a part of the new standard years ago and can be met in documents created even earlier. E.g. Acrobat can encrypt with this revision starting from Acrobat X.

Upvotes: 11

Related Questions