Answer the question
In order to leave comments, you need to log in
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
How can you tell without code? the only thing that comes to mind is to remove
the line in the included csstable { width: 100%;}
<?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'].' |
Full name | Auto | Return 15% | Prize | Cellular | Vacation | Map | Loan | Total |
Full name | Auto | Return 15% | Prize | Cellular | Vacation | Map | Loan | Total |
'.$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.' |
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 questionAsk a Question
731 491 924 answers to any question