Peter,
Thank you so much, it's exactly what I needed. I found that both of these
tools are already installed on one of the servers so I had a chance to try
it out. You were right about the tables but otherwise it works great!
Marina
>Resent-Date: Wed, 10 Oct 01 15:24:21 EDT
>Resent-From: Marina Hauptman <[EMAIL PROTECTED]>
>Resent-To: [EMAIL PROTECTED]
>X-Comment: mitvmc.mit.edu: Mail was sent by fort-point-station.mit.edu
>From: "Peter J. Schoenster" <[EMAIL PROTECTED]>
>Organization: Schoenster
>To: Marina Hauptman <[EMAIL PROTECTED]>
>Date: Wed, 10 Oct 2001 13:40:51 -0500
>Subject: Re: [htmltmpl] PDF Tools
>Reply-to: [EMAIL PROTECTED]
>Priority: normal
>
>
>***********************************************************************
>* Marina Hauptman ** *
>* MIT Admissions ** *
>* Rm 3-108 ** *
>* Phone 617-253-2036 ** *
>* *********************************************************************
>
> "The three principal virtues of a programmer are Laziness,
> Impatience, and Hubris."
> from perl man page
>
>
>
>----------------------------Original message----------------------------
>> On Wed, 10 Oct 2001, Marina Hauptman wrote:
>>
>> > It is not strictly a templatates questions but....
>> >
>> > I need to generate pdf documents based on web forms. No the catch is
>> > that responses to some of the questions can be anywhere from a couple
>> > of lines to about 32k. So not only the content must be generated
>> > dynamically but to a certain degree so is formatting.
>> >
>> > Is any of you using pdf tools (free or commercial) that may be useful?
>
>
>Hi,
>
>I recently used the following what I put below.
>
>Be very careful about the use of tables. I had some really funny
>pages get generated .... tiny,tiny text as it tried to put all the data
>on one page. I went back in and broke up the tables. I still fear
>what will happen if someone drops a lot of text in a textarea .. If I
>were going to do it again I would not use tables like I did. I would
>also look at the config file for the ps2html file to see if there is
>anything I could do there to improve my html output to work better
>with the ps2pdf transition. Also, I did not have to use images ... I
>used forms and it did not translate the "look" of the radio button :)
>so using H:T I used had to do all these if_pdf etc ... because I had
>to create 3 views for the same html forms (user view, an admin
>view, a "view" to be translated to pdf).
>
>So I used :
>
>html2ps (can be found by searching the web)
>ps2pdf (which is just a shell script calling ghostcript with
>parameters)
>
>The following was what I took out of ps2pdf:
>
>> system ("gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite
>> -sOutputFile=$outfile -c save pop -f $ps_file");
>
>
>Here's what I did (note that html2ps is just a perl script but I'm a
>real lazy guy and just used backticks, bad me)
>
>> for my $file (@{$files}) {
>> eval {
>> my $ps = `html2ps "$self->{config}->{path2saved_forms}/$file"`;
>> my $time = time;
>>
>> my $pdf_file;
>> ($pdf_file = $file) =~ s/\.html/\.pdf/;
>>
>> my $outfile = "$self->{config}->{path2saved_forms}/$pdf_file";
>> my $ps_file = "/tmp/$time"."."."ps";
>>
>> open(W,">$ps_file") || die $!;
>> print W $ps;
>> close(W);
>>
>> system ("gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite
>> -sOutputFile=$outfile -c save pop -f $ps_file");
>>
>> unlink($ps_file);
>> };
>> if ($@) {
>> warn "error:create_pdf:$@\n";
>> next;
>> }
>> $count_pdf_files_converted++;
>> ## we don't want to get these AGAIN, let's back them up, if they
>> were converted to PDF
>> $self->backup_html_file($self->{config}->{path2saved_forms},$file);
>>
>> }
>
>
>---------------------------
>"Reality is that which, when you stop believing in it, doesn't go
>away".
> -- Philip K. Dick
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]