1

I've currently got

$phpWord = \PhpOffice\PhpWord\IOFactory::load($word_file);
$htmlWriter = new \PhpOffice\PhpWord\Writer\HTML($phpWord);

Where $word_file is the location of the word document. What I want to do is output the HTML to the screen, not save it to a file. I can't seem to find any documentation on anything except htmlWriter->save(); My question is, how would I simply output the HTML vs Saving it to a file?

Thanks in advance for any help!

1 Answer 1

1

Okay, so I figured it out. I need to use $htmlWriter->getContent();

Hope this helps someone else!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.