Usps Intelligent Mail Barcode?

View: New views
5 Messages — Rating Filter:   Alert me  

Usps Intelligent Mail Barcode?

by pickm :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I could not find any information on the mailing list or in the book for Usps Intelligent Mail Barcodes.  Does iText support it?  

Re: Usps Intelligent Mail Barcode?

by pickm :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Is there any future plan for support for this new barcode?

pickm wrote:
I could not find any information on the mailing list or in the book for Usps Intelligent Mail Barcodes.  Does iText support it?  

Re: Usps Intelligent Mail Barcode?

by Paulo Soares-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

No, unless there's a contribution or someone is willing to sponsor the development.

Paulo

________________________________________
From: pickm [pickellm@...]
Sent: Wednesday, November 19, 2008 4:20 PM
To: itext-questions@...
Subject: Re: [iText-questions] Usps Intelligent Mail Barcode?

Is there any future plan for support for this new barcode?


pickm wrote:
>
> I could not find any information on the mailing list or in the book for
> Usps Intelligent Mail Barcodes.  Does iText support it?

Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem.

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message.



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Re: Usps Intelligent Mail Barcode?

by Tobias van Treeck :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi pickm,

have a look at the barcode4j project since they support USPS.
http://barcode4j.sourceforge.net/

Maybe you can integrate that lib into itext or you
1. generate a barcode as an image
2. add that with itext into an pdf

Or

you use FOP to create your PDFs and then you can use the already
existing barcode4j plugin for
FOP to generate the barcode directly into your PDF.

Regards,
ToM

>
> Is there any future plan for support for this new barcode?
>
>
> pickm wrote:
> >
> > I could not find any information on the mailing list or in the book
> > for
> > Usps Intelligent Mail Barcodes. Does iText support it?
> >
>
> --
> View this message in context:
> http://www.nabble.com/Usps-Intelligent-Mail-Barcode--tp20567701p20583364.html
> Sent from the iText - General mailing list archive at Nabble.com.
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> iText-questions mailing list
> iText-questions@...
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> Buy the iText book: http://www.1t3xt.com/docs/book.php


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Re: Usps Intelligent Mail Barcode?

by pickm () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank you both for the responses.  I looked into the Barcode4J library and was able to use it very easily with iText.  Pardon the messy calculations, a lot of the values are for tweaking it to my particular mailing.

        /**
         * Create a USPS Intelligent Barcode using Barcode4J and add it to iText document.
         * @param code barcode value
         * @param cb overcontent from stamper
         * @param fieldPositions stamper.getAcroFields().getFieldPositions("...") for the placeholder field in PDF template
         */
        public static void createUspsIntelligentBarcode(String code, PdfContentByte cb, float[] fieldPositions) {
               
                if ((code.length() != 20) && (code.length() != 25) && (code.length() != 29) && (code.length() != 31)) {
                        throw new RuntimeException("UspsIntelligentBarcode: code length of " + code.length() + " is invalid.");
                }
               
                //Note: fieldPositions data = [page, llx, lly, urx, ury]
                float height = (fieldPositions[4]-fieldPositions[2]);
                float width = (fieldPositions[3]-fieldPositions[1]);
               
                PdfTemplate tp = cb.createTemplate(width, height);
               
                // Create the graphics and canvas objects that will contain the barcode.
                Graphics2D g2 = tp.createGraphics(width, height);
                g2.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
                g2.scale(2.5, 2.835); // (1mm == 2.835 points) + tweaking on x to make bar width correct
                Java2DCanvasProvider provider = new Java2DCanvasProvider(g2, 0);
               
                // Create Barcode4J barcode on canvas
                USPSIntelligentMailBean barcode = new USPSIntelligentMailBean();
                // use 70% of converted values.  Measurements on printouts needed to be tweaked.
                barcode.setAscenderHeight(UnitConv.in2mm(0.1f) * 0.7f);  // height of ascender/descender per USPS spec
                barcode.setTrackHeight(UnitConv.in2mm(0.05f)* 0.7f);      // height of track bar per USPS spec (smallest bar of barcode)
                barcode.setBarHeight(UnitConv.in2mm(0.145f)* 0.7f);
                barcode.setIntercharGapWidth(UnitConv.in2mm(0.04f)* 0.7f * 1.13f); // adjust again for scaling
                barcode.generateBarcode(provider, code);
               
                g2.dispose();
               
                // adjust x/y to perfect location for envelope window
                float inch = 72f; // itext manual pg 33
                float xCoordinate = fieldPositions[1] - ((1f/8f) * inch);
                float yCoordinate = fieldPositions[2] - ((3f/32f) * inch);
               
                cb.addTemplate(tp, xCoordinate, yCoordinate);
        }


Tobias van Treeck wrote:
Hi pickm,

have a look at the barcode4j project since they support USPS.
http://barcode4j.sourceforge.net/

Maybe you can integrate that lib into itext or you
1. generate a barcode as an image
2. add that with itext into an pdf

Or

you use FOP to create your PDFs and then you can use the already
existing barcode4j plugin for
FOP to generate the barcode directly into your PDF.

Regards,
ToM

>
> Is there any future plan for support for this new barcode?
>
>
> pickm wrote:
> >
> > I could not find any information on the mailing list or in the book
> > for
> > Usps Intelligent Mail Barcodes. Does iText support it?
> >
>
> --
> View this message in context:
> http://www.nabble.com/Usps-Intelligent-Mail-Barcode--tp20567701p20583364.html
> Sent from the iText - General mailing list archive at Nabble.com.
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> Buy the iText book: http://www.1t3xt.com/docs/book.php


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php