[pmwiki-users] Using output of action=print (authenticated) to something like htmldoc

Patrick R. Michaud pmichaud at pobox.com
Sun Jul 31 09:53:31 CDT 2005


I've gone ahead and rewritten the generatepdf.php script;
just download a new copy of the script from 
http://www.pmwiki.org/wiki/Cookbook/GeneratePDF 
and follow the instructions.  It now understands authorizations.

One can see the script's results at

    http://www.pmwiki.org/wiki/Cookbook/GeneratePDF?action=pdf

Pm

On Sat, Jul 30, 2005 at 10:42:13PM -0500, Chris Cox wrote:
> Patrick R. Michaud wrote:
> >On Sat, Jul 30, 2005 at 09:35:20PM -0500, Chris Cox wrote:
> >>I need a way of using the print skin output (HTML) as the input
> >>to a program (via markup).
> >>
> >>generatepdf uses print, but via an external call to getting
> >>the page... it (htmldoc) can take input from stdin, so if I could
> >>get the print output (authenticated), I could run that into a slightly
> >>modified generatepdf function.
> >>
> >>Is there a way to get the ouput that would be produced by
> >>action=print for a page with the benefits of being password
> >>authenticated (normal simple password auth)?
> >
> >You should be able to set $action='print'; and then call HandleBrowse.
> >This is the way PmWiki does it, anyway.
> >
> >If I knew a little bit more about how generatepdf works we could
> >probably fix this...
> >
> 
> It's pretty simple.. by using a shell_exec the htmldoc pulls in the
> page with an action=print, but obviously isn't authenticated (no
> session):
> 
> function HandlePDF($pagename) {
>   global $PDF_Location, $PDF_Url_Location, $Htmldoc_Location;
>   $filename_to_write = $PDF_Location . $pagename . '.pdf';
>   $url = $PDF_Url_Location . $pagename . '.pdf';
>   $output = shell_exec($Htmldoc_Location . ' -f ' . $filename_to_write .
>     ' --webpage http://localhost/pmwiki/pmwiki.php?n=' . $pagename . 
> '?action=print');
>   header("Refresh: 0; URL=" . $url);
> }
> 
> #
> # This function overrides the $HandleActions variable array in pmwiki.php
> #
> $HandleActions['pdf'] = 'HandlePDF';
> 
> 
> 
> 
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://host.pmichaud.com/mailman/listinfo/pmwiki-users
> 




More information about the pmwiki-users mailing list