www.jlion.com

Tuesday, March 25, 2008

I'm honored that Daniel A Joseph and John Ettlie have chosen to reference an article on the productivity paradox that I wrote back in 2005. Their reference appears in Strategic ERP Extension and Use, Standford Business Books, 2005 ISBN 0-8047-5098-X, in a chapter titled "IT-Supported Productivity: Paradoxes and Resolution in R&D", pages 130-139.

Joseph and Ettlie challenge the provocative editorial, "IT Doesn't Matter" that was published in Harvard Business Journal in 2003 by Nicholas G. Carr. Their argument is that IT does matter--without skilled management, commodized IT can actually result in lower productivity.



Over the last week, I've been looking at a couple of books. iText In Action is the penultimate reference on the iTextSharp PDF creation library, and PDF Hacks is a great compendium of hints and tricks for working with PDF files.

Here are a couple of PDF Hacks that I found particularly intriguing, in spite of the fact that they're only tangentially related to the PDF format:

Hack #27: Become a Publisher. This one describes how to establish yourself as a publisher so that you can issue your own ISBN numbers. To do this, all that's necessary is a credit card and a visit to http://www.isbn.org.

Hack #29: Publish POD and E-books. POD stands for print-on-demand and it seems that printing books using POD is not as expensive as one might think. http://www.lightningsource.com charges a yearly setup fee and a nominal fee per printing which is something like $5/book.


The Federal Reserve bailout of Bear Sterns strikes me as just absolutely criminal and corrupt. Ayn Rand must be spinning in her grave. What a load of bollucks. That's all I've got to say on that topic.

Thursday, March 06, 2008

PDFs and iTextSharp

http://itextsharp.sourceforge.net/

For the last day and a half, I've been using iTextSharp to create a PDF document, display it in an IFRAME on a web page then print it out. Here I'm going to share some of the tips and techniques that I found while making this happen.

First, there doesn't seem to be an easy way to print a PDF from a web page. What I ended up doing is executing a little javascript function from the iFrame's onLoad event. Since this event fires when the PDF starts loading, not when it finishes, I have a timer that waits for a few seconds to give the PDF time to load before it tries to print the contents of the iFrame. The function looks like this:

var mTID;

//function waits 7 seconds before trying to print the iframe, to give the PDF time to load.
function StartClock()
{
mTID=setInterval('PrintPDF()',5000);
}

//function prints the contents of the iframe. Hopefully the iframe will be occupied
// by acrobat reader, which will override the browser's print functionality.
function PrintPDF()
{
frames['PDFLINK'].focus();
frames['PDFLINK'].print();

clearInterval(mTID);

alert('print');
}
Of course, to get this far one has first to set the SRC of the iFrame. This is easily possible through javascript but it is also possible in the codebehind, using the attributes collection, as follows:

' the iframe has runat="server" and ID="PDFLINK"

PDFLINK.Attributes("src") = oReport.DocumentURL '<--URL of PDF document to display

From what I was able to discover on the net, there is no way to print directly to the printer without first displaying the printer confirmation dialog using this method. It may be possible to do this by attaching javascript directly to the PDF document, but as doing so would have required me to do a lot of research into a part of iTextSharp not directly essential for this project, I opted not to pursue that path. A dialog is not such a big deal.

As far as iTextSharp goes:

What I like:
  • Doesn't require installation (IE: not COM) so I can run it on a hosted server.
  • Very popular, so there's a lot of info out there, and it seems to be actively updated and supported.
  • It's open source, so if I needed to I could dig into the code to see how something really does work.
What I don't like:
  • It's an open source project, so the documentation sometimes falls a version or two behind the production code. IE: The documentation says "do something", you try it and it doesn't work because the way to do that thing has changed in the most current version. Note: This doesn't happen often.
  • As a way to create PDF documents, iTextSharp(and I suppose any other direct PDF creation tool) is going to be labor intensive. You spend a lot of time creating a test document, changing a line thickness or a cell width then recreating the document. This is not iTextSharp's fault--that's just the way it is, and is something to think about if you're considering using iTextSharp as a reporting tool.

Tuesday, March 04, 2008

Yesterday's Boston Herald had this news blurb about two battling moms at a Chuck E Cheese pizza place in Natick, MA.

As a matter of fact, on Saturday I was at a local Chuck E Cheese franchise myself, at a birthday part, with my three boys. What a zoo! There were what appeared to be several hundred people in the restaurant, milling around, with children outnumbering working arcade games at a ratio of something like 10 to 1.

After Saturday's experience I will be reluctant to go back to Chuck E Cheese, at least on a weekend night. A quarter of the arcade games there were broken. The door-person was not strictly following the check-in/check-out policy and in the crowd it would have been too easy for someone to kidnap a child.

The employees seemed to be trying hard, but the establishment should have established a waiting period for tables like any other overcrowded restaurant does.

It would not surprise me if one the two women (or both) involved in the Natick, MA altercation decided to sue Chuck E Cheese.