Solved

pdf417 tag for coldfusion

Posted on 2006-07-11
2
451 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
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…

771 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

12 Experts available now in Live!

Get 1:1 Help Now