コード例 #1
0
 public function testGetPdfEncryptionObjOnePub()
 {
     $pubkeys = array(array('c' => __DIR__ . '/data/cert.pem', 'p' => array('print')));
     $enc = new \Com\Tecnick\Pdf\Encrypt\Encrypt(true, md5('file_id'), 1, array('print'), 'alpha', 'beta', $pubkeys);
     $pon = 122;
     $result = $enc->getPdfEncryptionObj($pon);
     $this->assertTrue(strlen($result) > 100);
 }
コード例 #2
0
 public function testGetFormattedDate()
 {
     $permissions = array('print', 'modify', 'copy', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-high');
     $enc = new \Com\Tecnick\Pdf\Encrypt\Encrypt(false);
     $result = $enc->getFormattedDate();
     $this->assertEquals('(D:', substr($result, 0, 3));
     $this->assertEquals('+00\'00\')', substr($result, -8));
     $enc = new \Com\Tecnick\Pdf\Encrypt\Encrypt(true, md5('file_id'), 0, $permissions, 'alpha');
     $result = $enc->getFormattedDate();
     $this->assertNotEmpty($result);
 }