You used the [EMAIL PROTECTED] address to reply instead
of the [email protected] address.
I haven't been using that address since July 1, so
don't be surprised if you didn't get an answer.

I'm forwarding the question to the list because:
1. that's where it belongs.
2. I don't understand your question.
Please rephrase the question (and don't mail me personally;
use the list!)

[EMAIL PROTECTED] wrote:
> Hi There
> 
> Thank you for your reply. I am not using the bar to create the barcode.
> 
> I also tried even before the Image scaling methods for example, 
> image.scalePercent() and image.scaleAbsolute(). It gives me the same size 
> even after I change the width and height.
> 
> First of all, I dont know whether the scaleAbsolute() method needs the pixels 
> information of width and height or else just in millimeter?
> 
> Here below is the code with which I tried:
> 
> BarcodeEAN codeEAN = new BarcodeEAN();
> 
> //appenedString contains the Barcode
> codeEAN.setCode(appendedString);
> Image image = codeEAN.createImageWithBarcode(_pdfWriter
>                               .getDirectContent(), null, null);
> image.scaleAbsolute(774.7f, 545.592f); 
> 
> I converted the millimeter into pixels, that is 
> 
> 30.50mm(width) after converting into pixels: 774.7f
> 21.48mm(height) after converting into pixels: 545.592f
> 
> I would like to know how to scale my barcode which is an image. Thank you in 
> advance.
> 
> Best Regards
> Kris
> 1T3XT info wrote:
>> Krisch wrote:
>>> Hi All
>>>
>>> I use iText to generate dynamically the PDF which works good. I did
>>> generate
>>> some PDFs with the barcodes on it. 
>>>
>>> I am trying to scale the barcode to different pre-defined Standard scale
>>> sizes as follows: 
>>>
>>> Scale           Area   Width   Height
>>>
>>> SC0 (81.8%)  0.27   30.50 x 21.48         
>>> SC1 (90%)    0.297 33.56 x 23.34         
>>> SC2 (100%)   0.33   37.29 x 25.93         
>>> SC3 (110%)   0.363 41.02 x 28.52         
>>> SC4 (120%)   0.396 44.75 x 31.12         
>>> SC5 (135%)   0.445 50.34 x 35.01         
>>> SC6 (150%)   0.495 55.94 x 38.90         
>>> SC7 (165%)   0.544 61.53 x 42.78         
>>> SC8 (185%)   0.610 68.99 x 47.97         
>>> SC9 (200%)   0.66   74.58 x 51.86         
>>>
>>> I assume this must be a simple task to scale a barcode and I found the
>>> method to set the width and height BarcodeEAN.setX() and
>>> BarcodeEAN.setBarHeight() but unfortunately it is not working how I
>>> expect
>>> to be. The code is as follows:
>>>
>>>        BarcodeEAN codeEAN = new BarcodeEAN();
>>>       float width = 30.50f;
>>>       float height = 21.48f;
>>>       float convertedWidthInInches = 1.200785f;
>>>
>>>       //float convertedHeightInInches =0.8456676f;
>>>       codeEAN.setX(convertedWidth);
>>>       codeEAN.setBarHeight(height);
>>>       codeEAN.setCode(appendedString); //this is to set code for barcode 
>>>
>>>       Image image = codeEAN.createImageWithBarcode(_pdfWriter
>>>                   .getDirectContent(), null, null);
>>>
>>>       return image;
>>>
>>> When I change the width and height in the above code, for example the
>>> 100%
>>> scale(37.29f x 25.93f) is slightly bigger than the 200%scale(74.58f x
>>> 51.86f). To put simple, there is no difference at all :-(!
>>>
>>> I looked into the API of BarcodeEAN but there is not so much of
>>> information 
>>>
>>> Anyone know where I am wrong? Thank you in advance.
>> x holds the MINIMUM width of a bar, NOT the width of the
>> complete barcode. With setX() you make sure you don't
>> create barcodes with bars that can't even be read by a
>> barcode reader ;-)
>> The width of the barcode depends on different parameters,
>> but you could scale the barcode by using the scale methods
>> in class Image.
>> -- 
>> This answer is provided by 1T3XT BVBA
>>
>> -------------------------------------------------------------------------
>> Check out the new SourceForge.net Marketplace.
>> It's the best place to buy or sell services for
>> just about anything Open Source.
>> http://sourceforge.net/services/buy/index.php
>> _______________________________________________
>> iText-questions mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/itext-questions
>>
>> Do you like iText?
>> Buy the iText book: http://www.1t3xt.com/docs/book.php
>> Or leave a tip: https://tipit.to/itexttipjar
>>
>>
> Quoted from: 
> http://www.nabble.com/Scaling-the-Barcode-created-using-the-BarcodeEAN-tp18112364p18116635.html
> 
> 


-- 
This answer is provided by 1T3XT BVBA

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to