Posted on 1 Comment

Error converting tiff to pdf

So I am trying to deploy the website I recently completed. Deploy? That means move the site from a development server to a production server where the world can see the application in action. It took this long to deploy because the webhost was running PHP 4.0.0 and had to upgrade to at least PHP 4.4.4 (went to 5.1.6 which is nice). However, they did not take the extra 10 minutes it would have taken to include CURL support.

So, the dev works great using CURL to pull a series of tiffs from another server, then using the Zend Framework, combine those tiffs into a single tiff, and finally convert the tiff to a pdf. I moved the code to the production server and it works fine until we get to converting the tiff to a pdf. It actually converts but the pdf is unviewable simply producing the error "file does not begin with ‘%PDF-‘." These kinds of problems are why developers never make their deadlines. I am working on the presumption that I failed to write some header information into the file. I want this over.

Posted on 1 Comment

Oh yes! Program done!

I now have successfully written a PHP program that goes to another website, downloads any number of tif files (one test used 48), combines them into a single tif file, converts the tiff to a single pdf file (48 tiffs become a 48 page pdf), and presents the new single pdf and single tif to the enduser for downloading or viewing. This was a nightmare and has cost me dearly. It is done and I can move on.

Posted on 2 Comments

Lower the bar!

I have to quit taking on the impossible projects.

What am I doing now? My current contract is to allow a user to enter a single product id or a list of product ids then go out to a government website and download the 17 or so pages of pdfs for each product. Then I combine the multiple pages of pdf documents into a single pdf document and present it to the user for download to their local machine. I may end up inserting footer information into each page of the pdf. I have to do this for 4 different countries. Then I have to convert the code from php 4.4.4 to php 4.0.0.

Posted on 1 Comment

Coding hurts

This is the stuff that makes my eyes bleed:

<FORM action="{$register_script_name}?{$smarty.server.QUERY_STRING}" method="POST" name="registerform"{if $js_enabled} onsubmit="javascript: if (check_zip_code(){if $default_fields.email.required eq 'Y'} && checkEmailAddress(document.registerform.email){/if}) return true; else return false;"{/if}>

Posted on 3 Comments

Simple is never simple

So I take on two quickie low cost, fast turn around projects and they are eating me alive!

The first is a ColdFusion reporting project that is simply supposed to take the existing statistics report and produce a chart using CFChart. Works fine on my CFMX6.1 development server but apparently IIS6 and CF7.1 don’t play nice when it comes to CFChart. The problem is with IIS but Adobmedillare has been kind enough to release a hot fix that doesn’t work. "This hot fix explicitly generates HTTP headers before the chart data."

The second simple project is a PHP COTS shopping system (x-cart) that needs some customization. Only, it’s not using PHP per se. The customizations are all done using SMARTY. The challenge with programming, particularly web application programming, is constantly having to learn new languages/frameworks/methodoligies and being able to turn work like its old hack.

Using this simple CFChart example works in CF6.1 and fails in CF7.01 even after the hot fix.

<cfchart>
   <cfchartseries type="pie">
      <cfchartdata item="New car sales" value="50000">
      <cfchartdata item="Used car sales" value="25000">
      <cfchartdata item="Leasing" value="30000">
      <cfchartdata item="Service" value="40000">
   </cfchartseries>
</cfchart>

Anyone have extra tickets for CFUnited? I’d love to go this year but can’t justify the cost of the event.

UPDATE: Just tried the ColdFusion MX 7.0.1 Cumulative Hot Fix 2 with no luck. Note the hot fix advises:

Any individual hot fixes previously installed that are now contained in this cumulative hot fix should be removed.

we recommend always using the latest version of the cumulative hot fix

In short, remove any previous *.jars and only install the latest fix.