0
votes

I'm trying to print checks with TCPDF class but the MICR fonts doesn't show up when I want to print the check, any reason why?

Thanks

EDIT:

This is How include it

// set font
$fontname = $pdf->addTTFfont('micr65.ttf', 'TrueTypeUnicode', '', 32);
$pdf->SetFont($fontname, '', 14, '', false);
$pdf->SetFont('Helvetica', '', 14, '', false);
2
Do you have the font installed? - Paul Dessert
pls try to add absolute path to font. it helps me when i did some thing with tcpdf. - StasGrin
@StasGrin Can you please show me an example, like how you did that? it will really help me, Thank you - believe me
ok, for example: $fontname = $pdf->addTTFfont($_SERVER['DOCUMENT_ROOT'].'path/to_font/on_server/micr65.ttf', 'TrueTypeUnicode', '', 32); - StasGrin
Ok, I tried this too but doesn't work either - believe me

2 Answers

0
votes

My problem was the font file, the font wasn't a good font style for PDF, I don't know why, the first font type was invalid, but just to let you know that if you have a problem with one font, don't be afraid its happening, just try another font with the same style.

Good luck

0
votes

I believe, the $subset parameter is wrong. It should be true, not false, to embed the whole font subset in your PDF.

    $pdf->SetFont($fontname, '', 14, '', false); // Might be wrong.
    $pdf->SetFont($fontname, '', 14, '', true); // This should work

This might be related: https://stackoverflow.com/a/23812199/997536