fpdf pdf-Höhe und oriention auto

Ich bin das hinzufügen von text, um die pdf-Datei mit fpdf.Ich bin in der Lage, fügen Sie den text, sondern die Größe der pdf-Seite ist immer A4.
Wenn hochgeladene pdf-Ausrichtung Querformat wird es Porträt.
Ich will die gleiche Breite und Höhe und Ausrichtung der hochgeladenen pdf-Datei für das schreiben in der pdf-Datei.

$fullPathToFile = $target_path;

    class custom_PDF extends FPDI {

    var $_tplIdx;
    var $file;

    function Header() {
        if (is_null($this->_tplIdx)) {
        //THIS IS WHERE YOU GET THE NUMBER OF PAGES
        $this->numPages = $this->setSourceFile($this->file);
        $this->_tplIdx = $this->importPage(1);
        }
        $this->useTemplate($this->_tplIdx, 0, 0, 200);
    }

    function Footer() {

    }

    function setFile($param) {
        $this->file = $param;
    }

    }
    $pdf234 = new custom_PDF();
    $pdf234->setFile($fullPathToFile);
    $pdf234->AddPage();
    $pdf234->SetAutoPageBreak(TRUE, 0);
    $pdf234->SetY(280);
    $pdf234->SetFont("helvetica", "B", 8);
    $pdf234->SetTextColor(0, 0, 0);


    $utf8text = $current_user->user_login . "(" . str_ireplace('_', ' ', $current_user->roles[0]) . ")," . get_bloginfo('name') . "," . get_bloginfo('url') . "" . date("d M Y,h:i:s a");
    $pdf234->Write(5, $utf8text, get_bloginfo('url'));
    if ($pdf234->numPages > 1) {
    for ($i = 2; $i <= $pdf234->numPages; $i++) {
        //$pdf->endPage();
        $pdf234->_tplIdx = $pdf234->importPage($i);
        $pdf234->AddPage();
          $pdf234->SetAutoPageBreak(TRUE, 0);
        $pdf234->SetY(280);

        $pdf234->Write(5, $utf8text, get_bloginfo('url'));
    }
    }
    $pdf234->Output($line['name'], 'D');
    die();

Ich habe versucht folgenden code zu:

$specs = $pdf234->getTemplateSize($pdf234->_tplIdx);
 $pdf234->AddPage('L',$specs); 

mein pdf nun im landscape-Modus, aber der Inhalt wird nicht besetzt, ganze Seite.Inhalt ist ausgerichtet auf die Links oben.

InformationsquelleAutor Kavita | 2014-11-26
Schreibe einen Kommentar