Asked  4 Months ago    Answers:  5   Viewed   521 times

I am in the process of generating a dynamic pdf file, which contains data of around 10,000 users, in general the app is developed using MySQL and PHP. The dynamic content is so heavy that, I found it difficult to process with fpdf() class. So I converted my output PHP page as a HTML file using ob_get_clean(). Now the html file is generated successfully and also the pdf file. But i want to leave a page break after each user's data, that is every user's data must start in a fresh page. I couldn't use any HTML tags because, in the dynamically generated HTML file, everything is out of the <html> and </html> tags. Please help me so that some how i make a page break in the pdf file after every user's data... Thanks in advance :)

 Answers

43

i just figured this out after having the same problem. the parser that they use DOES support the page-break-after tag, but the html2pdf does not work.

i think i have it working by doing the following modifications to html2pdf.class:

around line 4174, the first thing inside:

protected function _tag_close_P($param){

should be:

   if($this->parsingCss->value['page-break-after'] == "always")
        $this->_setNewPage();

around line 2961, the first thing inside:

protected function _tag_close_DIV($param, $other='div'){

should be:

 if($this->parsingCss->value['page-break-after'] == "always")
        $this->_setNewPage();
Sunday, July 4, 2021
 
christina
answered 4 Months ago
78

You can use a str_replace() to replace any string by another, so also a comma with a <br />:

$output = str_replace(',', '<br />', $input);
Wednesday, March 31, 2021
 
Markol
answered 7 Months ago
39

yo need create the user "pma" in mysql or change this lines(user and password for mysql):

/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma'; 
$cfg['Servers'][$i]['controlpass'] = '';

Linux: /etc/phpmyadmin/config.inc.php

Tuesday, July 13, 2021
 
ShadowZzz
answered 3 Months ago
94

I've been dealing with this too. It appears that using the page-break-after property in a break line is a no-no in IE10. According to Internet Explorer’s current documentation supporting CSS 2.1 Section 13.3.1, the page-break-after property does not support line break or header elements. See the remarks in this link: http://msdn.microsoft.com/en-us/library/ie/ms530842. I had to switch my code to use a div with the break after class but that doesn't seem to work in IE9 which is awesome.

Friday, August 13, 2021
 
im1dermike
answered 2 Months ago
74

Instead of putting the page-break-inside:avoid; on you table's tr, try applying it on the table directly like this:

table {
    page-break-inside:avoid;
    position:relative;
}

also add this media query:

@media print {
   table {
        page-break-inside:avoid;
        position:relative;
    }
}
Sunday, August 22, 2021
 
fardjad
answered 2 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :