PM-792 Error al generar los OutputDocuments con configuracion TCPDF SOLVED
This commit is contained in:
@@ -827,10 +827,12 @@ class OutputDocument extends BaseOutputDocument
|
|||||||
$pdf->setLanguageArray($lg);
|
$pdf->setLanguageArray($lg);
|
||||||
|
|
||||||
if (isset($aProperties['pdfSecurity'])) {
|
if (isset($aProperties['pdfSecurity'])) {
|
||||||
|
$tcpdfPermissions = array('print', 'modify', 'copy', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-high');
|
||||||
$pdfSecurity = $aProperties['pdfSecurity'];
|
$pdfSecurity = $aProperties['pdfSecurity'];
|
||||||
$userPass = G::decrypt($pdfSecurity['openPassword'], $sUID);
|
$userPass = G::decrypt($pdfSecurity['openPassword'], $sUID);
|
||||||
$ownerPass = ($pdfSecurity['ownerPassword'] != '') ? G::decrypt($pdfSecurity['ownerPassword'], $sUID) : null;
|
$ownerPass = ($pdfSecurity['ownerPassword'] != '') ? G::decrypt($pdfSecurity['ownerPassword'], $sUID) : null;
|
||||||
$permissions = explode("|", $pdfSecurity['permissions']);
|
$permissions = explode("|", $pdfSecurity['permissions']);
|
||||||
|
$permissions = array_diff($tcpdfPermissions, $permissions);
|
||||||
$pdf->SetProtection($permissions, $userPass, $ownerPass);
|
$pdf->SetProtection($permissions, $userPass, $ownerPass);
|
||||||
}
|
}
|
||||||
// ---------------------------------------------------------
|
// ---------------------------------------------------------
|
||||||
@@ -861,7 +863,9 @@ class OutputDocument extends BaseOutputDocument
|
|||||||
$sContent = mb_convert_encoding($sContent, 'HTML-ENTITIES', 'UTF-8');
|
$sContent = mb_convert_encoding($sContent, 'HTML-ENTITIES', 'UTF-8');
|
||||||
}
|
}
|
||||||
$doc = new DOMDocument('1.0', 'UTF-8');
|
$doc = new DOMDocument('1.0', 'UTF-8');
|
||||||
$doc->loadHtml($sContent);
|
if ($sContent != '') {
|
||||||
|
$doc->loadHtml($sContent);
|
||||||
|
}
|
||||||
$pdf->writeHTML($doc->saveXML(), false, false, false, false, '');
|
$pdf->writeHTML($doc->saveXML(), false, false, false, false, '');
|
||||||
// ---------------------------------------------------------
|
// ---------------------------------------------------------
|
||||||
// Close and output PDF document
|
// Close and output PDF document
|
||||||
|
|||||||
Reference in New Issue
Block a user