mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-14 02:44:58 +08:00
FIX : undefined references is a valid use case.
I tried to mitigate the breaking change by keep on throwing in most uses of the change method.
This commit is contained in:
@@ -50,6 +50,36 @@ endobj";
|
||||
var reference = Assert.IsType<IndirectReferenceToken>(token.Data);
|
||||
|
||||
Assert.Equal(new IndirectReference(12, 7), reference.Data);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ReadsObjectWithUndefinedIndirectReference()
|
||||
{
|
||||
const string s = @"
|
||||
5 0 obj
|
||||
<<
|
||||
/XObject <<
|
||||
/Pic1 7 0 R
|
||||
>>
|
||||
/ProcSet [/PDF /Text /ImageC ]
|
||||
/Font <<
|
||||
/F0 8 0 R
|
||||
/F1 9 0 R
|
||||
/F2 10 0 R
|
||||
/F3 0 0 R
|
||||
>>
|
||||
>>
|
||||
endobj";
|
||||
|
||||
var scanner = GetScanner(s);
|
||||
|
||||
ReadToEnd(scanner);
|
||||
|
||||
var token = scanner.Get(new IndirectReference(5, 0));
|
||||
Assert.NotNull(token);
|
||||
|
||||
token = scanner.Get(new IndirectReference(0, 0));
|
||||
Assert.Null(token);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
Reference in New Issue
Block a user