2014-02-14 2 views
1

моя проблема в том, что я не могу перейти к последнему утверждению, которое является выражением эха. выталкиватель pdf дает правильный результат, но выполнение останавливается на строке «$ signer-> sign ($ module);»pdf signer в php с помощью SetaPDF-Signer

как я могу перейти к следующему утверждению, что есть эхо заявления,

мой код приведен ниже ...

require_once('SetaPDF-Signer/library/SetaPDF/Autoload.php'); 

// configure the temporary writer 
SetaPDF_Core_Writer_TempFile::setTempDir('SetaPDF-Signer/demos'); 

// create a writer 
$writer = new SetaPDF_Core_Writer_Http('235.pdf', true); 
// create a new document instance 
$document = SetaPDF_Core_Document::loadByFilename(
    'SetaPDF-Signer/235.pdf', $writer 
); 

// create a signer instance 
$signer = new SetaPDF_Signer($document); 

// set some signature properties 
$signer->setReason('needs to provide this '); 
$signer->setLocation('needs to provide this'); 

// create a signature module 
$module = new SetaPDF_Signer_Signature_Module_OpenSsl(); 
// load the certificate 
$certificate = file_get_contents('xxxxxxxxx.pem'); 
$module->setCertificate($certificate); 
$module->setPrivateKey(array($certificate, 'xxxxxxxxxx' /* no password */)); 

// sign the document and send the final document to the initial writer 
$signer->sign($module); 


echo "welcome"; 

ответ

1

Вы должны выбрать другой экземпляр писателя, который не будет автоматически отправить результирующий документ для браузера клиентов. Например .:

$writer = new SetaPDF_Core_Writer_File('path/to/235.pdf'); 

вместо

$writer = new SetaPDF_Core_Writer_Http('235.pdf', true); 

Обзор всех доступных классов писатель в SetaPDF доступен here.

Смежные вопросы