0

I have multiple pdf files of one user. So, I have given an option to our user to see all his document in a single PDF file.

For this, I am using FPDI pdf parser to merge all pdf files in a single file and then show to user. But I am getting below error:

Illegal string offset '/Root' in pdf_parser.php line 90  

the function in which this error is thrown is given below:

 protected function _readRoot()
    {
        if ($this->_xref['trailer'][1]['/Root'][0] != self::TYPE_OBJREF) {
            throw new \Exception('Wrong Type of Root-Element! Must be an indirect reference');
        }
        $this->_root = $this->resolveObject($this->_xref['trailer'][1]['/Root']);
    }  

Can anyone please tell me what kind of issue is this. I have tried a lot as well as googled many things but failed.

Thanks in Advance.

Dhirender
  • 604
  • 8
  • 23
  • sounds like you are trying to access a string like it was an array. `var_dump($this->_xref['trailer'][1])` and see what `/Root` actually is – delboy1978uk Jan 30 '18 at 12:19
  • Please try to upgrade to [FPDI 2](https://www.setasign.com/products/fpdi/downloads/) first. If the error (or a simliar) still occurs, please share the PDF in question. – Jan Slabon Jan 31 '18 at 08:56

0 Answers0