Question

I am trying to convert word(doc, docx) document to pdf but its not happening.... I have used

<?php 
    $oLoader = new COM("easyPDF.Loader.6"); 
    try
    {
       $oPrinter = $oLoader->LoadObject("easyPDF.Printer.6");
       $oPrintJob = $oPrinter->PrintJob;
       $oPrintJob->PrintOut("F:\wamp\www\index\q.docx", "F:\wamp\www\index\q.pdf");
       print "Success";
    }

    catch(com_exception $e)
    {
      print "error code".$e->getcode(). "\n";
      print $e->getMessage(); 
    }
?> 

this code but its returning error like

Fatal error: Uncaught exception 'com_exception' with message 'Failed to create COM object `easyPDF.Loader.6' in F:\wamp\www\index\index.php on line 2

com_exception: Failed to create COM object `easyPDF.Loader.6': Invalid syntax in F:\wamp\www\index\index.php on line 2

please help me in this

Was it helpful?

Solution

Have a look at your event log, it should have more detailed information. Most likely your web server is not logged in as the "correct user":

http://www.pdfonline.com/easypdf/sdk/usermanual/running_on_server/printer_sdk/about_loader.htm

OTHER TIPS

I used libreoffice, unoconv and PHP-unoconv

You can install libreoffice from here MAC http://mirrors.adams.edu/LibreOffice/mac/LibreOffice_4.3.7_MacOS_x86-64.dmg

Ubuntu: sudo apt-get install -y libreoffice libreoffice-script-provider-python uno-libs3 python3-uno python3

for unoconv: Mac: brew install unoconv --HEAD

Ubuntu: sudo apt-get install unoconv

then you can use:

https://github.com/alchemy-fr/PHP-Unoconv

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top