Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorH3llGhost
    • CommentTimeJul 26th 2010
     
    Hello,

    I created mPDF in the landscape modus and I want to add a page with portrait orientation, but when I use $mpdf->addPage('p'); nothing happen.
    All following pages are in landscape.

    Can anyone help me?
    • CommentAuthorIanBack
    • CommentTimeJul 27th 2010
     
    Some of the options in mPDF are to allow backward compatibility, and some are just remnants of the original FPDF which haven't been removed.

    To set Landscape so that mPDF knows it is landscape, either use the page format followed by '-L' e.g.
    $mpdf=new mPDF('','A4-L','','',15,15,20,20,5,5,'');
    [In this case, do not set the last parameter]

    Or set an array (width first) and the last parameter
    $mpdf=new mPDF('',array(210,297),'','',15,15,20,20,5,5,'L');

    Either of these should work when you use $mpdf->addPage('p');
    • CommentAuthorH3llGhost
    • CommentTimeJul 27th 2010
     
    So it isn't possible to use different orientations on different pages?
    • CommentAuthorIanBack
    • CommentTimeJul 28th 2010
     
    Yes it is possible to change using $mpdf->addPage('p'); etc.

    But you need to set the initial page format so that mPDF knows which orientation it is i.e. the 2 methods I have suggested above.
    • CommentAuthorH3llGhost
    • CommentTimeJul 28th 2010
     
    I initial mPDF with $mpdf=new mPDF('','A4-L'...) but $mpdf->addPage('p'); doesn't work.
    • CommentAuthorIanBack
    • CommentTimeJul 29th 2010
     
    As long as you haven't set the last parameter, it should work i.e. this won't work:
    $mpdf=new mPDF('','A4-L','','',15,15,20,20,5,5,'L');

    Make sure you are using latest version mPDF 4.6 or 5.0Beta.

    btw it should be mpdf->AddPage() i.e. note the uppercase, although PHP seems to allow this.
    • CommentAuthorH3llGhost
    • CommentTimeJul 30th 2010 edited
     
    I only use $mpdf=new mPDF('utf-8','A4-L');.

    I will try with Uppercase.

    EDIT:
    It seems to work.