[Cialug] pdf thing (again)

Dave J. Hala Jr. dave at 58ghz.net
Fri Nov 3 09:01:43 CST 2006


This is a cool idea regarding creating the PDF on the fly. I'm thinking
that what I'd like to do is more like having 3 or 4 pre-made, yet
completely differant forms with some common data  elements. (like name,
address,etc.) The I could extract the data from the db, insert it into
the form.

If or one of all of the forms change, then I could just "tweak" the
form, and not mess around with the code. Of better yet, the end user
could tweak the form, then upload it into a special directory on the web
server, and I wouldn't have to mess with it.


On Fri, 2006-11-03 at 08:49, Barry Von Ahsen wrote:
> we use ezpdf (http://www.ros.co.nz/pdf/) here at work to generate 
> contracts and w9 forms from database data.  the initial setup of a form 
> can be a bit difficult (you can pixel position everything, if you wanted 
> to), but the price is perfect :)
> 
> -barry
> 
> (some sample code)
> include_once('class.ezpdf.php');
> $pdf = new Cezpdf('letter','portrait');
> $pdf->ezSetMargins(43,30,30,50);
> $bf_size = 12;
> 
> $mainFont =  '/fonts/Helvetica.afm';
> $pdf->selectFont($mainFont);
> 	
> // SET DOCUMENT INFO
> $pdf->addInfo('Title', 'My PDF');
> $pdf->addInfo('Subject', 'Test');
> $pdf->addInfo('Author', 'Me');
> $pdf->addInfo('Producer', 'Myself');
> $pdf->addInfo('CreationDate', date("m/d/Y h:i:s A") );
> 
> $txt = "This is a paragraph\n";
> $pdf->ezText($txt,$bf_size,array('justification'=>'left'));
> 	
> $txt = "Your name is: " . $database_variable . "\n";
> $pdf->ezText($txt,$bf_size,array('justification'=>'left'));
> 
> if($stream) {
> 	$pdf->ezStream();
> } else {
> 	$pdfcode = $pdf->ezOutput();
> 	$fh = fopen("/path/to/pdf",rb);
> 	fwrite($fh, $pdfcode);
> }
> 
> 
> Dave J. Hala Jr. wrote:
> > Basically what I did when trying out pdf-tools' form filling tool was to
> > load the pdf form into acrobat professional. Then I defined the data
> > fields and saved the form.
> > 
> > To fill the form, I read the data from the database, and passed the
> > information to the form filling tool on the command line. Their tool
> > took the original pdf and the data and created a new, filled out pdf. It
> > was slick and it worked well. Smoking fast, with almost no overhead.
> > 
> > I'm not against forking out $2k for pdf-tools's software. However, I
> > have all dual cpu machines and possibly a quad coming in the future.
> > That will raise my licensing fees considerably. Don't get me wrong,
> > pdf-tools is well worth the money and they have excellant support.
> > However, if I can find a lower cost alternative, I could be more
> > competitive.
> > 
> > :) Dave
> > 
> > 
> > 
> > 
> > 
> > On Fri, 2006-11-03 at 07:42, carl-olsen at mchsi.com wrote:
> >> From what I see, it looks like it would be possible to build the FDF
> >> file using PHP and data from a database.  I'm not too familiar with
> >> running command line instructions using PHP, but I'm sure that its not
> >> difficult.  I'm wondering if I can create the form using Acrobat and
> >> then use this tool to fill in the form fields, or whether the PDF has
> >> to be created using this tool.  I know how to create a form with fill
> >> in fields using Acrobat, but I'd be lost if I had to create one from a
> >> command line.
> >>
> >>  
> >>
> >> I know how to capture form fields from a PDF and put the data into a
> >> database, but I never could figure out how to populate the fields from
> >> the database later when I wanted to print out a copy of a form that
> >> someone filled out using a web browser.  The options I found at that
> >> time were very expensive.  I looked at the IRS website and found the
> >> tool they were using was about half the price of the Adobe tools, but
> >> it was still several thousand dollars.
> >>
> >>  
> >>
> >> Carl Olsen
> >>
> >> Web Developer
> >>
> >> Drake University
> >>
> >>
> >>         -------------- Original message from "Dave J. Hala Jr."
> >>         <dave at 58ghz.net>: -------------- 
> >>         
> >>         
> >>         > I've been experimenting with a trial version of PDF Tools
> >>         form filling 
> >>         > tool. (www.pdf-tools.com) It takes an existing pdf, and
> >>         allows you to 
> >>         > insert data into the form fields in the pdf. 
> >>         > 
> >>         > It works awesome. However, its priced by CPU. This makes it
> >>         a little 
> >>         > pricey on a dual cpu server or a dual core server. I'm
> >>         looking for a 
> >>         > lower cost alternative. 
> >>         > 
> >>         > I found something called pdftk or PDF Toolkit 
> >>         >
> >>         http://applications.linux.com/article.pl?sid=06/04/17/1943230&tid=47
> >>         > 
> >>         > It seems to be the solution I'm looking for. Has anyone had
> >>         any 
> >>         > experience with it before? 
> 
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug
-- 

Open Source Information Systems, Inc. (OSIS)
Dave J. Hala Jr., President <dave at osis.us>
641.485.1606 www.osis.us
Save a life: Adopt a shelter animal!



More information about the Cialug mailing list