This is an archived forum post. The information may be outdated. Contact us if you have any questions.

Problems with OCR-A font

solata10 wrote on 2013-01-29:
Hello,

i am evaluating pdfcrowd for use in my webpage, however i came upon this problem:
- i am using OCR-A font, to build OCR (http://en.wikipedia.org/wiki/OCR-A_font)
- in include font using css rule @font-face
- font renders ok in the pdf, except for special charracters: ? (0x2442) ? (0x2440) ? (0x2441) (maybe also other special chars however i just need those)
- on webpage (in html it shows correctly)

is there something i am doing wrong or is pdfcrowd not capable of working with such special charracters ?

thank you.
support wrote on 2013-01-29:
Hello,

please post a link to your webpage and we will look into it.
solata10 wrote on 2013-01-29:
attached is generated PDF file, and font file. here is code snippet:

<div class="ocr-code-div">
<p class="ocr-code"><?= sprintf("%013s", $invoice->invoice_nr) ?>?</p>
<p class="ocr-code"><?= sprintf("%010s", substr(str_replace(array("-", " "), array("", ""), $uset->user_trr), 9)) ?>?</p>
<p class="ocr-code"><?= sprintf("%011s", $set->invoice_total*100) ?>?</p>
<p class="ocr-code"><?= sprintf("%05s", substr(str_replace(array("-", " "), array("", ""), $uset->user_trr), 4, 5)) ?>000?</p>
<p class="ocr-code">56?</p>
</div>

basicly these charracters : ? ? ? wont show up (only squares show in their places)

###
login with:
- username: ***
- password: ***
then use link to downlaod pdf:
###
or to view generated html:
###
solata10 wrote on 2013-01-29:
ok i see those charracters dont show up on these forums (only questionmarks), however i wrote the hex codes, and you can test it on my webpage. is there a way to lock this post, i dont want everyone to see login details ?

thank you.
support wrote on 2013-01-29:
After I log in both http://prenosnik.net/upn/packet/pdfptt and http://prenosnik.net/upn/packet/viewall return 404 Not Found.
Could you check it out?
solata10 wrote on 2013-01-29:
sorry, wrong links:

http://www.prenosnik.net/upn/index.php/packet/viewall
and
http://www.prenosnik.net/upn/index.php/packet/pdfptt
support wrote on 2013-01-29:
The 0x2440, 0x2441, and 0x2442 Unicodes are not present in the OCR-A font.

There is the Code2000 font installed on our servers that contains these characters. You need to add it to your pdfstyles.css, line 502:
font-family: Eurobanking, Code2000;


This should resolve the issue.
solata10 wrote on 2013-01-29:
thank you, it works perfectly.
support wrote on 2013-02-06:
Hello,

We had to uninstall the Code2000 font from technical reasons so the solution above does not work at the moment.
We are currently looking into another solution that would allow displaying the 0x2440, 0x2441, and 0x2442 Unicodes correctly. We will post the solution here.

We apologize for the inconvenience.
support wrote on 2013-02-06:
Please replace the following line in pdfstyles.css
font-family: "Eurobanking","Code2000";

with
font-family: OCRA;

After this change, all OCR characters in your document should be printed correctly again. Since we installed the correct version of the OCRA font on our server you can remove the following rule from your style sheet now:
@font-face {
    font-family: "Eurobanking";
    src: url("../font/OCRAEXT.TTF") format("truetype");
}