Since the initial release of LiveDocx last week, one of the most common questions that I keep receiving via e-mail is:
How can I convert DOC to PDF in PHP?
Although it was not the original intention of LiveDocx to offer such file format conversion, it is very possible. In this post, I would like to present a little class, which does exactly that.
In a future version of LiveDocx, there will be an additional component called Zend_Service_LiveDocx_Convert, which will offer a more efficient method of document conversion. When this version is released, it will make redundant the code in this post, but until then, here is a really easy way to convert DOC to PDF in PHP.
Note: You can use this technique to convert between any supported template formats to any supported document formats, not just DOC to PDF.
Step 1: Download Zend Framework
Download Zend Framework 1.10 or newer. All source code mentioned in this post is in the directory /demos/Zend/Service/LiveDocx/MailMerge/convert/.
Step 2: Convert DOC to PDF
In this demo application, we use Zend_Service_LiveDocx_MailMerge to convert document.doc to document.pdf.
In a future version of the LiveDocx service, a converter component will be made available.
Consider the following PHP code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | $mailMerge = new Zend_Service_LiveDocx_MailMerge(); $mailMerge->setUsername('myUsername') ->setPassword('myPassword'); $mailMerge->setLocalTemplate('document.doc'); // necessary as of LiveDocx 1.2 $mailMerge->assign('dummyFieldName', 'dummyFieldValue'); $mailMerge->createDocument(); $document = $mailMerge->retrieveDocument('pdf'); file_put_contents('document.pdf', $document); unset($mailMerge); |
The converted file has been saved at document.pdf.
April 3rd, 2009 at 07:48
hi.. this is awesome, I’m looking for this tools like this for convert my RTF file that was generated from my application. now my application is faster than ever.
Thank U..
April 3rd, 2009 at 10:40
I am glad you like phpLiveDocx and are using it your application.
May I ask: What does your application do? How does it use phpLiveDocx?
May 20th, 2009 at 01:52
Hi,
Thanks a lot for your work!
This stuff is real useful!
July 28th, 2009 at 05:54
Can it conver excel. ppp to PDF?
Away
July 30th, 2009 at 07:29
phpLiveDocx converts and merges word processing file formats only. It does not support PowerPoint, nor Excel.
August 3rd, 2009 at 12:53
Unfortunately, this doesn’t work for me. I have installed Zend framework but when i run test script it simply prints ERROR (Converting document.doc to document.pdf… ERROR).
How can I go deeper into error to see what exactly went wrong?
August 3rd, 2009 at 13:52
I think your web server environment may be the problem. Can I please ask you to refer to this blog post, which describes the “check-environment.php” script:
http://tinyurl.com/mmqdj7
However, to answer your question. Just open up “Converter.php” and replace line 44:
} catch (Tis_Service_LiveDocx_Exception $e) { }
with
} catch (Tis_Service_LiveDocx_Exception $e) {
Zend_Debug::dump($e);
}
That will show you the exception that is being thrown.
August 8th, 2009 at 09:24
I dont have Zend Framework installed. I simply wish to use the code above without Zend Framework. Is that possible??
August 10th, 2009 at 05:44
Hello Rahul. Yes, it is! You can use LiveDocx without the Zend Framework. I will be publishing a brief tutorial showing how in the next few days. However, installing the ZF is no hassle. Regards, Jonathan Maron
August 10th, 2009 at 09:12
Hello again
Please take a look at this article, which shows how to use LiveDocx in PHP without the Zend Framework:
Does this work for you?
Jonathan Maron
August 13th, 2009 at 06:41
[...] phpLiveDocx 1.2, it is possible to generate documents in XHTML 1.0 Transitional. Thus, you can now convert any supported template file format (DOCX, DOC and RTF) to [...]
August 20th, 2009 at 15:15
Warning: file_get_contents() [function.file-get-contents]: Filename cannot be empty in /home/unosoft/public_html/silibi/phplivedocx/library/Tis/Service/LiveDocx/MailMerge.php on line 116
August 20th, 2009 at 16:04
Hello Nadish
Are you sure that your web server has the correct permission to access the file? Did you try ‘chmod 775′?
Can you see the contents of the file?
Did you set the include path as described at http://is.gd/2qff8 ?
Have you run the check-environment.php script, as described at http://is.gd/2qfme ?
Pls post the output into the support forum http://is.gd/2qfqS .
Thank you :-)
Jonathan
August 20th, 2009 at 20:34
Hi Jonathan,
I have a problem. I followed all instructions and by what i can tell i got it to work. When i run my script i get the message:
Converting file.doc to file.pdf…
but nothing else no DONE nor ERROR is printed.
Also the pdf file is not created.
I used just this code you published there.
Thanky you for your answer
August 20th, 2009 at 21:54
I noticed now that i have 2 fails in the check-enviroment script.
2: Checking SAPI (apache2handler)……………………………………FAIL
3: Checking PHP version (5.2.2)……………………………………..FAIL
But for the start …. how does my php 5.2.2 fail ??
August 21st, 2009 at 08:42
Hello Prokvk
Can you please open up “Converter.php” in a text editor and replace:
} catch (Tis_Service_LiveDocx_Exception $e) { }
with
} catch (Tis_Service_LiveDocx_Exception $e) {
Zend_Debug::dump($e);
}
That will show you the exception that is being thrown.
Please post this error here.
August 21st, 2009 at 08:45
Hello Prokvk
Zend recommends the most current release of PHP for critical security and performance enhancements. Zend Framework currently supports PHP 5.2.4 or later. Hence, your version of PHP is too old.
More info here: http://is.gd/2rqCs
September 14th, 2009 at 11:05
Thank you for your response Jonathan .. I got it to work switching to newer version of PHP :)
September 18th, 2009 at 13:53
is it necessary……………….to work on Zend framework to use “phplivedocx”.If not then tell me how can i use phplivedocx in WAMP.
September 18th, 2009 at 15:01
I used this code and found this error ………
#!/usr/bin/php Converting document.doc to document.pdf…
Fatal error: Uncaught exception ‘Tis_Service_LiveDocx_Exception’ with message ‘Cannot connect to LiveDocx service at https://api.livedocx.com/1.2/mailmerge.asmx?WSDL // SOAP extension is not loaded.’ in C:\wamp\www\doc2pdf\phplivedocx\library\Tis\Service\LiveDocx.php:187 Stack trace: #0 C:\wamp\www\doc2pdf\phplivedocx\library\Tis\Service\LiveDocx.php(88): Tis_Service_LiveDocx::throwException(Object(Zend_Soap_Client_Exception), ‘Cannot connect …’) #1 C:\wamp\www\doc2pdf\phplivedocx\library\Tis\Service\LiveDocx\MailMerge.php(83): Tis_Service_LiveDocx->initSoapClient(‘https://api.liv…’) #2 C:\wamp\www\doc2pdf\phplivedocx\samples\Converter.php(38): Tis_Service_LiveDocx_MailMerge->__construct(”, ”) #3 C:\wamp\www\doc2pdf\phplivedocx\samples\mail-merge\convert\convert-document.php(20): Converter::convert(‘C:\wamp\www\doc…’, ‘pdf’) #4 C:\wamp\www\doc2pdf\doc2pdf.php(2): include_once(‘C:\wamp\www\doc…’) #5 {main} thrown in C:\wamp\www\doc2pdf\phplivedocx\library\Tis\Service\LiveDocx.php on line 187
Can u short out the problem…..please.
September 18th, 2009 at 15:07
Hello Akhil
You do not have the SOAP extension in your PHP installation. Please consult the documentation of WAMP or ask your system administrator to find out how to install and activate SOAP in your PHP installation.
Once you have done this, can I please ask you to follow the steps described at http://is.gd/3pJ77 and then post the output of check-environment.php here in the blog.
Thanks
Jonathan Maron
September 18th, 2009 at 15:09
Hello Akhill
You do not have to use the Zend framework to use phpLiveDocx. There are two other methods. Please refer to point 2 and 3 at http://is.gd/3pJm2 .
Thanks
Jonathan Maron
September 21st, 2009 at 15:20
I am using third method, to convert doc to pdf i.e [SOAP connection via PHP 4 and PHP 5 NuSOAP.]
When I run the script ,two PDF files get created and a display on screen is [Starting sample #1 (license-agreement)...DONE. Starting sample #2 (telephone-bill)...DONE.].
But when I open the PDF file ,it shows ERROR MSG: [Format error-not a pdf file or corrupted].
I have done all the setting like enabling SOAP, I have also downloaded the NuSOAP and kept in the same folder in which I have to run the script. PLEASE HELP ME TO SOLVE THE PROBLEM.
My code is same as u have given on ur site, I have only changed the password and user name. U CAN SEE:
[...]
Code taken from http://is.gd/3wK7G
September 21st, 2009 at 15:32
Which PDF viewing problem are you using?
How many bytes are the produced PDF files?
Can you please send me the produced PDF files?
E-Mail them to support @ textcontrol . com and write my name in the e-mail body.
Thanks!
September 21st, 2009 at 15:40
sorry…….i am not able to send the PDF file as it size is showing 0KB. now what i should do.
September 21st, 2009 at 16:13
It seems that you are writing files to disk with no content. I think that the issues you are having are related to NuSOAP. I would suggest that you post a support case in the NuSOAP forum: http://is.gd/3wPKP
September 22nd, 2009 at 07:27
“writing files to disk with no content” Is this problem because i am running the code on localhost?
September 22nd, 2009 at 07:53
No. The problem is that NuSOAP is not getting any data (0 bytes). You are then writing this 0 bytes to the hard disk, hence the resulting PDF files are 0 bytes in size. What did the NuSOAP community say?
September 22nd, 2009 at 09:26
i am not able to find NuSOAP community. Your BLOG is too good , because i am getting the reply very soon.Thanks for this service.
Please see the path setting of my NuSOAP in my php file:-
/////////////////
set_include_path (dirname(__FILE__) . ‘/nusoap-0.7.3/lib’);
/////////////////
my NuSOAP folder name is nusoap-0.7.3 and it is in the same folder from where i am running the script.IS it fine?and give me idea to handle this problem by my self.
September 22nd, 2009 at 09:35
Here is the NuSOAP community – http://is.gd/3wPKP – click on “Help” in the section “Project Forums”. Please post your issue in this forum. The NuSOAP community is specialized in NuSOAP. We are specialized in the Zend Framework component.
September 30th, 2009 at 21:20
This tool was very usefull in a project I´m working.
Thank you!
November 15th, 2009 at 11:17
Hi,
i want to convert pdf/doc to html in a webpage.
Then how to do this in php
Thanks
Ramakrishnant
November 23rd, 2009 at 10:28
Can I convert Doc – > PDF on your phpLiveDocx without the Internet?
Thanks
November 26th, 2009 at 05:39
Hey, I like the ability of this to work.. but I don’t wish to do this with actual files. I was wondering, is it possible to pipe data from a mysql BLOB (that I have files stored in…) and use the converter?
December 8th, 2009 at 11:22
Hello Sir,
It’s very useful for me.
But I have one problem before. I want to convert from html to pdf you have anyway because now I convert html to doc and I will convert doc to pdf.
I weak in English.
If you have way to solution my problem. Please send email to me.
Thank.
December 8th, 2009 at 13:00
@สุขภาพ: Try converting from HTML to internal TX Text Control format (tx) and then to DOC. I know that involves 2 conversions, but there is no other way to do this, using LiveDocx at the moment.
January 8th, 2010 at 14:29
Hi,
I used above code, but i got SOAP-ERROR: Parsing WSDL from http://api.livedocx.com/1.2/mailmerge.asmx?WSDL.
please give me solution.
Thanks.
January 8th, 2010 at 14:59
The WSDL is located at https://api.livedocx.com/1.2/mailmerge.asmx?wsdl
January 9th, 2010 at 08:21
When i executed ‘check-environment.php’ i got 2 fail msg
phpLiveDocx Environment Checker
1: Checking OS (WINNT)……………………………………………..PASS
2: Checking SAPI apache2handler)……………………………………FAIL
3: Checking PHP version (5.2.5)……………………………………..PASS 4: Checking memory limit (32M)………………………………………PASS 5: Checking HTTP stream rapper……………………………………..PASS
6: Checking HTTPS stream rapper…………………………………….FAIL 7: Checking Zend Framework path……………………………………..PASS
8: Checking Zend Framework version (1.9.6)……………………………PASS
9: Checking SOAP extension………………………………………….PASS 10: Checking DOM extension…………………………………………..PASS 11: Checking SimpleXML extension……………………………………..PASS 12: Checking libXML extension………………………………………..PASS 13: Checking your IP address (124.125.46.22)…………………………..PASS 14: Checking your city (Gulbarga)…………………………………….PASS 15: Checking your region (Karnataka)………………………………….PASS 16: Checking your country (India)…………………………………….PASS
January 9th, 2010 at 08:23
Can u give me solution for those above 2 fail msg.
Thanks
January 20th, 2010 at 09:52
thanks. i am ver thank ful. pleas, also keep the .ppxt to .ppt convertor
January 20th, 2010 at 09:55
LiveDocx is all about word processing and word processing formats. Therefore, we currently do not support these file formats.
January 24th, 2010 at 21:36
I’m having some trouble getting started… I can’t find the files. I downloaded Zend framework, but I can’t find them anywhere. Help would be well appreciated.
solow
January 25th, 2010 at 01:13
Hello everybody,
I’m trying to use the example code of converting doc to pdf but I always get :”Fatal error: Class ‘Converter’ not found “. I’ve downloaded the Zend framework and i run successfully the check-environment.php.
It looks like I can’t find the Converter class. Where is it located ?
Could someone help me, please ?
January 25th, 2010 at 06:43
@Solow Go to http://www.zendframework.com/download/latest and download “1.10.0 Full”. Zend_Service_LiveDocx is contained within!
January 25th, 2010 at 06:52
@jeanson You can download Converter.php here: http://pastebin.com/f43bf23ed. However, I have simplified the above post so that it no longer requires the said file :-)
January 25th, 2010 at 07:46
So, Zend 1.9.7 full doesn’t have phpLiveDocx?
January 25th, 2010 at 08:12
Correct! It is only available as of ZF 1.10. You can read the documentation here: http://framework.zend.com/manual/1.10/en/zend.service.livedocx.html
January 25th, 2010 at 10:48
ZendFramework-1.10.0rc1
I downloaded it. I hope I’m not to annoying but, How do I use this? I NEVER used zend before. so I have absolutely no idea what to do. everybody keeps giving me url’s, which don’t make any sence. I just need someone explaining to me what it does exactly, and how to use it. Do I upload ALL files? or just some I use? or… whatever :P
I hope u can do this for me :)
January 27th, 2010 at 08:38
Ah never mind. I installed zend, now I want to use this, to convert my doc to pdf.
couple of questions: What if the file is docx?
How do I convert *now I finally installed zend.*
$phpLiveDocx->setUsername(‘username’)
->setPassword(‘password’);
what is this?
February 15th, 2010 at 13:06
dear Jonathan,
Though I got to like the application, is there a way to have the zend engine stripped off the un-necessary parts [eg currency converter, json etc] just to have base components and the converter, well of course keeping the ease of use as is currently.
March 15th, 2010 at 09:51
hi Jonathan
i am able to use this code on localhost but when i use it on server it says Fatal error: Class ‘Zend_Service_LiveDocx_MailMerge’ not found in..
Plz Help
March 17th, 2010 at 09:20
@Vinay: This is probably because your include path on the server is different from that on your localhost. Update the include path to fix the problem.
March 23rd, 2010 at 14:48
Hello,
In my application , I have a form in which user enter values and at the end of the process we have to generate a pdf so that user can take print out. I am using dompdf html to pdf converter in php. Since the form is rich in images and lots of nested tables it is not working properly. The form html is generated from a ms word file, which is the paper form. Will LiveDocx will help me ? or any other suggestions ?
Thanks
uks
March 31st, 2010 at 15:06
@uks This is exactly a use-case for LiveDocx. To get started, please take a look at the documentation. It contains many sample applications:
http://www.phplivedocx.org/articles/brief-introduction-to-phplivedocx/
http://www.phplivedocx.org/articles/pdf-generation-with-zend-framework/
http://www.zendframework.com/manual/en/zend.service.livedocx.html
July 6th, 2010 at 15:31
Hello plz tell me what is the problem i got this error
Fatal error: Call to undefined method Zend_Locale::setdefault() in C:\xampp\htdocs\Converter\common.php on line 17
Its urgent
August 6th, 2010 at 10:53
can i get script converter php to pdf
August 13th, 2010 at 23:36
I have a little complicated word files with the nested tables inside. The placement of words is messed up in pdf files. I am using free version. Could be better if i use premium package?.
Please
September 7th, 2010 at 15:22
Hi Jonathan,
i’m using zend framework 1.7 and i want to convert doc file to pdf by using livedox. And i’ve downloaded the needed livedox lib files. But i’m getting error like
Call to a member function SetLocalTemplate() on a non-object in C:\xampp\htdocs\opsystem\library\Zend\Service\LiveDocx\MailMerge.php on line 91
Can you tell me how to resolve this issue. If you can tell me bit faster it can be very useful to me.
Thank you.
September 22nd, 2010 at 17:05
[...] so I'd start there, and work your way back. For example, this link… uses LiveDocx 1.2 Convert DOC to PDF in PHP You should find more info if you google LiveDocx. Same with converting images from 2d to 3d. [...]
November 29th, 2010 at 00:49
I am trying to use LiveDocx to convert all the files in a directory from Word to HTML- but the whole server seems to crash after the 6th or 7th file. Any ideas?
December 1st, 2010 at 12:22
@yt It seem that you are using LiveDocx in a batch operation. I sincerely recommend you create a queue, iterate through the queue, catch any exceptions and then replace the active iteration into the queue. After each exception, wait a few seconds. Take a look at this PHP 5.3 code: http://pastebin.com/DrhG82LK
December 28th, 2010 at 07:23
Hi, I’m just trying to get a pdf in the browser but I’m getting a blank response.
I’m calling a zend controller via ajax which have the following code
public function exportpdfAction()
{
$mailMerge = new Zend_Service_LiveDocx_MailMerge();
$mailMerge->setUsername(‘myuser’)
->setPassword(‘mypasswd’);
$mailMerge->SetRemoteTemplate(‘valorar.doc’);
$mailMerge->createDocument();
$document = $mailMerge->retrieveDocument(‘pdf’);
file_put_contents(‘valorar.pdf’, $document);
}
Anybody can tell me what is wrong, why I’m getting a blank response without any warnings or errors.
Thanks so much for the support you can provide me.
Regards
December 28th, 2010 at 07:37
Should the document be stored, or it’s transfered from livedocx to my app ready to be rendered or downloaded?
December 28th, 2010 at 07:48
@Faom
The code that you have posted will correctly generate the document “valorar.pdf”. However, you say you are calling the controller, using AJAX, but yet you write “valorar.pdf” to disk and do not return it to the browser. I believe this is the issue that causes the blank page. Instead, send the binary data returned from retrieveDocument() to the browser, encoded as a JavaScript object.
If, however, you expect the “download file” dialog in the browser to appear, then you want to send the binary data directly to the browser, setting the correct header for a PDF file. Consider the following code:
$this->_helper->viewRenderer->setNoRender();
foreach ($this->getFrontController()->getPlugins() as $plugin) {
$this->getFrontController()->unregisterPlugin($plugin);
}
$this->_response->setHeader(‘Content-Type’, ‘application/pdf’)
->setHeader(‘Content-Length’, strlen($document))
->setHeader(‘Content-Disposition’, ‘attachment;filename=”valorar.pdf”‘);
$this->_response->setBody($document);
Does this solve the issue?
January 8th, 2011 at 09:16
hi,
can you help me with a code in php that can convert TIF Frechscript Images to ms word doc format?
regards
January 27th, 2011 at 12:34
@rahul I am sorry, but I am not familiar with “TIF Frechscript images”. Images in TIFF (tagged image file format) can be inserted into templates or via the API. Can you please clarify, what you mean by “TIF Frechscript images”.
February 9th, 2011 at 06:46
Hi,
I use script at this page: http://www.phplivedocx.org/articles/…end-framework/
my server responded : Starting sample #1 (license-agreement)…DONE.
but, I can’t get document as PDF, where is it ?
March 30th, 2011 at 21:33
Hi I don’t know why, but the first time I can get well the pdf, but after the first time, I can’t get it again, and I’m getting an error> Cannot login into LiveDocx service – username and/or password are invalid. In order to get well again the document I should refresh the whole page. Why this is happening? any comments? The following is the ZF code I’m using>
public function exportpdfAction()
{
$mailMerge = new Zend_Service_LiveDocx_MailMerge();
$mailMerge->setUsername(‘XXX’);
$mailMerge->setPassword(‘XXX’);
$mailMerge->SetLocalTemplate(‘valorar.docx’);
$mailMerge->assign…. /// assign method here
$mailMerge->createDocument();
$document = $mailMerge->retrieveDocument(‘pdf’);
$file=time().’valorar.pdf’;
$this->view->file = $file;
file_put_contents(“cache/”.$file, $document);
}
March 31st, 2011 at 09:34
@FAOM: You may have been suffering some networking issues at your end. Can you please try again? Are you able to reproduce the issue today? The code looks fine to me.
May 7th, 2011 at 15:28
I get Fatal error: Class ‘Zend_Service_LiveDocx_MailMerge’ not found
You say to update the include path. I tried this using set_include_path but it didn’t work. What exactly should be appended to the incluse path please? The zend library is in
/home/xxxx/public_html/zend/library
I appended that, but no joy.
May 17th, 2011 at 07:06
@Richard This is certainly a problem with your include_path and/or autoloader. PHP is unable to find the class. Can you please post all your code?
June 1st, 2011 at 11:33
hey iam new in zend framework and also in web development…….will you please tell me the procedure to use this “doc to pdf” conversions, where me should put my document.doc files in project……because it comes an error on line :$mailMerge->setLocalTemplate(‘document.doc’); for me……..
please tell me asap
many thanx
June 2nd, 2011 at 09:16
We used the Zend phplivedox code and when we check environment we are getting following problem:
2: Checking SAPI apache2handler)……………………………………FAIL
Could you tell me how can we resolve this problem?
June 21st, 2011 at 04:42
Can someone please help me how to resolve this problem. I’m getting the following error:
Fatal error: Class ‘Zend_Service_LiveDocx_Exception’ not found in C:\wamp\library\zendframework\ZendFramework-1.11.7\library\Zend\Service\LiveDocx.php on line 265
Thanks!
June 21st, 2011 at 10:23
@shi Have you set your include_path?
June 25th, 2011 at 08:34
Yes I have set my include_path:
include_path = “.;c:\php\includes;C:\wamp\library\zendframework\ZendFramework-1.11.7\library”
July 7th, 2011 at 16:44
Sometimes the service works, but we often get:
PHP Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host in /home/xxxx/public_html/zend/library/Zend/Soap/Client.php:995
August 12th, 2011 at 07:43
Hi, i would like to use phplivedocx to embed the word documents in my drupal site. So i wish i can use phplivedocx to convert a word document into pdf on the fly and display it in an iframe.
But what about the zend framework part? Do i need to host the Zend framework as part of the drupal files?
October 17th, 2011 at 09:33
That is really helpful.
Thanks :)
November 17th, 2011 at 20:33
In the two following lines of the above PHP code , wich login and password you are talking about:
$mailMerge->setUsername(‘myUsername’)
->setPassword(‘myPassword’);
We tried the login and password of our local windows session and we had the error:
*****
Fatal error: Uncaught exception ‘SoapFault’ with message ‘Server was unable to process request. —> The user name/password combination is not valid.’ in C:\Zend\library\Zend\Soap\Client.php:1121 Stack trace: #0 C:\Zend\library\Zend\Soap\Client.php(1121): SoapClient->__soapCall(‘LogIn’, Array, NULL, NULL, Array) #1 [internal function]: Zend_Soap_Client->__call(‘LogIn’, Array) #2 C:\Zend\library\Zend\Service\LiveDocx.php(256): Zend_Soap_Client->LogIn(Array) #3 C:\Zend\library\Zend\Service\LiveDocx\MailMerge.php(95): Zend_Service_LiveDocx->logIn() #4 C:\wamp\www\testdoc\docWord.php(30): Zend_Service_LiveDocx_MailMerge->setLocalTemplate(‘Word.doc’) #5 {main} Next exception ‘Zend_Service_LiveDocx_Exception’ with message ‘Cannot login into LiveDocx service – username and/or password are invalid’ in C:\Zend\library\Zend\Service\LiveDocx.php:260 Stack trace: #0 C:\Zend\library\Zend\Service\LiveDocx\MailMerge.php(95): Zend_Service_LiveDocx->logIn() #1 C:\wamp\www\testdoc\docWord.php(30): Zend_Service_LiveDocx_MailMerge->setLocal in C:\Zend\library\Zend\Service\LiveDocx.php on line 260
***
Thanks for your help.
November 18th, 2011 at 09:43
First of all, you need to register an account to use LiveDocx. Do this at:
https://www.livedocx.com/user/account_registration.aspx
Once you have your username and password, pass these values to the methods setUsername() and setPassword().Only then will you be able to access LiveDocx.
The error you are getting means that your username and password are not correct.
November 19th, 2011 at 12:18
Thank you very much Jonathan, you’re really helpful, but unfortunately we can ‘t integrate Livedox in our solution (we need to do this operation without to need to connect to internet (locally)), because it requires a rederiction to your website to do the conversion, this requires internet,good luck :)
July 1st, 2012 at 01:02
On my computer, Windows updated itself to Windows 7. How do I change my Word documents from .doc to .docx ?
July 1st, 2012 at 01:03
I currently cannot open my .doc files – any of them.
July 9th, 2012 at 13:36
[...] In regards to codeplex, check out the following. Does it have Microsoft endorsement? PHPExcel – Stable PHPWord -Beta PHPPowerPoint – Alpha In regards to livedocx, I probably meant phplivedocx Convert DOC to PDF in PHP [...]
July 24th, 2012 at 02:02
Hi I seem to be getting a blank document when the file is coming back from being converted and was wondering if you would be able to point me in the right direction. The blank output occurs when trying to convert a file upon upload setting the
$tempFile = $_FILES['file']['tmp_name'];
$docx->setLocalTemplate($tempFile);
Works ok if i manually specify a file location but doesn’t seem to work as above.
Cheers
Nick
October 14th, 2012 at 19:53
I downloaded zend 1.10 then extract it in my local www folder (Wamp) the modify the code as you told
$phpLiveDocx->setUsername(‘XXXXX’)
->setPassword(‘XXXXXXX’);
then run this convert-document.php page I am getting this error -”ERROR: LIVEDOCX USERNAME AND PASSWORD HAVE NOT BEEN SET. 1. Using a web browser, register to use the LiveDocx service at: https://www.livedocx.com/user/account_registration.aspx (takes less than 1 minute). 2. Change directory into: C:\wamp\www\ZendFramework-1.10.0\demos\Zend\Service\LiveDocx 3. Copy configuration.php.dist to configuration.php. 4. Open configuration.php in a text editor and enter the username and password you obtained in step 1 (lines 43 and 44). 5. Save and close configuration.php. Congratulations! You have now set up the Zend_Service_LiveDocx demo applications.”
But my user name and password is working perfectly (I checked it in http://www.livedocx.com)Can u tell me step by step what I have to do..
November 19th, 2012 at 16:53
je cherche une soulution pour mon erreur
je suis entrain d’utiliser le zend framwork pour convertire une fichier .doc en document.pdf
mais toujours il m’affiche cette erreur
Warning: SoapClient::SoapClient(https://api.livedocx.com/1.2/mailmerge.asmx?WSDL) [soapclient.soapclient]: failed to open stream: Permission denied in /home/www/ZendPrivate/library/Zend/Soap/Client/Common.php on line 51
Warning: SoapClient::SoapClient() [soapclient.soapclient]: I/O warning : failed to load external entity “https://api.livedocx.com/1.2/mailmerge.asmx?WSDL” in /home/www/ZendPrivate/library/Zend/Soap/Client/Common.php on line 51
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn’t load from ‘https://api.livedocx.com/1.2/mailmerge.asmx?WSDL’ : failed to load external entity “https://api.livedocx.com/1.2/mailmerge.asmx?WSDL” in /home/www/ZendPrivate/library/Zend/Soap/Client/Common.php:51 Stack trace: #0 /home/www/ZendPrivate/library/Zend/Soap/Client/Common.php(51): SoapClient->SoapClient(‘https://api.liv…’, Array) #1 /home/www/ZendPrivate/library/Zend/Soap/Client.php(1032): Zend_Soap_Client_Common->__construct(Array, ‘https://api.liv…’, Array) #2 /home/www/ZendPrivate/library/Zend/Soap/Client.php(1188): Zend_Soap_Client->_initSoapClientObject() #3 /home/www/ZendPrivate/library/Zend/Soap/Client.php(1112): Zend_Soap_Client->getSoapClient() #4 /home/www/ZendPrivate/library/Zend/Service/LiveDocx.php(256): Zend_Soap_Client->__call(‘LogIn’, Array) #5 /home/www/ZendPrivate/library/Zend/Service/LiveDocx.php(256): Zend_Soap_Client->LogIn(Array) #6 /home/www/ZendPrivate/library/Zend/Service/LiveDocx/MailMerge.php(96): Zen in /home/www/ZendPrivate/library/Zend/Service/LiveDocx.php on line 260
je suis nouveau dans le zend framwork et je ne comprend pas comment corriger cette erreur.
December 12th, 2012 at 04:54
Just wondering whether there might be a tutorial that converts pdf from doc using from-scratch scripts.. zend is nice according to the site mentioned above.. thanks for the guide