title: PHP PDF parser SMALOt and TCPDF Parser
body: <p>I used to get meta data of PDF File. I parsed file using SMALOT pdf Parser and TCPDF Parser.</p>
  
  <p>I parse pdf file using smalot pdf parse and then get metadata and content of pdf file using TCPDF parser Library . Its working for small pdf file but when I parsed 10 MB or large pdf file Memory limit exhuasted and execution stop and not getting any error . I set memory limit 1024M .</p>
  
  <pre><code>public function parseFile($filename)
  {
    return $this-&gt;parseContent($filename);
   }
   public function parseContent($filename)
      {
          // Create structure using TCPDF Parser.
          ob_start();
          $parser = new \TCPDF_PARSER(file_get_contents($filename));
          list($xref, $data) = $parser-&gt;getParsedData();
  //            print_r($tcpdf-&gt;getParsedData());
  //            $parser = new \TCPDF_PARSER(ltrim($content));
  
          list($xref, $data) = $parser-&gt;getParsedData();
          unset($parser);
          ob_end_clean();
  
          if (isset($xref['trailer']['encrypt']))
          {
              throw new \Exception('Secured pdf file are currently not supported.');
          }
  
          if (empty($data))
          {
              throw new \Exception('Object list not found. Possible secured file.');
          }
  
          // Create destination object.
          $document = new Document();
          $this-&gt;objects = array();
  
          foreach ($data as $id =&gt; $structure)
          {
              $this-&gt;parseObject($id, $structure, $document);
              unset($data[$id]);
          }
  
          $document-&gt;setTrailer($this-&gt;parseTrailer($xref['trailer'], $document));
          $document-&gt;setObjects($this-&gt;objects);
  
          return $document;
      }
  </code></pre>