N
N
Nikolay Kornienko2015-12-23 09:01:16
PHP
Nikolay Kornienko, 2015-12-23 09:01:16

How to export HTML to PDF without stretching in height to full page?

Good day to all!
Faced with the need to modify the program. I'm not a programmer myself. The program is written in php and js. You need to upload the final table to a pdf file using mpdf. The data is unloaded correctly except for one. The table is stretched vertically to the entire sheet, even if there is only one row. I can not find where to remove this stretch. Do not kick hard, I'm not a programmer, well, or a strong beginner. Code below. The last table just stretches to the entire page vertically.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
pingo, 2015-12-23
@pingo

How can you tell without code? the only thing that comes to mind is to remove
the line in the included csstable { width: 100%;}

N
Nikolai Kornienko, 2015-12-23
@Nickkor


<?php
$i = 0;
$n = 0;
foreach($payouts as $payout)
{
$i++;
$n++;
echo'

'.$payout['name'].'
Salary from '.$datefrom.' by '.$dateto.'
Accrued'.$payout['credited'].'
Gasoline compensation'.$payout['gas'].'
Return 15%'.$payout['returnsum'].'
Prize'.$payout['bonus'].'
Cell Compensation. connections-'.$payout['phone'].'
Vacation'.$payout['holiday_amount'].'
Listed on the map-'.$payout['card'].'
Loan-'.$payout['credit'].'
Total:'.$payout['total'].'
';
if($i==3)
{
echo '';
$i = 0;
}
}
if($n % 3 != 0)
{
echo '';
}
// echo '
Full nameAutoReturn 15%PrizeCellularVacationMapLoanTotal
Full nameAutoReturn 15%PrizeCellularVacationMapLoanTotal
'.$payout['name'].''.$payout['gas'].''.$payout['returnsum'].''.$payout['bonus'].''.$payout['phone'].''.$payout['holiday_amount'].''.$payout['card'].''.$payout['credit'].''.$payout['total'].'
TOTAL:'.$gas.''.$returnsum.''.$bonus.''.$phone.''.$holiday_amount.''.$card.''.$credit.''.$total.'
';
?>

Z
Zlatoslav Desyatnikov, 2015-12-23
@pxz

Look towards TCPDF if a transition is possible. It easily makes a "flat" PDF from HTML.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question