empira / PDFsharp-1.5

A .NET library for processing PDF
MIT License
1.28k stars 588 forks source link

Allow uints(PdfUInteger) when calling ReadInt to support some encrypted file header reading #103

Open mitchcapper opened 5 years ago

mitchcapper commented 5 years ago

This allows reading of uints by ReadInt and converts them to negative integers. This allows for reading some headers with other encryption options, even if we don't support that encryption type (useful if pdf still has read access without). Should not break most existing code unless code expected an exception for reading uints and was catching it.

Could look at adding a ReadUInt as well and changing the header functionality depending on preferences but as this allowed reading these PDF's it seemed acceptable to me as is (with in theory low possible side effects).