示例#1
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.');
     }
 }
 public function testGetInfo()
 {
     $pdfFile = new PdfFile(Pdfinfo::create($this->createLoggerMock()), $this->createPdftotextMock(), $this->createPdftohtmlMock());
     $info = $pdfFile->getInfo(__DIR__ . '/../files/pdf-sample.pdf');
     $this->assertNotEmpty($info);
     $this->assertInternalType('array', $info);
     $this->assertSame('This is a test PDF file', $info['Title']);
     $this->assertSame('1', $info['Pages']);
     $this->assertSame('1.3', $info['PDF version']);
     $this->assertSame('Thu Jun 29 10:21:08 2000', $info['CreationDate']);
 }
示例#3
0
 /**
  * @expectedException \Poppler\Exception\ExecutableNotFoundException
  */
 public function testCreateFailureThrowsAnException()
 {
     Pdfinfo::create($this->createLoggerMock(), array('pdfinfo.binaries' => '/path/to/nowhere'));
 }