diff --git a/src/UglyToad.PdfPig.Tests/Integration/LocalTests.cs b/src/UglyToad.PdfPig.Tests/Integration/LocalTests.cs index 39a61e21..f8894828 100644 --- a/src/UglyToad.PdfPig.Tests/Integration/LocalTests.cs +++ b/src/UglyToad.PdfPig.Tests/Integration/LocalTests.cs @@ -13,7 +13,7 @@ //[Fact] //public void Tests() //{ - // var files = new[] { @"C:\Users\eliot\Downloads\Encrypted1.pdf" }; + // var files = Directory.GetFiles(@"C:\temp\pdfs"); // foreach (var file in files) // { diff --git a/src/UglyToad.PdfPig/Fonts/CompactFontFormat/Dictionaries/CompactFontFormatTopLevelDictionaryReader.cs b/src/UglyToad.PdfPig/Fonts/CompactFontFormat/Dictionaries/CompactFontFormatTopLevelDictionaryReader.cs index 25cf18d6..41cb323c 100644 --- a/src/UglyToad.PdfPig/Fonts/CompactFontFormat/Dictionaries/CompactFontFormatTopLevelDictionaryReader.cs +++ b/src/UglyToad.PdfPig/Fonts/CompactFontFormat/Dictionaries/CompactFontFormatTopLevelDictionaryReader.cs @@ -71,12 +71,18 @@ { var array = ToArray(operands); - if (array.Length != 4) + if (array.Length == 4) + { + dictionary.FontMatrix = TransformationMatrix.FromArray(array); + } + else if (array.Length == 6) + { + dictionary.FontMatrix = TransformationMatrix.FromArray(array); + } + else { throw new InvalidOperationException($"Expected four values for the font matrix, instead got: {array}."); } - - dictionary.FontMatrix = TransformationMatrix.FromArray(array); } break; case 8: diff --git a/src/UglyToad.PdfPig/Tokenization/Scanner/PdfTokenScanner.cs b/src/UglyToad.PdfPig/Tokenization/Scanner/PdfTokenScanner.cs index c0fcfb19..73f45b00 100644 --- a/src/UglyToad.PdfPig/Tokenization/Scanner/PdfTokenScanner.cs +++ b/src/UglyToad.PdfPig/Tokenization/Scanner/PdfTokenScanner.cs @@ -304,7 +304,7 @@ endStreamPosition = 0; endObjPosition = 0; - commonPartPosition = 0; + commonPartPosition = (inputBytes.CurrentByte == commonPart[0]) ? 1 : 0; } binaryWrite.Write(inputBytes.CurrentByte);