예제 #1
0
 /**
  * @param string $inputfile
  * @param string $outputfile
  *
  * @throws FileNotFoundException
  * @return string
  */
 public function toHtml($inputfile, $outputfile)
 {
     if (!file_exists($inputfile)) {
         throw new FileNotFoundException("File {$inputfile} not found.");
     }
     $output = $this->pdftohtml->command(array($inputfile, $outputfile));
     return $output;
 }
예제 #2
0
 public function setUp()
 {
     if (!class_exists('Poppler\\Processor\\PdfFile')) {
         $this->markTestSkipped('Poppler\\Processor\\PdfFile not available.');
     }
     try {
         $this->reader = new PdfInfoReader(new PdfFile(\Poppler\Driver\Pdfinfo::create(), \Poppler\Driver\Pdftotext::create(), \Poppler\Driver\Pdftohtml::create()));
     } catch (\Exception $e) {
         $this->markTestSkipped('PdfInfoReader not available.');
     }
 }
예제 #3
0
 /**
  * @expectedException \Poppler\Exception\ExecutableNotFoundException
  */
 public function testCreateFailureThrowsAnException()
 {
     Pdftohtml::create($this->createLoggerMock(), array('pdftohtml.binaries' => '/path/to/nowhere'));
 }