Yii Framework Forum: Pagination, Header And Footer With Mdpf - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Pagination, Header And Footer With Mdpf Rate Topic: -----

#1 User is offline   Jonathan Morales Salazar 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 25
  • Joined: 08-January 14

Posted 04 April 2014 - 09:43 AM

I need create a pdf file, I did it, but I want see the footer, header and page number in each page. how can I do this? Thank you.

This is my config

'mpdf'     	=> array(
					'librarySourcePath' => 'application.vendor.mpdf.*',
					'constants'         => array(
						'_MPDF_TEMP_PATH' => Yii::getPathOfAlias('application.runtime'),
					),
					'class'=>'mpdf', // the literal class filename to be loaded from the vendors folder
					'defaultParams'     => array( // More info: http://mpdf1.com/manual/index.php?tid=184
							//'mode'              => '', //  This parameter specifies the mode of the new document.
							'format'            => 'letter', // format A4, A5, ...
							//'default_font_size' => 0, // Sets the default document font size in points (pt)
							//'default_font'      => '', // Sets the default font-family for the new document.
							//'mgl'               => 15, // margin_left. Sets the page margins for the new document.
							//'mgr'               => 15, // margin_right
							//'mgt'               => 16, // margin_top
							//'mgb'               => 16, // margin_bottom
							//'mgh'               => 9, // margin_header
							//'mgf'               => 9, // margin_footer
							//'orientation'       => 'P', // landscape or portrait orientation
					)
				),


and this is my controller method

$this->layout = '//layouts/pdf';

                # mPDF
        $mPDF1 = Yii::app()->ePdf->mpdf();
        # render (full page)
        $mPDF1->WriteHTML(
                        $this->render(
                            'pdfp', array(
                                    'contrato'              => $contrato,
                                    'ep'                    => $ep,
                                    'epsupervisor'          => $epsupervisor,
                                    'formapagocontrato'     => $formapagocontrato,
                                    'pagoparcial'           => $pagoparcial,
                                    'supervisores'          => $supervisores,
                                    ), TRUE
                        )
                );
        # Outputs ready PDF
        $mPDF1->Output();

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users