2016-07-05 4 views
3

용지 크기를 A3 또는 OR4로 늘리려는 경우 (너비가 증가 할 때) 어쨌든 크기를 변경하려고 시도했지만 변경하지 않았습니다. 생성 된 PDF의?prestashop에서 prestashop을 사용하여 pdf 크기를 변경하는 방법

public function generatePDF($object, $template) 
{ 

    switch($template) { 
     case PDF::TEMPLATE_ETICKET: 
      $format = 'C3'; // Replace with your desired size 
      break; 
     default: 
      $format = 'A4'; // Replace with normal size 
    } 
    $pdf = new PDF($object, $template, Context::getContext()->smarty,'P', $format); 
    //d($pdf); 
    $pdf->render(); 
} 

답변

0

override/classes/pdf에 PDFGenerator.php 파일을 만듭니다. PDFGenerator.php에의

삽입 :

<?php 
class PDFGenerator extends PDFGeneratorCore 
{ 
    public function __construct($use_cache = false, $orientation = 'P') 
    { 
     parent::__construct($orientation, 'mm', 'A3', true, 'UTF-8', $use_cache, false); /*Replace A3 with the size you prefer */ 
     $this->setRTL(Context::getContext()->language->is_rtl); 
    } 
} 

삭제 캐시/class_index.php

관련 문제