PDF does not display Barcode

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

PDF does not display Barcode

st17901

I'm using iText to dynamically generate PDF docs. Now I'm trying to dynamically create a barcode in this PDF. Adobe Live Cycle has a barcode function built-in. You can just drag the barcode text box on the page and it's created.

Problem:
I placed the barcode field in the PDF. Then pass a number to the barcode field from the JSP page. But only the number appears. The barcode lines never display

The number, 20099002, is visible on the PDF doc, but the barcode lines fail to appear. I tried several other barcode options in LiveCycle but the all give the same result. (see Java code below)


Adobe's Response

As per my voicemail. Acrobat has no java interface, and neither does the SDK. Since this works fine using Designer, then you would need to figure out why your java process is not working. I did however, quickly review your form and it seems that the barcode is showing up properly. I am using Acrobat Pro Extended version 9. So you might want to try using Reader 9 to view this PDF. Also, I can see by your code that you are using iText, which is an opensource PDF library, this is NOT an Adobe product. We do not provide support for iText. You should contact Lowagie for support:

My Response: I tried version 9 - doesn't work

OurJavaPage.java 
   
public class ExampleForm extends BaseOutput {
   
private static final Log LOG = LogFactory.getLog(ExampleForm.class);
   
public OutputStream generate() throws IOException, DocumentException {
       
ByteArrayOutputStream baos = new ByteArrayOutputStream();
       
PdfReader reader;
        reader
= new PdfReader(BASEDIR + "MailingExample.pdf");

       
PdfStamper stamper = new PdfStamper(reader, baos);
       
Participant participantHome = home.getParticipant();
       
Set<Location> homeLocs = participantHome.getLocations();

       
final AcroFields form = stamper.getAcroFields();

        setFormField
(form, "addrNumber[0]", addrMaster.getStreetNum());
        setFormField
(form, "dateMiddle[0]", formatDate("MM-dd-yyyy", new Date()));

// *********** Here's the problem *****************************
        setFormField
(form, "Code128ABarcode1[0]", "20099002");
// ************************************************************

        debugAcrobatForm
("ExampleForm", form);
        stamper
.setFormFlattening(true);
        stamper
.close();

       
return baos;
   
}
}


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Reply | Threaded
Open this post in threaded view
|

Re: PDF does not display Barcode

iText mailing list
Hello,

Let me repeat FOR THE THIRD TIME (!) that what you are asking for IS NOT
SUPPORTED in iText!!!

Adobe is right when they say it works. It works when you DON'T FLATTEN
the form. But you have this line in your code:

sdwh wrote:
>         stamper.setFormFlattening(true);


You FLATTEN the form and therefore you are asking iText to draw the
appearances. Drawing the barcodes in a form IS NOT SUPPORTED in iText.

My apologies for shouting to the other subscribers on this list, but
when somebody gets answered THREE times and still doesn't understand the
meaning of "THIS IS NOT SUPPORTED IN iText", I have to raise my voice.
--
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Reply | Threaded
Open this post in threaded view
|

Re: PDF does not display Barcode

calosteward
This post has NOT been accepted by the mailing list yet.
In reply to this post by st17901
Maybe now your issue can be solved. Or you can refer to: display barcode guide