[pmwiki-users] Implementing download to MS Word

Waylan Limberg waylan at gmail.com
Fri Oct 28 15:07:23 CDT 2005


On 10/28/05, Powell, Terry N <tpowe1 at uis.edu> wrote:
>
>
> I'm new to pmwiki, but I'd like to implement an action like 'print' that
> will output the proper headers so the page gets downloaded to MS Word.
>
> I changed the print.php by adding:
>
> $HTTPHeaders = array(
>   "Expires: Tue, 01 Jan 2002 00:00:00 GMT",
>   "Cache-Control: no-store, no-cache, must-revalidate",
>   "Content-type: application/msword",
>   "Content-Disposition: attachment; filename=$pagename.doc");
>
> I also stripped down print.tmpl so I get a pretty clean looking Word
> document.
>
> However, I'd really like to implement this as add on functionality rather
> than butchering the print action.
>
> Can anyone give me some pointers on this (maybe sample code)?
>
I'm not sure if its the case here, but oftentimes PmWiki calls
functions from an array of function names. Just write your own
function and overwrite the array to point to your new function.

Alternately, you may want to see how the PDFPublish recipe does it.
That may give you a few ideas.


--
----
Waylan Limberg
waylan at gmail.com




More information about the pmwiki-users mailing list