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); }
/** * {@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; }
public function testToHtml() { $pdfFile = new PdfFile($this->createPdfinfoMock(), $this->createPdftotextMock(), $this->createPdftohtmlMock()); $pdfFile->toHtml(__DIR__ . '/../files/pdf-sample.pdf', sys_get_temp_dir()); }