1

Please help: How to get bold and italics in the generated PDF file

When I specify bold or italics, nothing shows up after the <b> tag! For example, this text:
the quick brown <b>fox jumps over</i> the lazy dog
produces just
the quick brown
in the generated pdf file.

The code is here:
<?PHP

$phrase = 'the quick brown fox jumps over the lazy dog<br />'.
'the quick brown <b>fox jumps</b> over the lazy dog';
// ---------------------------------------------------------------

require_once('../html2pdf/html2pdf.class.php');
$html2pdf = new HTML2PDF('P', 'A4', 'en');
$html2pdf->writeHTML($phrase);
$html2pdf->Output('first_PDF_file.pdf', 'F'); //write to a file

echo $phrase;
?>

2

Hello,

Replace <b> by <strong>

But you can also use css.

In your example :
$phrase = 'the quick brown fox jumps over the lazy dog<br />'.
'the quick brown <span style="font-weight:bold; font-style:italic;">fox jumps</span> over the lazy dog';

3

Hi Takh

Many thanks for your response - I really appreciate all help.

However, these suggestions make NO difference. The PDF still contains truncated text like this:
the quick brown fox jumps over the lazy dog
(with span & style) the quick brown

Franz
Takh (./2) :
Hello,

Replace <b> by <strong>

But you can also use css.

In your example :
$phrase = 'the quick brown fox jumps over the lazy dog<br />'.
'the quick brown <span style="font-weight:bold; font-style:italic;">fox jumps</span> over the lazy dog';

4

Hello,

I checked and it's work for me. Do you close every HTML tag ?

5

Yes! Otherwise I would get an error message. You can see the result of the code here:
http://43software.com/nwu-sd/html2pdf.php

and here is the code:
<?PHP

$phrase = 'the quick brown fox jumps over the lazy dog<br />'.
'(with span & style) the quick brown <span style="font-weight:bold; font-style:italic;">fox jumps</span> over the lazy dog';
// ---------------------------------------------------------------

require_once('../html2pdf/html2pdf.class.php');
$html2pdf = new HTML2PDF('P', 'A4', 'en');
$html2pdf->writeHTML($phrase);
$html2pdf->Output('first_PDF_file.pdf', 'I');

echo $phrase;
?>

Takh (./4) :
Hello,

I checked and it's work for me. Do you close every HTML tag ?

6

vuurklip (./5) :
Yes! Otherwise I would get an error message. You can see the result of the code here:
http://43software.com/nwu-sd/html2pdf.php

Good point. You're right ! Sorry !

I copy your code and try it and the result is correct for me. Sorry I dont understand. maybe delete html2pdf and do a new install again.

7

Aaaarghhh!

I downloaded again and now it works!

Thanks for the suggestion!

Franz
Takh (./6) :
vuurklip (./5) :
Yes! Otherwise I would get an error message. You can see the result of the code here:
http://43software.com/nwu-sd/html2pdf.php

Good point. You're right ! Sorry !

I copy your code and try it and the result is correct for me. Sorry I dont understand. maybe delete html2pdf and do a new install again.