Forum


Replies: 1   Views: 4848
Trialling free version but no createdocxanddownload method found
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by nickweavers  · 13-03-2013 - 11:05

Hi,

I'm running the example called table.php from the free version and changed the last line from
$docx->createDocx('/tmp/example_table');
to
$docx->createDocxAndDownload('/tmp/example_table');

But my debugger tells me that the method createDocxAndDownload can't be found.

If this method isn't available in the free version, is there a method available that will allow the document data to be echo'ed after
the appropriate php header statements?

eg.

header("Cache-Control: no-cache, must-revalidate" ); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header('Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document');

echo $docx->print();

Or maybe streamed to php's output buffer...

$output = fopen("php://output", "w");
$docx->stream($output); # stream object content to PHP's output buffer
fclose($output);

I have been using Zend's LiveDocX but this looks much better and I'm going to make the switch. Just want to see my generated document downloaded by the browser and inspect it in Word first (seeing is believeing ;) )

TIA,
Nick Weavers