1

以下のコードは完全に機能します。問題は、最初のページに番号が付けられておらず、設定したフッターがヘッダー、提案として表示されることです

      $full_name = 'custom_worksheets/' . $sheet_name . '.pdf';

        $pdf = new FPDI('P', 'mm', 'A4');
        $pdf->AliasNbPages();
        $pdf->AddPage();
        // set the sourcefile
        $pages_count = $pdf->setSourceFile($full_name);


        for ($i = 1; $i <= $pages_count; $i++) {
            //$pdf->AddPage(); 

            $tplIdx = $pdf->importPage($i);
    // Go to 1.5 cm from bottom
            $pdf->SetY(-31);
            // Select Arial italic 8
            $pdf->SetFont('Arial', 'I', 8);
            // Print centered page number
            $pdf->Cell(0, 10, 'Page ' . $pdf->PageNo() . ' of {nb}', 0, 0, 'C');
            $pdf->Cell(0, 10, date('d/m/Y'), 0, 0, 'R');
            $pdf->Cell(0, 0,$labref . '/' . ucfirst(str_replace('_', ' ', $sheet_name)) . ' / Download x : author - ' . $full_names,0,0);

            $pdf->useTemplate($tplIdx);




        }


       // Output
        $pdf->Output('generated_custom_sheets/' . $labref . '_' . $sheet_name . '.pdf', 'D');

        redirect('generated_custom_sheets/' . $labref . '_' . $sheet_name . '.pdf');
4

1 に答える 1