May 2018

          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
:: 04/12/2012 ::
Convert a Raster Image to Vector Formats with Flex and ColdFusion
Return   Back To Top
I created this example after reading a job posting looking for the ability to first load an image, and then, by selecting a portion of the image (using a selection rectangle), to save it into a "OCR-like" TIF file.

Click to try the example.

Sceenshot of the app:

Example display

If you're a regular reader of my blog, you'll recognize my technique that combines an AS3 PNG encoder, an open-source utility (KVEC), the Apache Batik project, and of course, ColdFusion 9, enabling you to convert an image to the TIF/PNG/SVG/PDF formats.

This example allows you to upload any JPG, PNG, or GIF (up to 500 KB each upload), and convert it entirely (or select any portion of it with a ActionScript 3 selection rectangle) to all four file-types - a SVG, a PNG, a TIF, and a PDF. It works like this:

  • The uploaded image (or only a selected portion) is passed as binary data to a ColdFusion CFC function that saves a PNG to the ColdFusion server's file system.
  • Next, leveraging an open source tool, KVEC, the PNG, created in step one, is passed to another CFC function that converts the PNG to a SVG file.
  • Next, the SVG is passed to a CFC function that completes the final conversions - 1) to a PDF file and 2) to a TIF file, using the Apache Batik project's batik-rasterizer.jar.
  • Next, leveraging the ColdFusion 9 (available in CF 8 too) <cfzip> tag, a CFC function creates a zip archive containing the PNG, the SVG, the TIF, and the PDF files of the uploaded image.
  • Finally, to save on disk space, a final CFC function is called to delete the TIF, SVG, and PDF files (once the zip archive is safely created). The PNG is retained and used for display purposes.

Click to try the example.

        Tip Jar:


canada goose femme pas cher Soldes Louboutin Chaussures Soldes Louboutin louis vuitton taschen outlet louboutin outlet uk billig canada goose canada goose tilbud goyard pas cher longchamp bags outlet Monlcer udsalg billige parajumpers YSL replica sac louis vuitton pas cher Canada Goose Pas Cher Canada Goose Outlet UK Moncler Outlet uk goyard replica bags polo Lacoste pas cher Bolsos Longchamp España Moncler Jakker tilbud Doudoune moncler pas cher Parajumpers Jakker tilbud Ralph Lauren Soldes Parajumpers Outlet louis vuitton replica Moncler Jas sale Billiga Canada Goose Jacka Canada Goose outlet Billiga Moncler Doudoune Canada Goose Pas Cher Canada Goose Pas Cher Louboutin Soldes Canada Goose Pas Cher Hemers replica Doudoune Canada Goose Pas Cher prada replica Canada Goose Pas Cher Canada Goose Soldes Doudoune Canada Goose Pas Cher Canada Goose Pas Cher Canada Goose outlet Canada Goose outlet Canada Goose outlet