converting DOC to PDF attachments for email2fax via wvPDF

Post your configuration issues while installing ictfax

Re: converting DOC to PDF attachments for email2fax via wvPD

Postby falak » Fri Apr 26, 2013 10:25 am

You are going in the right direction for this feature. This code for conversion of DOC to PDF is taken from older version of ICTFAX 0.3.2 that has been discontinued. Since upgrade to version 2.0, this code block has not been tested. We would expect it to work fine. However, little changes may be required to work it accordingly.

Now let's come to your problem, just curious, have you tried to print your command? Try to print it using the following line.

Code: Select all
echo exec("echo mvPDF-command=$cmd >> /tmp/mytest.txt");


Then see is it what you are executing on your console. Also try copying the command from log and paste on the console and see what happens.
falak
Site Admin
 
Posts: 166
Joined: Tue Jan 17, 2012 7:33 am

Re: converting DOC to PDF attachments for email2fax via wvPD

Postby falak » Fri Apr 26, 2013 10:26 am

Insert this line within the code that you pasted before. For example
Before:
Code: Select all
} elseif (in_array($fileExten, $allowedTypes)) {
echo exec("echo any other file >> /tmp/mytest.txt");
$pdfFilePath = str_replace($allowedTypes, 'pdf', $fileName);
$cmd = ictfax_which('./mvPDF', '/usr/bin') . " $fileName";
exec($cmd);
$cmd = "rm -rf $fileName";
exec($cmd);


After:
Code: Select all
} elseif (in_array($fileExten, $allowedTypes)) {
echo exec("echo any other file >> /tmp/mytest.txt");
$pdfFilePath = str_replace($allowedTypes, 'pdf', $fileName);
$cmd = ictfax_which('./mvPDF', '/usr/bin') . " $fileName";
echo exec("echo mvPDF-command=$cmd >> /tmp/mytest.txt");  // this line is inserted
exec($cmd);
$cmd = "rm -rf $fileName";
exec($cmd);



Now run your test as before. After that go to the mytest.txt log and see what that line prints in the log. This inserted line actually prints the variable $cmd that is the command to convert DOC file to PDF.

For a successful conversion from DOC to PDF, this command must be similar to as you type in the console for conversion.
falak
Site Admin
 
Posts: 166
Joined: Tue Jan 17, 2012 7:33 am

Re: converting DOC to PDF attachments for email2fax via wvPD

Postby falak » Fri Apr 26, 2013 10:27 am

This is strange.
In your log, I see "any other file" line that is in the same code block that we have put our line in. Also I can see "Array ( ) " line that is executed after our inserted line. So the log line in between these two log entries didn't executed. Try removing the log file mytest.txt and test it again. Also check for any fatal error from GUI log at Admin -> Reports -> Recent log messages.

Executing Email2Fax
file extensions from Email2fax: doc
file:/usr/ictfax/sites/default/files/DOCimage1_0.doc
any other file
Array
(
)
falak
Site Admin
 
Posts: 166
Joined: Tue Jan 17, 2012 7:33 am

Re: converting DOC to PDF attachments for email2fax via wvPD

Postby falak » Fri Apr 26, 2013 10:29 am

This is great. I should have told you that FeedsFaxProcessor.inc is custom code by ICTFAX. This actually contains that part of the code which is executed when an email is processed and sent as a fax. So an email document is converted to other extensions in this part of the code.

Nice to hear that it is working now.
falak
Site Admin
 
Posts: 166
Joined: Tue Jan 17, 2012 7:33 am


Return to Configuration

Who is online

Users browsing this forum: No registered users and 2 guests