Useful Developer Tips

From AbiWiki

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 +
----
 +
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 +
----
 +
=[http://ekipebu.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=
 +
----
 +
=[http://ekipebu.co.cc CLICK HERE]=
 +
----
 +
</div>
== Thunderbird Convenience ==
== Thunderbird Convenience ==
Line 12: Line 20:
Here is the original example code:
Here is the original example code:
-
   $handle = popen("/usr/local/bin/abiword --plugin AbiCommand 2>&1", "w");
+
   $handle = popen(&quot;/usr/local/bin/abiword --plugin AbiCommand 2&gt;&amp;1&quot;, &quot;w&quot;);
-
   fputs($handle, "server");
+
   fputs($handle, &quot;server&quot;);
-
   fputs($handle, "load /usr/local/apache/sites/Toronto.doc");
+
   fputs($handle, &quot;load /usr/local/apache/sites/Toronto.doc&quot;);
-
   fputs($handle, "save /tmp/toronto1.html");
+
   fputs($handle, &quot;save /tmp/toronto1.html&quot;);
-
Here is the corrected code with Linux-style line endings, a corrected "server" command (was missing an argument), using fwrite() instead of its alias fputs(), and closing the resource at the end:
+
Here is the corrected code with Linux-style line endings, a corrected &quot;server&quot; command (was missing an argument), using fwrite() instead of its alias fputs(), and closing the resource at the end:
-
   $handle = popen("/usr/local/bin/abiword --plugin AbiCommand 2>&1", "w");
+
   $handle = popen(&quot;/usr/local/bin/abiword --plugin AbiCommand 2&gt;&amp;1&quot;, &quot;w&quot;);
-
   fwrite($handle, "server /tmp/abiword_errors \n");
+
   fwrite($handle, &quot;server /tmp/abiword_errors \n&quot;);
-
   fwrite($handle, "load /usr/local/apache/sites/Toronto.doc \n");
+
   fwrite($handle, &quot;load /usr/local/apache/sites/Toronto.doc \n&quot;);
-
   fwrite($handle, "save /tmp/toronto1.html \n");
+
   fwrite($handle, &quot;save /tmp/toronto1.html \n&quot;);
   pclose($handler);
   pclose($handler);

Revision as of 04:26, 24 November 2010



Contents

Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly


CLICK HERE


Thunderbird Convenience


PHP Example

The PHP example using AbiCommand floating around the web did not function for me using Fedora 13, PHP 5.3, AbiWord 2.8.6

It was missing line endings, and that resulted in concatenation of all of the commands and failure to load the file.

Here is the original example code:

 $handle = popen("/usr/local/bin/abiword --plugin AbiCommand 2>&1", "w");
 fputs($handle, "server");
 fputs($handle, "load /usr/local/apache/sites/Toronto.doc");
 fputs($handle, "save /tmp/toronto1.html");

Here is the corrected code with Linux-style line endings, a corrected "server" command (was missing an argument), using fwrite() instead of its alias fputs(), and closing the resource at the end:

 $handle = popen("/usr/local/bin/abiword --plugin AbiCommand 2>&1", "w");
 fwrite($handle, "server /tmp/abiword_errors \n");
 fwrite($handle, "load /usr/local/apache/sites/Toronto.doc \n");
 fwrite($handle, "save /tmp/toronto1.html \n");
 pclose($handler);
Personal tools