If you want something quick then use the font solution (check the license). Technically, fonts are vector graphics. If you have used PDFBox before to create PDFs, then you can do this in an hour.

Tilman

Am 09.01.2017 um 22:46 schrieb Shivangi Singal:
Hi Andreas ,

Yes I did give barcode4j a try but it gives barcode as an image which is then 
placed onto pdf and then when printed might lose the graphics after so much 
re-rendering.

I was trying to figure out a way if I achieve the same without adding barcode 
as an image.

Thanks,
Shivangi

-----Original Message-----
From: Andreas Lehmkühler [mailto:[email protected]]
Sent: Monday, 9 January 2017 10:21 PM
To: [email protected]
Subject: Re: Regarding Barcode Font


Tilman Hausherr <[email protected]> hat am 9. Januar 2017 um 08:11 
geschrieben:


Am 09.01.2017 um 08:02 schrieb Shivangi Singal:
Thank you Tilman for the options.

Where I can find more info about implementing barcode as vector graphics .. any 
documentation supporting that ?
For that (which would be a lot of work!) you'd need to get the
specification for the barcode type that you want to do. For "3 of 9",
start here:

https://en.wikipedia.org/wiki/Code_39  and then click on the links at
the bottom.

then you just draw filled rectangles at the correct position in the
correct size. See the ShowColorBoxes.java example on how to draw a
filled rectangle.

Or have a look at this:
https://www.pdflabs.com/tools/gnu-barcode-plus-pdf/

barcode4j might help as well

http://barcode4j.sourceforge.net/index.html

BR
Andreas

Tilman

Thanks,
Shivangi

-----Original Message-----
From: Tilman Hausherr [mailto:[email protected]]
Sent: Monday, 9 January 2017 5:32 PM
To: [email protected]
Subject: Re: Regarding Barcode Font

Am 09.01.2017 um 03:18 schrieb Shivangi Singal:
Hello ,

We have a project requirement where we need to display a label which consists 
of some text and a barcode . We don't want to display barcode as an buffered 
image but generate barcode may be using barcode font . I am not able to find 
any references in the examples as to if PDFBox has any way to add barcodes in 
pdf without being a image . I would really appreciate your help in the same .
Then get a barcode font. You can draw that one like any text. Usually this is done like 
this:  *12345*  , the "*" is for the beginning and end. Be careful to leave 
enough space before and after the barcode.

Don't forget to embed the font. (See the embeddedfonts.java example)

A completely different alternative would be to draw the barcode as vector 
graphics. There's no example for this yet AFAIK.

Tilman


--------------------------------------------------------------------
- To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


--------------------------------------------------------------------
- To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to