1

So far, this code works for me:

$docx = new CreateDocx();

$text = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, ' .
'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut ' .
'enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut' .
'aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit ' .
'in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' .
'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui ' .
'officia deserunt mollit anim id est laborum.';

$paragraphOptions = array(
   'b' => 'on',
   'font' => 'Arial'
);

$docx->addText($text, $paragraphOptions);

$docx->createDocx('template');

I can successfully create a word file...but how can I insert this paragraph from an existing Word Document? Im using PHPDocx Community edition

1 Answer 1

1

To the best of my knowledge with PHPDocx community edition you can not work with existing templates.

The PRO edition let you insert content in an existing Word file but it is not free.

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.