Answer the question
In order to leave comments, you need to log in
PHP convert exel to pdf, help find error in code?
Hello, the task is simple and trivial, there are examples, and even here on Habré I found a post about it. But these 7 lines of code don't work all the time.
$word = new COM('word.application');
$word->Visible = 0;
$word->Documents->Open(APPLICATION_DOCNZ_FOLDER.'\oblachnye.docx');
$word->Documents[1]->SaveAs(APPLICATION_DOCNZ_FOLDER.'\oblachnye.pdf',17);
$word->Quit('0','0','0');
$word = null;
$this->render('docnz');
At first, the function worked, but soon it began throwing “com_exeption” errors without specifying what it didn’t like. As it turned out, a lot of word.exe opened and they were not going to close, I decided to postpone the closing problem for later and killed it with my hands.
The function made two conversions and again everything went wrong. This time it causes apache to hang, that is, when you enter a page with this code, the server stops responding to any requests until it is restarted.
Answer the question
In order to leave comments, you need to log in
I've come across C PHP for a very long time... isn't it necessary to escape the slash there?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question