PHP with OpenOffice conversion csv to PDF garbled, how to solve?
Open OpenOffice selected good code, can complete the conversion, no garbled, but with PHP is garbled, initially determined that there is no encoding, how to set the code in PHP, PHP codes as follows ....
PHP Code
Bridge_getstruct ("Com.sun.star.beans.PropertyValue"); $oStruct->name = $name; $oStruct->value = $value; return $oStruct;} function Word2pdf ($doc _url, $output _url) {$fdoc _url = "file:///". $doc _url; $foutput _url = "file:///". $output _url; $OSM = new COM ("Com.sun.star.ServiceManager") or Die ("Sure this OpenOffice.org is INSTALLED.N"); $args = Array (Makepropertyvalue ("Hidden", True, $OSM)); $oDesktop = $osm->createinstance ("Com.sun.star.frame.Desktop"); $oWriterDoc = $oDesktop->loadcomponentfromurl ($fdoc _url, "_blank", 0, $args); $export _args = Array (Makepropertyvalue ("FilterName", "Writer_pdf_export", $OSM)); $oWriterDoc->storetourl ($foutput _url, $export _args); $oWriterDoc->close (TRUE);} $output _dir = "f:/comsenzexp/wwwroot/"; $doc _file = "F:/comsenzexp/wwwroot/11.csv"; $pdf _file = "513.pdf"; $output _file = $output _dir. $pdf _file;if (!file_exists ($output _file)) {word2pdf ($doc _file, $output _file);}? >
------Solution--------------------
Aren't you COM? Let's see if Com.sun.star.ServiceManager provides a way to set the encoding.