The Invoice is landscape.

Here's the example code;

        //Data for the barcode : it is composed of 3 blocks whith AI 402, 90
and 421
                                // The blocks whith the type 402 and 90 are
of variable size so you must put a FNC1
                                // to delimitate the block
                                //String data = code402 + code90 + code421;

                                PdfContentByte cb =
writer.getDirectContent();

                                 // String t402 =
c.getDeliveryLocation()+RA+c.getAccount()+Barcode128.FNC1;
                                  //String t90 =
c.getDeliveryLocation()+RA+c.getAccount()+Barcode128.FNC1;
                                  //String t421 = "000000";
                                  //String data =       t402+t90+t421;
                                PdfPTable pageTot = new PdfPTable(1);
                                pageTot.getDefaultCell().setPadding(0f);
                                
        
pageTot.getDefaultCell().setBorder(Rectangle.NO_BORDER);
        
pageTot.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
                                pageTot.setWidthPercentage(100f);

                                String systemDate =
Integer.toString(c.getSystemDD())+Integer.toString(c.getSystemMM())+Integer.
toString(c.getSystemYY());

                                String t402 =
up.getUserCompany()+c.getVehicleOwningLocation()+RA+Barcode128.FNC1;
                                String t90 = systemDate+Barcode128.FNC1;
                                String t421 = "XX";
                                String data =   t402+t90+t421;
                System.out.println("Barcode data : "+data);
                                PdfPTable cell = new PdfPTable(1);
        
cell.getDefaultCell().setBorder(Rectangle.NO_BORDER);
                                cell.getDefaultCell().setPadding(0f);
            
                                PdfPCell info = new PdfPCell(new Phrase("
"));
                                info.setBorder(Rectangle.NO_BORDER);
                                pageTot.addCell(info);
            
                                Barcode128 shipBarCode = new Barcode128();
                                shipBarCode.setX(0.75f);
                                shipBarCode.setN(1.5f);
                                shipBarCode.setChecksumText(true);
                                shipBarCode.setGenerateChecksum(true);
                                shipBarCode.setSize(5f);
        
shipBarCode.setTextAlignment(Element.ALIGN_CENTER);
                                shipBarCode.setBaseline(5f);
                                shipBarCode.setCode(data);
                                shipBarCode.setBarHeight(10f);

                                Image imgShipBarCode =
shipBarCode.createImageWithBarcode(cb, Color.black, Color.black);
                                imgShipBarCode.setRotationDegrees(0);  
                                
                                PdfPCell shipment = new PdfPCell(new
Phrase(new Chunk(imgShipBarCode, 0, 0)));
        
shipment.setFixedHeight(shipBarCode.getBarcodeSize().height() + 16f);
                                shipment.setPaddingTop(5f);
                                shipment.setPaddingBottom(10f);
                                shipment.setBorder(PdfPCell.NO_BORDER);
        
shipment.setVerticalAlignment(Element.ALIGN_TOP);
        
shipment.setHorizontalAlignment(Element.ALIGN_CENTER);
                                cell.addCell(shipment);
                                
                                pageTot.addCell(cell);
                                pageTot.setTotalWidth(1); 
                                if (c.getPartSetup().equals("N"))
                                        pageTot.writeSelectedRows(0, -1,
300, 300, writer.getDirectContent());
                                // pageTot.writeSelectedRows(0, -1, 500, 50,
writer.getDirectContent());



---------------------------------------------------------
Steve Simpson
Arriva Vehicle Rental
 
Tel   : 0191 520 4029
Mob : 07917 268 934
 
For WebSphere support : [EMAIL PROTECTED]
Website                          : www.arrivarental.co.uk


-----Original Message-----
From: Bruno Lowagie [mailto:[EMAIL PROTECTED] 
Sent: 10 February 2006 13:10
To: Steve Simpson (AVR IT Dept)
Cc: [email protected]
Subject: Re: [iText-questions] Barcodes

Steve Simpson (AVR IT Dept) wrote:

> All,
>
>  
>
> I have a barcode that I print on an Invoice that runs horizontally 
> from left to right.  I now want to rotate this barcode through 90 
> degrees clockwise so that it will run down the right hand side of the 
> page.  As soon as I try to rotate the barcode in iText I lose the 
> barcode from the invoice.  I've tried using
>
>  
>
> imgShipBarCode.setRotation(90);
>
> and
>
> imgShipBarCode.setRotationDegrees(90);
>
>  
>
> Can you offer any advice on how to rotate this barcode?
>
>  
>
I think the barcode is in your invoice, but it's probably rotated 'off 
the page'.
Is imgShipBarCode an instance of com.lowagie.text.Image?
Try changing the absolute position of the image.
And are you sure the scaledWidth and scaledHeight are > 0?
br,
Bruno


**************************************************
Legal Disclaimer - Arriva plc
The contents of this e-mail are confidential and may be privileged and 
protected by law and are intended solely for the use of the person to whom they 
are addressed.
If you are not the intended recipient of this message please notify the sender 
immediately, disclosure of its content to any other person is prohibited and 
may be unlawful.
Please note that any views expressed in this e-mail may be those of the 
originator and do not necessarily reflect those of this organisation.
Copyright in this e-mail and attachment(s) belongs to 
Arriva plc.
Internet e-mail is not a secure communications medium.
Please note this lack of security when responding by e-mail. Accordingly, we 
give no warranties or assurances about the safety and content of this e-mail 
and its attachments.
Neither Arriva plc nor the sender accepts any responsibility for viruses and it 
is your responsibility to scan the e-mail and attachments.
Any liability arising from any third party acting on any information contained 
in this e-mail is hereby excluded.
**************************************************



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to