smalot / smalot/pdfparser

Issue loading pdf generated from FPDI

Open
#472 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

missing or incomplete functionality parsing fail
Dominant language
PHP
Stars
2.7k
Forks
579
Avg merge
2m
Merged PRs (30d)
1

Description

Having some difficultly loading a pdf from dev-master which I'm doing at the moment due to needing the code change in #450

The pdf was created in FPDI.

When calling getDetails() I'd expect to be able to get the MediaBox of the page, but it's not there any more.

$parser = new Parser();
$pdf = $parser->parseFile(__DIR__.'/../../test2.pdf');
$pages = $pdf->getPages();
foreach ($pages as $i => $page) {
    $details = $page->getDetails();
    var_dump($details);
}

Any help would be amazing

Pdf used: test2.pdf

Output of getDetails:

array(5) {
  ["Type"]=>
  string(4) "Page"
  ["Parent"]=>
  array(2) {
    ["Type"]=>
    string(5) "Pages"
    ["Count"]=>
    string(1) "1"
  }
  ["Resources"]=>
  array(0) {
  }
  ["Group"]=>
  array(3) {
    ["Type"]=>
    string(5) "Group"
    ["S"]=>
    string(12) "Transparency"
    ["CS"]=>
    string(9) "DeviceRGB"
  }
  ["Contents"]=>
  array(2) {
    ["Filter"]=>
    string(11) "FlateDecode"
    ["Length"]=>
    string(3) "106"
  }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with the attached test2.pdf using Parser->parseFile(), then inspect the page returned by getPages() and its getDetails() output. Trace how page details are exposed and confirm that the expected MediaBox is available for this FPDI-generated PDF.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.