PHP with OpenOffice conversion csv to PDF garbled, ask how to solve

Source: Internet
Author: User
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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.