I am having an error in my PHP code and I need help. If anyone knows the solution to this issue, please help me. The error message I am seeing is [Fatal error: Uncaught BadMethodCallException: Method createtemplate is not defined. in C:xampphtdocsphpvendorphpofficephpwordsrcPhpWordPhpWord.php:148 Stack trace: #0 C:xampphtdocsphpindex1.php(10): PhpOfficePhpWordPhpWord->__call(‘createtemplate’, Array) #1 {main} thrown in C:xampphtdocsphpvendorphpofficephpwordsrcPhpWordPhpWord.php on line 148]. This is my code
Tag: phpword
How to copy styles from generated file to target file
How to copy styles and numbering from generated file to target file Generated file image. In generated file bullet points are working fine when merge this to the target file getting issue Target file. The target file was copy of tempalte and a empty file. I assumed due to no numbering.xml it does not showing the bullets as bullets if
How to set visibility of table row in PHP Office Word TemplateProcessor
I would like to conditionally display table row in predefined Ms Office Word file. The solution I am using currently only allows to manage display of whole block and so on the whole tables according to different combination of displayed data. I find this solution obscure. This is why I need conditionally display table row. Current solution works with: $$nameofdesiredkey
Make word bold with setValue in PHPWord
How to make the replaced word bold and underline when using TemplateProcessor in PHPWord? Found solutions are very old (2016). I tried to create my function, to edit xml document, but done file is crashing. My code: Tried this function: Answer
PHPOffice/PHPWord – How to setup paper size with landscape orientation
I did follow this post: How to change paper size in PHPWord It will create file with Letter paper and Portrait layout I change to this: It generated file with Landscape layout but is A4 paper size. How to generate file with Letter size + Landscape layout? Thank you! Answer Insert the orientation key in the array with width and
PhpWord output doesn’t work in LibreOffice but works fine in MS Word
This relates to a semi-known issue listed on the GitHub page [link], where the way PhpWord generates tables causes it to set the cell width to “”, which isn’t valid in LibreOffice, but is fine in Word. The issue on GitHub lists html-to-word conversion specifically, but I’m getting this issue when just going by the regular object-oriented interface also. I’ve
PHPWord not saving file in /tmp directory
I am trying to run PHPWord’s basic example in here on my Mac. I am using XAMPP as app server. I only changed the require_once part and added sys_get_temp_dir() in front of the file name because of the “ZipArchive::close(): Failure to create temporary file: Permission denied” error as same as in this question. My index.php file is as follows: However
How to stretch the footer to the full width of the page using phpword?
I use PHPWord to generate a document. How can I remove the indent on the left side for the footer, so that it occupies the entire width? For header, I use: but for footer it doesn’t work. And the second question, is it possible to put text on top of the image in the footer using phpword? Answer I solved
How to add/set images on PHPOffice/PHPWord Template?
I have an instance of a template on PHPWord. Is it possible to replace or add an image? Something like a setImageValue? $phpWord = new PhpOfficePhpWordTemplate(‘a.docx’); $phpWord->…