We know
Example of PHP handling Word to PDF code:
- < ? PHP
- Set_time_limit (0);
- function Makepropertyvalue ($name, $value, $OSM) {
- $ ostruct = $OSM- > bridge_getstruct
("Com.sun.star.beans.PropertyValue");
- $oStruct- > Name = $name;
- $oStruct- > Value = $value;
- return $oStruct;
- }
- function Word2pdf ($doc _url, $output _url) {
- $ OSM = New COM ("Com.sun.star.ServiceManager")
Or Die ("sure is a OpenOffice.org
is INSTALLED.N ");
- $ args = Array (Makepropertyvalue ("Hidden", True, $osm));
- $ Odesktop = $OSM- > CreateInstance ("Com.sun.star
. Frame. Desktop ");
- $ Owriterdoc = $oDesktop- > Loadcomponentfromurl
($doc _url, "_blank", 0, $args);
- $ Export_args = Array (Makepropertyvalue
("FilterName", "Writer_pdf_export", $OSM));
- $oWriterDoc- > Storetourl ($output _url, $export _args);
- $oWriterDoc- > Close (true);
- }
- $ Output_dir = "d:/lighttpd/htdocs/" ;
- $ Doc_file = "D:/lighttpd/htdocs/2.doc" ;
- $ Pdf_file = "2.pdf" ;
- $ output_file = $output _dir. $pdf _file;
- $ Doc_file = "file:///" . $doc _file;
- $ output_file = "file:///" . $output _file;
- Word2pdf ($doc _file, $output _file);
- ?>
The above code is the way PHP handles word to PDF implementation.
http://www.bkjia.com/PHPjc/445962.html www.bkjia.com true http://www.bkjia.com/PHPjc/445962.html techarticle we know that PHP handles word to PDF code example: PHP set_time_limit (0); Functionmakepropertyvalue ($name, $value, $OSM) {$ ostruct = $osm- Bridge_getstruct (Com.sun.star.beans.Prope ...