Skip to content

Commit 3ca5279

Browse files
committed
Add a new overload to accept a string as an owner password
1 parent 9d507a3 commit 3ca5279

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/iTextSharp.LGPLv2.Core/iTextSharp/text/pdf/PdfReader.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public class PdfReader : IPdfViewerPreferences, IDisposable
143143
/// @throws IOException on error
144144
/// </summary>
145145
/// <param name="filename">the file name of the document</param>
146-
public PdfReader(string filename) : this(filename, ownerPassword: null)
146+
public PdfReader(string filename) : this(filename, (byte[])null)
147147
{
148148
}
149149

@@ -160,6 +160,16 @@ public PdfReader(string filename, byte[] ownerPassword)
160160
ReadPdf();
161161
}
162162

163+
/// <summary>
164+
/// Reads and parses a PDF document.
165+
/// @throws IOException on error
166+
/// </summary>
167+
/// <param name="filename">the file name of the document</param>
168+
/// <param name="ownerPassword">the password to read the document</param>
169+
public PdfReader(string filename, string ownerPassword) : this(filename, ownerPassword.GetIsoBytes())
170+
{
171+
}
172+
163173
/// <summary>
164174
/// Reads and parses a PDF document.
165175
/// @throws IOException on error

0 commit comments

Comments
 (0)