php

HTML in TCPDF and different margins  #angularjs #reactjs

  • I am trying to create a PDF (TCPDF library), using the “writeHTML” method to fill 4 pages of HTML content fine.
  • Stack Overflow works best with JavaScript enabled
  • The problem was that i need to use a 5cm left margin in the pair pages and a 5cm right margin in the impair pages, but the writeHTML only get the default margins of the page and i cant change it.
  • ./classes/TCPDF-master/tcpdf.php’); // create new PDF document $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, ‘UTF-8’, false); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //add page $pdf->AddPage(‘P’, ‘A4’); //set first margin $pdf->SetMargins(50, 10, 10); //margin from left //write html $pdf->writeHTML(‘some html that fills 4 pages’, true, false, true, false, ”); //output $pdf->Output(‘example_006.pdf’, ‘I’);
  • sign up log in tour help

I am trying to create a PDF (TCPDF library), using the “writeHTML” method to fill 4 pages of HTML content fine. The problem was that i need to use a 5cm left margin in the pair pages and a 5cm right margin in the impair pages, but the writeHTML only get the default margins of the page and i cant change it.

@ng_real_ninja: HTML in TCPDF and different margins #angularjs #reactjs

I am trying to create a PDF (TCPDF library), using the “writeHTML” method to fill 4 pages of HTML content fine. The problem was that i need to use a 5cm left margin in the pair pages and a 5cm right margin in the impair pages, but the writeHTML only get the default margins of the page and i cant change it.

How can i do that?

php

You might also like More from author

Comments are closed, but trackbacks and pingbacks are open.