Quantcast
Channel: All Discussions - mPDF Forum
Viewing all 108 articles
Browse latest View live

Rowspan break table on a document

$
0
0
how can i do the mpdf break a table with a dinamic rowspan. i'm using mdpf to generate reports from Yii and i cant force all table on one page, y need break table, the td has a high rowspan but how can i automaticly break the table and continue on a next page?

Meaning of page-break-before?

$
0
0
Hello

I use the css page-break-before on a page selector,
but the value left or right seem to have no effect.

What does "right" or "left" mean?

I need to force a new chapter to start on the odd page, i.e. on the right.
Is the page-break-before the property should I use?

Multi Column causes issues with

$
0
0
Using the mpdf command to generate a multi colum document leads to format problems if the document includes <div> or similar sections.
It looks to me that using multiple columns is implemented similar to a table (which also will cause the styles of <div> etc. to break)
The results are similar, but not identical to the us of tables. But both will cause <div> elements with border styles (rounded etc..., and also padding, margins etc.) to display properly or at all.

My first question is: Is there a specific reason why mpdf can not support styles of <div> elements in tables (or multiple columns for that matter)?
Using a <div> or <span> is very common to get a specific style to a certain part of the document.

Second Question: If I want to use use elements with rounded corners, and other styles regarding borders inside a multicolum document or inside tables, is there any solution for this?

How to set the image resolution for the whole document?

$
0
0
Hi

I use HMTL.

I saw the background-image-resolution and image-resolution properties.

1) But can I set the image resolution in one place for the whole document?

2) I use @page selectors. Does background-image-resolution work for @page?
If NO, how to?


Thanks a lot

How to get a multibyte language character in the TOC?

$
0
0
I've got mixed English and Chinese in the document and the fonts are being assigned via 'lang' in body of PDF - all works beautifully.
But I cant get Chines in the table of contents in my PHP this:
<tocentry lang='.$row['langcode'].' content=".$tocname.'" />
gives me boxes at the TOC when Chinese is entered.

'<tocentry  content="<span lang='.$row['langcode'].'>'.$tocname.'</span>" />';
also fails

I'm thinking I may need to hack your code!
I've had a quick look at 'tocontents.php' - any advice where the best place to do this is?

Thanks

E-mail a PDF file

$
0
0
Hello,
according the manual 
all what I have made ...I have copy and paste all from the manual into my php file and just have changed mail from, mail to , with real addresses.
PDF was created but  I received no email. I need to set something more out of the php file?

thanks for any hint

Float with Div

$
0
0
Dear lanBack,

Is there way that would could use float in div with in columns. if it is not there how could we implement this.

thanks and regards,

Imran Khan

Generating pdf is too slow

$
0
0
Hi,

In mpdf internal code base, file_get_contents() is used to get the contents of a file. But there is an issue with this api(file_get_contents()), when we try retrieve any file contents from server with configuration(apache2.4.7 and PHP 5.5) its taking too long. Which finally results pdf generation is getting slow with mpdf library.

Can we use curl instead of file_get_contents which is faster? 



Subscript Problem

$
0
0
dear Sir,

mpdf is not subscript the Zero "0". please help.

Footer all pages

$
0
0

 Used Version: mPFD 6.0





Problem: Footer appears only in the
last page of the PDF file generated by mPDF.





How am I making this: Using
setHTMLFooter method to create the footer, with an HTML content as
parameter.





Example:


$htmlFooter
'<table
class=tbl_footer width=1000>'
.


'<tr>'.


"<td
align=left>ID:
{$param['ID']}</td>
<td align=center>
{$order}</td>
<td align=right>
{$page}</td>".


'</tr>'.


'<tr>'.


"<td
align=left>
{$filters}</td>
<td align=left></td> <td
align=right>Usuário:
{$userName}</td>".


'</tr>'.


'</table>';






$mpdf
=
new
mPDF('c',$this->_papel,0,'',15,15,40,16,5,5,'P');





$mpdf->SetHTMLHeader(“HTML
header”);


$mpdf->WriteHTML(“HTML
body”,2)


$mpdf->SetHTMLFooter($htmlFooter);


$mpdf->Output($this->name);





What procedure can I use to generate
footer in all the pages of the PDF document using setHTMLFooter
method in mPDF 6.0?

Feature Request: Border-radius on spans

$
0
0
Hey again,
I was wanting to see if it is possible to implement a border-radius for spans.
Ie:
<?php
$prob = '
<span style="border-radius:20px; border:thin solid black;">ho</span>
';

include_once($_SERVER['DOCUMENT_ROOT']."/mpdf60/mpdf.php");
$mpdf=new mPDF();
$mpdf->WriteHTML($prob);
$mpdf->Output();
?>

Lists inside tables don't render disc/bullet counters properly

$
0
0
There is an issue with mPDF (occurring in both 5.7 and 6.0) related to displaying lists (ul tags) in tables. The code used to generate counters (discs/bullets by default) on lines 16782-16786 of mPDF.php seems to always result in falling back to the hyphen character, even if the other characters are fully supported by the selected font. You can use the following test code to see the issue in action:

// require_once 'lib/mpdf5/mpdf.php';
require_once 'lib/mpdf6/mpdf.php';

// Initialize PDF.
$pdf = new mPDF('c','LETTER',0,'',12.7,12.7,12.7,12.7);

$body = '';

$body .= '<div>';
$body .= '<ul>';
$body .= '<li>Test 1</li>';
$body .= '<li>Test 2</li>';
$body .= '<li>Test 3</li>';
$body .= '</ul>';
$body .= '</div>';

$body .= '<table>';
$body .= '<tr>';
$body .= '<td>';
$body .= '<ul>';
$body .= '<li>Test 1</li>';
$body .= '<li>Test 2</li>';
$body .= '<li>Test 3</li>';
$body .= '</ul>';
$body .= '</td>';
$body .= '</tr>';
$body .= '</table>';

$pdf->WriteHTML($body,2);

$fileName = 'Test-List-Report.pdf';
$pdf->Output($fileName, 'I');

The top list comes out formatted correctly, with a standard disc/bullet character used as the list counter (demonstrating the character is available in the font), but the list inside the table uses hyphens instead, as seen in this image:
image
I'm not sure why the code for displaying lists inside tables is handling the printing of counters differently from the base list rendering code, but there seems to be some sort of issue with character selection in the former that doesn't exist in the latter.

Does anyone know of a solution or workaround for getting list counters to render properly in tables?

src path in via variable

$
0
0
Hello,
 Iam trying pass path in <img> via variable, but unfortunately unsuccessfully 
 <img src="<?php echo $path?>" />
 <img src="<?php $path?>" />

do anybody have experience?

thank You

using php variable in HTML entry

$
0
0
Hello,
when I use this way:

$pieces = $_POST['pieces'];
$mpdf = new mPDF();

$html = ' <div> $pieces </div> ';

$mpdf -> WriteHTML($html);
$mpdf -> Output('pdf/test.pdf', 'I');

doesn't render the value of php variable

but when I change instead apostrof ' with " as here:
$pieces = $_POST['pieces'];
$mpdf = new mPDF();

$html = " <div$pieces </div> ";
$mpdf -> WriteHTML($html);
$mpdf -> Output('pdf/test.pdf', 'I');
it works.....in PDF is rendered value of variable correctly 

the problem is when I close all inside $html into " "; everything inside where is used " " I must escape <div id=\" myid \">

Layout Problem

$
0
0
My Html code for invoice generation looks very fine when I use it in browser directly. But when I use it to generate pdf it's layout goes fired. No orientation at all. Please help me.

SVG illegal manipulation with layers

$
0
0
Hello,
I am capturing multi layers SVG string and write it into svg file, where are a few layers hidden display="none" and a few layers visible display="block" 
when I open this file in some image wiever...the settings of layers is ok and is displayed correctly, but when I pass the file for mPDF, so in PDF the layers are in different settings....what have to be hidden is visible, etc

Fieldset - Legend has wrong fonttype

$
0
0
Dear Ian,

sorry a smal issue, when inside a frameset is a tag with monotyp font, in this case class="mono", the legend get the same font.
This is only if there is some conent in the pre tag. If it is empty the font is arial. It is not the pre tag because when I change it to a span it have the same problem.
Do you have any idea?

Greetings
Frank

  <div class="grid-66 mobile-grid-100 tablet-grid-100">
        <fieldset class="sec">
        <legend>Karosserie-Prüfung</legend>
      <b style="margin-right: 10px;">Status</b> <span class="fakeinput mark_1">in Ordnung</span>
      <br><div class="fakeinput"><pre class="mono"></pre></div>
    </fieldset>
    <br>
    <fieldset class="sec">
    <legend>Wartung laut DSR</legend>
      <div>
          <b style="margin-right: 10px;">Status</b> <span class="fakeinput mark_1">in Ordnung</span>
          <br><div class="fakeinput"><pre class="mono">22.07.2015      6 km | Übergabe-Inspektion</pre></div>
      </div>
    </fieldset>
</div>


Bugfix for external special links (mailto, fax, tel, ..)

$
0
0
Line 12497:
    if (substr($path,0,7) == "mailto:") { return; }

into:
    if(preg_match('@^(mailto|tel|fax):.*@iu', $path)) { return; }
or like:
    if(preg_match('@^(mailto|tel|fax|http|https|ftp|ftps):.*@iu', $path)) { return; }

Is this the offical mpdf repository?
https://github.com/mpdf/mpdf&nbsp;


Auto print on tablet/phone popups

$
0
0
Hey all I have come into an issue where I am using iframes to load a back button above the pdf which is in the frame. On the desktop I use 
$mpdf->SetJS('this.print(); 

with no drama. The print window pops up and here we go. If you use a mobile browser you do not get a popup and if you go to print manually it will show both frames and not just the pdf. Please help :)

tags with 0 as value not displaying.

$
0
0
When a tag  is made with a 0 value inside it will not render.
This does NOT happen in 5.7, only in 6.0


<?php
$prob = 'hi<b>0</b><b>1</b>';

include_once($_SERVER['DOCUMENT_ROOT']."/mpdf60/mpdf.php");
$mpdf=new mPDF();
$mpdf->WriteHTML($prob);
$mpdf->Output();
?>


This can be fixed by modifying line 21646 and adding the bit in green.

    // Remove empty items // mPDF 6
    for($i=$array_size-1; $i > 0; $i--) {
        if (empty($arrayaux[$i][0]) && $arrayaux[$i][0]!=='0' && $arrayaux[$i][16]!=='0' && empty($arrayaux[$i][7])) {
            unset($arrayaux[$i]);
        }
    }



Viewing all 108 articles
Browse latest View live