Coldfusion cfprint and UPS labels

258 views Asked by At

I am trying to use Coldfusion CFPRINT to print UPS labels to a network printer. The starting labels (png files) are great and I can print them locally to the zebra printer and they print and work wonderfully. The barcodes produced by CFPRINT however are of such poor quality that a barcode scanner cannot read them. My research shows that Coldfusion uses the jpedal java library which resizes the images to 72 dpi - which is just not crisp enough for a scanner.

I read about using a jpedal setting: org.jpedal.upscale=2 but I have no clue as to where you would utilize this.

Any suggestions on how to fix this CFPRINT resolution issue using Coldfusion?

1

There are 1 answers

0
Leigh On

(Just to add a bit more detail to the comments)

That is a JVM argument. There are several ways to apply it:

  1. Add the setting to your jvm.config file manually. Backup the file first. Then add -Dorg.jpedal.upscale=2 to the end of the java.args section. Save the changes and restart the CF Server.

    Do not skip the backup step! Errors in the jvm.config file can prevent the server from starting. So it is important to have a good copy you can restore if needed.

  2. Open the CF Administrator and select Server Settings > Java and JVM > JVM Arguments. Add -Dorg.jpedal.upscale=2 to the end of the arguments. Save the settings and restart the CF server.

    Again, I would strongly recommend making a backup of the jvm.config file first. As @Mark noted in the comments, some versions of CF have been known to mangle the jvm.config file, which could prevent the server from starting. But as long as you have a good backup, simply restore it and you are good to go.

  3. IIRC, you could also set the property at runtime, via code. However, timing will be more of a factor. Their API states system properties must be set before accessing JPedal. The docs are not clear on exactly what that means. However, the implication is the system property is only read once, so if you set it too late, it will have no affect.

    // untested sys = createObject("java", "java.lang.System"); prop = sys.getProperties(); prop.setProperty("org.jpedal.upscale", "2"); sys.setProperties(prop);

Side note, I was not familiar with that setting, but a quick search turned up the CF8 Update 1 Release Notes which mention this setting "improves sharpness, but it also doubles the image size" and also increases memory. Just something to keep in mind.