Thread

Posted on Tue Jun 20 11:25:41 2006 by alexsulov
How I can send OODoc to the user's Web browser.
My program on PHP now make reports into pdf, but it is difficult to edit them. For me is necessary the possibility to make reports into ODT format. Idea is simple. In openoffice make template with the fields of the type name,date,information. Server fills data on sql query and sends the modified template to user. User obtains the ODT file and by necessity make changes in Open Office. Further prints out document on the printer.
#--------------------------------------------- use OpenOffice::OODoc; my $document = ooDocument(file => "MyFile.odt"); $document->selectElementByContent("name","qwerty"); print "Content-type:application/vnd.oasis.opendocument.text/odt\n"; print "Content-disposition: inline; name=myTEST.odt\n\n"; #??????????????? $document->save("/dev/stdout"); #???????????? #
How I can send $document to the user's Web browser.
Direct Responses: 2516 | Write a response
Posted on Wed Jun 21 00:54:21 2006 by bob in response to 2514
Re: How I can send OODoc to the user's Web browser.
This works in my cgi script:
================================================== my $file="/tmp/a_document.$$.sxw"; my $content = ooDocument(file=> $file,create => 'text',readable_XML=>'on' ); # Add stuff # $content->save(); print "Content-type: application/vnd.oasis.opendocument.text\n\n"; print `cat $file`; ==================================================
If you are working on a windows system, you may need to set up a file type.
Write a response