You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Tilman Hausherr <TH...@t-online.de> on 2017/01/09 06:32:10 UTC

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


RE: Regarding Barcode Font

Posted by Shivangi Singal <sh...@microlistics.com.au>.
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 <TH...@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


RE: Regarding Barcode Font

Posted by Shivangi Singal <sh...@microlistics.com.au>.
Yes I was planning to use fonts and I am still getting to know PDFBox ( it's my first time thus so many questions )  BUT idea was voted down by team as getting their sizes correct is near impossible, and calc-ing the  check-digit and start/stops is worse.

So now looking into the SVG format of barcode4j and or directly printing as while/black rectangles.

-----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 <TH...@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


Re: Regarding Barcode Font

Posted by Tilman Hausherr <TH...@t-online.de>.
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 <TH...@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


Re: Regarding Barcode Font

Posted by Karl Heinz Kremer <kh...@khk.net>.
On Mon, Jan 9, 2017 at 4:46 PM, Shivangi Singal <
shivangi.singal@microlistics.com.au> wrote:

> 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.
>

barcode4j does not just create images, you can also create SVG output. SVG
is an XML based vector format. You could parse this SVG and convert the
drawing commands to PDF drawing commands and add those to your document.
This would then create a vector based barcode. The only obstacle is the
parsing and conversion of SVG. I would analyze barcode4j output to see how
complex it would be to write my own parser/converter, and if that's not an
option, you can go with Apache Batik (https://xmlgraphics.apache.org/batik/)
to do the heavy lifting.

RE: Regarding Barcode Font

Posted by Shivangi Singal <sh...@microlistics.com.au>.
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 <TH...@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


Re: Regarding Barcode Font

Posted by Andreas Lehmkühler <an...@lehmi.de>.
> Tilman Hausherr <TH...@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


Re: Regarding Barcode Font

Posted by Tilman Hausherr <TH...@t-online.de>.
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/

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


RE: Regarding Barcode Font

Posted by Shivangi Singal <sh...@microlistics.com.au>.
Thank you Tilman for the options.

Where I can find more info about implementing barcode as vector graphics .. any documentation supporting that ? 

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