mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-14 02:44:58 +08:00
fix bug with compact font format font matrix reading and where endstream token is missed if immediately following 'e'
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
//[Fact]
|
//[Fact]
|
||||||
//public void Tests()
|
//public void Tests()
|
||||||
//{
|
//{
|
||||||
// var files = new[] { @"C:\Users\eliot\Downloads\Encrypted1.pdf" };
|
// var files = Directory.GetFiles(@"C:\temp\pdfs");
|
||||||
|
|
||||||
// foreach (var file in files)
|
// foreach (var file in files)
|
||||||
// {
|
// {
|
||||||
|
@@ -71,12 +71,18 @@
|
|||||||
{
|
{
|
||||||
var array = ToArray(operands);
|
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}.");
|
throw new InvalidOperationException($"Expected four values for the font matrix, instead got: {array}.");
|
||||||
}
|
}
|
||||||
|
|
||||||
dictionary.FontMatrix = TransformationMatrix.FromArray(array);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
|
@@ -304,7 +304,7 @@
|
|||||||
|
|
||||||
endStreamPosition = 0;
|
endStreamPosition = 0;
|
||||||
endObjPosition = 0;
|
endObjPosition = 0;
|
||||||
commonPartPosition = 0;
|
commonPartPosition = (inputBytes.CurrentByte == commonPart[0]) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
binaryWrite.Write(inputBytes.CurrentByte);
|
binaryWrite.Write(inputBytes.CurrentByte);
|
||||||
|
Reference in New Issue
Block a user