public function testToText()
 {
     $pdfFile = new PdfFile($this->createPdfinfoMock(), Pdftotext::create($this->createLoggerMock()), $this->createPdftohtmlMock());
     $text = $pdfFile->toText(__DIR__ . '/../files/pdf-sample.pdf');
     $this->assertNotEmpty($text);
     $this->assertEquals($this->createTextContent(), $text);
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function read($filename)
 {
     $meta = new ValueBag();
     try {
         $infos = $this->pdfFile->getInfo($filename);
         foreach ($infos as $key => $value) {
             $meta->set(strtolower("pdfinfo.{$key}"), new MetaValue($value));
         }
     } catch (\Exception $e) {
     }
     return $meta;
 }
Example #3
0
 public function testToHtml()
 {
     $pdfFile = new PdfFile($this->createPdfinfoMock(), $this->createPdftotextMock(), $this->createPdftohtmlMock());
     $pdfFile->toHtml(__DIR__ . '/../files/pdf-sample.pdf', sys_get_temp_dir());
 }