phpLiveDocx on "Zend Core for i5"

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Apas
Forum Newbie
Posts: 7
Joined: Thu Apr 03, 2008 1:08 am
Location: Bochum, Germany
Contact:

phpLiveDocx on "Zend Core for i5"

Post by Apas »

Hi,

I want to use phpLiveDocx http://www.phplivedocx.org/ to convert an RTF file to pdf.
After installing the system I tried to modify the includes converter sample to run as a webside:

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
                  "http://www.w3.org/TR/html4/loose.dtd">
        <meta http-equiv="content-language" content="de">
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <HTML>
        <head>
        <title>PDF Dokument erzeugen</title>
        </head>
        <body>
 
<?php
 
require_once dirname(__FILE__) . '/../../common.php';
require_once 'Converter.php';
 
 
// -----------------------------------------------------------------------------
 
$filename = 'document.doc';  // file to convert
$format   = 'pdf';           // format to which to convert
 
// -----------------------------------------------------------------------------
 
$targetFilename = Converter::getFilename($filename, $format);
 
echo 'Converting %s to %s... ', $filename, $targetFilename;
 
$targetDocument = Converter::convert($filename, $format);
 
if (false !== $targetDocument) {
    file_put_contents($targetFilename, $targetDocument);
    print("DONE.\n");
} else {
    print("ERROR.\n");
}
 
?>
</body>
</html>
When I "start" the skript it runs some seconds and the the browser wants me to Save the convert-document2.php Skript instead of displaying it. Other PHP-Skripts run without problems. If I remove the line with

Code: Select all

$targetDocument = Converter::convert($filename, $format);
the skript runs normal (with output in the browser window), but (as expected) don't convert anything.
Does anybody has an idea what the problem could be here?
The PHP-errorlog doesn't show anything.
I also tried the telephone bill sample in the same way, but it doesn't do anything.....

Thanks for any ideas....

Greetings
Thorsten
Post Reply