You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Rob Bradley <ro...@ttlco.com> on 2009/08/18 17:08:36 UTC

How do you add BarCode 39

I need to add a barcode 39 to new pdf documents.  Does anyone have an example?  I would assume it is just a matter of loading a font. 

I have everything else working well, but I just have done much with fonts other than the defaults yet.

FYI, I have written a vb.net class for creating and reading PDF documents using PDFBox.  It contains routines for creating and formatting a new PDF.  I am using it in conjunction with aspx pages to deliver copies of invoices to customers.  

Is this something I should post when I have it debugged?

Thanks
Rob Bradley


RE: How do you add BarCode 39

Posted by Rob Bradley <ro...@ttlco.com>.
Thanks Andreas, 

I am now using loadTTL to test different fonts.

I have been able to load in my test app "Times Roman" or the file "timr45w.ttf" with no problems.

However, every one of my BarCode fonts create documents fine but when opened in Adobe Reader it gets:
"Cannot extract the embedded font 'IDAutomationHC39M'. Some characters may not display or print correctly."

Because the same code works fine with Times Roman I am assuming it has to do with the fonts themselves.  

So far I have tried:
IDAutomationHC39 (from IDAutomation.com)
AdvHC39a (from bizfonts.com)
Free2of9 (from barcodesinc.com)

Am I on the right track or do I need to address the "Cannot extract" error?

Thanks
Rob Bradley

-----Original Message-----
From: Andreas Lehmkühler [mailto:andreas@lehmi.de] 
Sent: Sunday, August 23, 2009 11:04 AM
To: pdfbox-users@incubator.apache.org
Subject: Re: How do you add BarCode 39

Hi Rob,

Rob Bradley schrieb:
> I need to add a barcode 39 to new pdf documents.  Does anyone have an example?  I would assume it is just a matter of loading a font. 
> 
> I have everything else working well, but I just have done much with fonts other than the defaults yet.
If your font is a truetype try something like this before adding some
text to the document:

PDDocument doc = PDDocument.load( ... );
PDFont font = PDTrueTypeFont.loadTTF(doc, new File("SpecialFont.ttf"));

BR
Andreas Lehmkühler

Re: How do you add BarCode 39

Posted by Andreas Lehmkühler <an...@lehmi.de>.
Hi Rob,

Rob Bradley schrieb:
> I need to add a barcode 39 to new pdf documents.  Does anyone have an example?  I would assume it is just a matter of loading a font. 
> 
> I have everything else working well, but I just have done much with fonts other than the defaults yet.
If your font is a truetype try something like this before adding some
text to the document:

PDDocument doc = PDDocument.load( ... );
PDFont font = PDTrueTypeFont.loadTTF(doc, new File("SpecialFont.ttf"));

BR
Andreas Lehmkühler