php - Bold/italic text not shown (hidden) in PDF generated with Cpdf (aka Cezpdf or R&O's PDF Creation) -


bold , italic text not shown in generated pdf.

$pdf = new cezpdf();  $pdf->addtext(65,675,10, '<b>hidden</b> shown'); // doing more stuff pdf ... $pdf->output(); 

the bold word "hidden" not displayed in output. regular word "shown" displayed in output.

what problem?

the problem appears because underlying cpdf class handles text differentily, depending on presence of control directive "b" or not.

replace lines 2908 , 2909 in cpdf.php:

$this->addcontent(' /f'.$this->currentfontnum.' '.sprintf('%.1f',$size).' tf '); $this->addcontent(' ('.$this->filtertext($part, false).') tj'); 

with following 3 lines:

$place_text = $this->filtertext($part, false); $this->addcontent(" /f$this->currentfontnum ".sprintf('%.1f tf ', $size)); $this->addcontent(" [($place_text)] tj"); 

now text inside control directive shown.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -