Skip to content

Commit

Permalink
Added test file and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JanSlabon committed Jan 15, 2025
1 parent 01bda42 commit 9747192
Show file tree
Hide file tree
Showing 2 changed files with 145 additions and 0 deletions.
Binary file added tests/_files/pdfs/PDF-complex-structure.pdf
Binary file not shown.
145 changes: 145 additions & 0 deletions tests/functional/PdfReader/PdfReaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,151 @@ public function getPageProvider()
]
];

$data[] = [
$path . '/PDF-complex-structure.pdf',
[
1 => PdfIndirectObject::create(
3,
0,
PdfDictionary::create([
'Contents' => PdfIndirectObjectReference::create(16, 0),
'Group' => PdfDictionary::create([
'CS' => PdfName::create('DeviceRGB'),
'S' => PdfName::create('Transparency'),
'Type' => PdfName::create('Group'),
]),
'ICNValidStructure' => PdfNumeric::create(0),
'Margins' => PdfArray::create([
PdfNumeric::create(0),
PdfNumeric::create(0),
PdfNumeric::create(0),
PdfNumeric::create(0)
]),
'MediaBox' => PdfArray::create([
PdfNumeric::create(0),
PdfNumeric::create(0),
PdfNumeric::create(595.2),
PdfNumeric::create(841.92)
]),
'Parent' => PdfIndirectObjectReference::create(2, 0),
'Resources' => PdfDictionary::create([
'ExtGState' => PdfDictionary::create([
'GS7' => PdfIndirectObjectReference::create(7, 0),
]),
'Font' => PdfDictionary::create([
'F1' => PdfIndirectObjectReference::create(5, 0),
'FXF1' => PdfIndirectObjectReference::create(2095, 0),
]),
'ProcSet' => PdfArray::create([
PdfName::create('PDF'),
PdfName::create('Text'),
PdfName::create('ImageB'),
PdfName::create('ImageC'),
PdfName::create('ImageI'),
]),
'XObject' => PdfDictionary::create([
'FXX1' => PDfIndirectObjectReference::create(2089, 0),
])
]),
'StructParents' => PdfNumeric::create(0),
'Tabs' => PdfName::create('S'),
'Type' => PdfName::create('Page'),
])
),
2 => PdfIndirectObject::create(
26,
0,
PdfDictionary::create([
'Contents' => PdfIndirectObjectReference::create(83, 0),
'CropBox' => PdfArray::create([
PdfNumeric::create(0),
PdfNumeric::create(0),
PdfNumeric::create(595.2),
PdfNumeric::create(841.68)
]),
'ICNValidStructure' => PdfNumeric::create(0),
'Margins' => PdfArray::create([
PdfNumeric::create(0),
PdfNumeric::create(0),
PdfNumeric::create(0),
PdfNumeric::create(0)
]),
'MediaBox' => PdfArray::create([
PdfNumeric::create(0),
PdfNumeric::create(0),
PdfNumeric::create(595.2),
PdfNumeric::create(841.68)
]),
'Parent' => PdfIndirectObjectReference::create(25, 0),
'Resources' => PdfDictionary::create([
'ColorSpace' => PdfDictionary::create(),
'Font' => PdfDictionary::create([
'Font0' => PdfIndirectObjectReference::create(144, 0),
'Font1' => PdfIndirectObjectReference::create(141, 0),
'Font2' => PdfIndirectObjectReference::create(77, 0),
]),
'ProcSet' => PdfArray::create([
PdfName::create('PDF'),
PdfName::create('Text'),
PdfName::create('ImageB'),
PdfName::create('ImageC'),
PdfName::create('ImageI'),
]),
'XObject' => PdfDictionary::create([
'XObject3' => PDfIndirectObjectReference::create(47, 0),
])
]),
'Rotate' => PdfNumeric::create(0),
'Type' => PdfName::create('Page'),
])
),
10 => PdfIndirectObject::create(
124,
0,
PdfDictionary::create([
'Contents' => PdfIndirectObjectReference::create(110, 0),
'CropBox' => PdfArray::create([
PdfNumeric::create(0),
PdfNumeric::create(0),
PdfNumeric::create(595.2),
PdfNumeric::create(841.68)
]),
'Margins' => PdfArray::create([
PdfNumeric::create(0),
PdfNumeric::create(0),
PdfNumeric::create(0),
PdfNumeric::create(0)
]),
'MediaBox' => PdfArray::create([
PdfNumeric::create(0),
PdfNumeric::create(0),
PdfNumeric::create(595.2),
PdfNumeric::create(841.68)
]),
'Parent' => PdfIndirectObjectReference::create(123, 0),
'Resources' => PdfDictionary::create([
'ColorSpace' => PdfDictionary::create(),
'Font' => PdfDictionary::create([
'Font0' => PdfIndirectObjectReference::create(96, 0),
'Font1' => PdfIndirectObjectReference::create(77, 0),
'Font2' => PdfIndirectObjectReference::create(109, 0),
]),
'Para' => PdfDictionary::create(),
'ProcSet' => PdfArray::create([
PdfName::create('PDF'),
PdfName::create('Text'),
PdfName::create('ImageB'),
PdfName::create('ImageC'),
PdfName::create('ImageI'),
]),
]),
'Rotate' => PdfNumeric::create(0),
'Type' => PdfName::create('Page'),
])
)
]
];

return $data;
}

Expand Down

0 comments on commit 9747192

Please sign in to comment.