Solved

pdf417 tag for coldfusion

Posted on 2006-07-11
2
452 Views
Last Modified: 2013-12-24
I am in need of a pdf417 (2d barcode) image generator.  It can't be an activex control.

Any suggestions?
0
Comment
Question by:polobruce
2 Comments
 
LVL 36

Expert Comment

by:SidFishes
ID: 17083831
not tried it but it's java based...

http://www.idautomation.com/java/

(not free unfortunately)
0
 
LVL 12

Accepted Solution

by:
mmc98dl1 earned 250 total points
ID: 17086594
http://www.fusionzone.com/applications/barcode/index.cfm

http://barbecue.sourceforge.net/ - free java based barcode genrator - very  good and pretty easy to use.

Here is some sample text that is used to generate barcode in the iText format (already in CF7 as the reportgenerator requires it):

<cfparam name="fileName" type="string" default="/tmp/pdf_#createUUID()#.pdf">
<cfparam name="barcode" type="string" default="0000154000607064">
<cfparam name="invbarcode" type="string" default="OESALES1000001157">
<CFSCRIPT>
      pageSize = createObject("java", "com.lowagie.text.PageSize").init();
    document = createObject("java", "com.lowagie.text.Document").init(pageSize.LETTER, 36, 36, 36, 36);
    pdfFile = createObject("java", "java.io.FileOutputStream").init(fileName);
    writer = createObject("java", "com.lowagie.text.pdf.PdfWriter").getInstance(document, pdfFile);
      FontFactory = createObject("java", "com.lowagie.text.FontFactory");
      
      barcode = ucase(barcode);
      
      document.open();
      
      cb = createObject("java", "com.lowagie.text.pdf.PdfContentByte");
      cb = writer.getDirectContent();
      
      code128 = createObject("java", "com.lowagie.text.pdf.Barcode128");
    code128.setCode("#invbarcode#");
    code128.setStartStopText(false);
      
      Color = createObject("java", "java.awt.Color");
    image128 = createObject("java", "com.lowagie.text.Image");
      image128 = code128.createImageWithBarcode(cb, Color.black, Color.black);
      
      rectangle = createObject("java", "com.lowagie.text.Rectangle").init(code128.getBarcodeSize());
      bar128X = rectangle.width();
      
      rectangle = pageSize.LETTER;
      letterX = rectangle.width();
      
      loc = (letterX - (bar128X + 75));
      
      p1 = createObject("java", "com.lowagie.text.Paragraph").init("");
      p1.add(createObject("java", "com.lowagie.text.Phrase").init(createObject("java","com.lowagie.text.Chunk").init(image128, loc, 0)));
      document.add(p1);
      
      document.add(createObject("java", "com.lowagie.text.Paragraph").init("* I N V O I C E *", FontFactory.getFont(FontFactory.HELVETICA_BOLD, javacast("float", 28.0) )));
      document.add(createObject("java", "com.lowagie.text.Paragraph").init(" "));
      
      document.close();
</cfscript>
<CFCONTENT TYPE="application/pdf" FILE="#fileName#" DELETEFILE="yes">

That should be more than enough for you to get on with.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
LAMP problem identifier tool ? 9 110
Google Maps 7 72
What is the best software for scanning a website and then create a website map? 2 105
Problem to get function 52 100
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now