Web programming tools (PDF)
jbv
jbv.silences at club-internet.fr
Wed May 7 13:56:00 EDT 2003
> Great, so how about you post your code?
>
> Be delighted to see it.
>
Well, it's part of a more complex machinery I did for
a client and their intranet; so posting the code is a bit
touchy, although I can explain the basic approach,
which rather simple.
JS & DHTML are used within the HTML form to
enable/disable some parts, and also to calculate different
values according to data users enter in fields.
All fields & buttons are part of a regular form with a POST
method. The only thing is that a JS function changes the
form.target property on the fly (when users click the Submit button)
so that the result of the CGI script is directed to a different window.
As for the CGI script : all values are parsed like with any form;
then the script opens a PDF template and uses the REPLACE
function to replace various keywords by values entered by
users.
Basically, PDF is (a bit) similar to HTML : different tags used
to position various text content on the page. Most of the time,
the layout is done in advance, hence the use of a template.
But of course, generating different layouts by script is also
possible; it only requires more programer's time.
For the same project I've also written a script that process a
flat data base (data about ppl structured with tab/return, and
compiled from HTML forms) and outputs a serie of PDF files
with complex layout (also including jpg photos that users
have uploaded with the form).
The funny thing about this is that I first asked 2 trainees in
our company to do that in PHP. After 2 days of trials, they
finally gave up. MC allowed me to complete the task in 2.5 hours.
JB
More information about the metacard
mailing list