Fix per gestione dinamica margini stampe

This commit is contained in:
Dasc3er 2020-09-10 17:16:29 +02:00
parent 5d9cddd82e
commit 2048821190
2 changed files with 12 additions and 5 deletions

View File

@ -17,6 +17,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
use Mpdf\Mpdf;
/**
* Classe per la gestione delle informazioni relative alle stampe installate.
*
@ -459,14 +461,19 @@ class Prints
include DOCROOT.'/templates/info.php';
// Instanziamento dell'oggetto mPDF
$mpdf = new \Mpdf\Mpdf([
$mpdf = new Mpdf([
'format' => $settings['format'],
'orientation' => strtoupper($settings['orientation']) == 'L' ? 'L' : 'P',
'font-size' => $settings['font-size'],
'margin_left' => $settings['margins']['left'],
'margin_right' => $settings['margins']['right'],
'setAutoBottomMargin' => 'stretch',
'setAutoTopMargin' => 'stretch',
'setAutoTopMargin' => $settings['margins']['top'] === 'auto' ? 'stretch' : false,
'margin_top' => $settings['margins']['top'] === 'auto' ? 0 : $settings['margins']['top'], // Disabilitato se setAutoTopMargin impostato
'setAutoBottomMargin' => $settings['margins']['bottom'] === 'auto' ? 'stretch' : false,
'margin_bottom' => $settings['margins']['bottom'] === 'auto' ? 0 : $settings['margins']['bottom'], // Disabilitato se setAutoBottomMargin impostato
'default_font' => 'dejavusanscondensed',
// Abilitazione per lo standard PDF/A

View File

@ -22,8 +22,8 @@ $settings = [
'format' => 'A4',
'font-size' => 10,
'margins' => [
'top' => 10,
'bottom' => 10,
'top' => 'auto',
'bottom' => 'auto',
'left' => 12,
'right' => 12,
],