Hi Thomas,

why not implementing the follwoing steps.

1) create tmp file.
2) convert to tmp file
3) if everything worked fine reading file, setting appropriate headers and 
print content and afterwards delete tmp file.
4) if something went wrong you can send an error page with appropriate headers 
and code.

I would avoid messing around with STDOUT.

Best regards
Andreas



> -----Ursprüngliche Nachricht-----
> Von: Thomas Kenyon <t...@polybond.co.uk>
> Gesendet: Montag, 23. September 2019 14:52
> An: modperl@perl.apache.org
> Betreff: STDOUT Problem migrating a site to mod_perl
> 
> I have run into an odd problem when migrating a site to use mod_perl.
> 
> The script in question, builds some postscript into a variable, then
> uses psconvert (from Postscript::Convert) to change that into a png and
> sends that back to the webserver. (headers are set up earlier in the
> script).
> 
> This seems to work well with mod_cgi but doesn't work with mod_perl
> using either ModPerl::Registry or ModPerl::PerlRun.
> 
> Annoyingly psconvert doesn't return the converted image, instead it
> dumps it to a file (or stdout).
> 
> I have tried to re-implement this using GSAPI, but GSAPI doesn't seem to
> build on any of my machines. (all debian 9/10 based).
> 
>      use PostScript::Convert;
>      psconvert(\$ps, '%stdout%' , format => 'png', resolution => '72',
> paper_size => '6.5x4');
> 
> I've searched through as much documentation as I can find, and tried
> various things, but none seem to work.
> 
> TIA for any guidance.


Reply via email to