pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shivangi Singal <shivangi.sin...@microlistics.com.au>
Subject RE: Regarding Barcode Font
Date Tue, 10 Jan 2017 03:22:10 GMT
Hi,

I was successfully able to add draw barcode onto pdf using barbeque .. 

	PDPageContentStream pageContentStream = new PDPageContentStream(doc, pdPage);  
            Barcode barcode = BarcodeFactory.createCode128C("9311181127464");  
            barcode.output(new DrawBarcodeOutput(pageContentStream,140,500, 15));
        	pageContentStream.close();


it doesn’t convert the barcode directly into image which looks good now.

Thanks,
Shivangi

-----Original Message-----
From: Tilman Hausherr [mailto:THausherr@t-online.de] 
Sent: Tuesday, 10 January 2017 9:29 AM
To: users@pdfbox.apache.org
Subject: Re: Regarding Barcode Font

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:andreas@lehmi.de]
> Sent: Monday, 9 January 2017 10:21 PM
> To: users@pdfbox.apache.org
> Subject: Re: Regarding Barcode Font
>
>
>> Tilman Hausherr <THausherr@t-online.de> 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:THausherr@t-online.de]
>>> Sent: Monday, 9 January 2017 5:32 PM
>>> To: users@pdfbox.apache.org
>>> 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: users-unsubscribe@pdfbox.apache.org
>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>
>>>
>>> --------------------------------------------------------------------
>>> - To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org

Mime
View raw message