You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Louis Dufresne <ld...@123certification.com> on 2001/12/10 16:51:00 UTC
Working with scalar and htmldoc
Hi there!
I want to make pdf files using htmldoc who convert html files on the server
to pdf and send them to the browser but i can't use static html files. I
build my pages dynamically with embperl and data from a postgreSQL database.
As i saw all i have to do to make it happen is to pre-process 'scalar' to
another cgi that can generate the code and put it in a new html file before
it is send to the client... Am I right or there is a better way to do it? I
can't find any good explanations on how I can grab and work with THE scalar
variable. I know that I could use a cgi who would be happy to generate the
code but now that I have converted all my CGIs in embperl I still try to
find a way not to go backward... I know that I'll have to make a cgi to
manipulate scalar but do I really have to convert the embperl code in my
files that makes my html pages so nicelly for a month now or my cgi could
find a way to handle it, convert and execute the embperl code as it is,
built my files, so I could generate my pdfs and be happy?
My document are processed via embpcgi.cgi.
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Working with scalar and htmldoc
Posted by Gerald Richter <ri...@ecos.de>.
>
> I want to make pdf files using htmldoc who convert html files on the
server
> to pdf and send them to the browser but i can't use static html files.
>....
> My document are processed via embpcgi.cgi.
>
The Execute function allows you to get the result in a scalar.
Take the embpcgi.pl and replace the call to runcgi with the following code:
my %req ;
my $output ;
ScanEnvironment (\%req) ;
$req{'inputfile'} = $ENV{PATH_TRANSLATED} ;
$req{'options'} |= optSendHttpHeader ;
$req{'output'} = \$output ;
$rc = HTML::Embperl::Execute (\%req) ;
After the excute call $output contains the result and you can pipe it thru
htmldoc
Gerald
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org