680 questions
0
votes
0
answers
79
views
Parsing Word docx file gives "Namespace prefix m on oMath is not defined in Entity" [duplicate]
i am creating laravel project that parsing word doc and docx file into elements in json format. I use phpword library and loading IOFactory::load($path) code. In loading time i get error
DOMDocument::...
1
vote
0
answers
82
views
PhpWord and \n in line together with HTML code
Using PhpWord in my PHP project gives me issues.
I do have a variable containing CR/LF (\n) and HTML code.
Something like:
$str='<div style="font-style: italic; text-align:center">...
0
votes
0
answers
62
views
PHPword images that are in HTML not adding to the word document
I have a template word document with a placeholder that needs to be replaced by HTML code. That HTML code has test wrapped images as well. Ill break down my requirement and the issue below.
...
0
votes
0
answers
23
views
Applying template formatting using PHPWord [duplicate]
I've written a Laravel application that generates content for documents and inserts it into existing Word templates using PHPWord. My desired approach is pretty simple:
I generate the content that I ...
-2
votes
1
answer
48
views
DomPDF Class PreserveText not found
I downloaded and installed the dompdf release http://dompdf_3-0-2.zip/
I am not using composer, so I added this line:
require_once '../dompdf/autoload.inc.php';
Running some sample code:
$phpWord = ...
0
votes
0
answers
59
views
WORD docx dokument created with phpWord not readable by MS Word 2021
I have created a WORD docx document with phpWord. It can be opened and looks ok (just as intended) with LibreOffice (newest version).
I do not have a WORD version myself but a colleague told me it ...
0
votes
1
answer
91
views
PHPWord bracket causes rendered Word document to be un-openable
Using PHPWord, I've managed with this line:
$section->addText('<');
to provoke an Error in Microsoft Word opening the .docx file:
+---------------------------------------------------------------...
0
votes
0
answers
72
views
How to Add Font Styling to Paragraph Style when Creating Word Document in PHPWord
When creating word documents, PHPWord allows for defining custom paragraph styles, which in turn text content can be assigned to. The features that can be defined when creating paragraph styles seem ...
1
vote
0
answers
36
views
Replacing keywords in a DOCX file via PHP
Im trying to do an offline file filler (but they specifically asked for a browser experience so aigth) for a company that does the same paperwork over and over again. they assigned me to do a fairly ...
1
vote
1
answer
137
views
Replace values in a template table with templateProcessor
I have a doc template which contains the following table:
and with php I fill the variable with this line:
$templateProcessor->setValues(array("{key1}" => 59, "{key2}" => ...
0
votes
0
answers
39
views
Displaying the same styling from a word document to vue
I'm using laravel 9, vue 3 and phpoffice/phpword. I've also uploaded a word document which lives in my storage folder and that word document has stylings in it.
What I'm trying to do is display that ...
0
votes
1
answer
651
views
Convert Word File to PDF using PHPWord library
I attempted to convert my Word document to PDF, but the formatting was lost and did not match the original. Specifically, I was converting a certificate from a Word file to PDF, resulting in incorrect ...
0
votes
1
answer
620
views
PhpOffice/PhpWord image wrapping doesn't work
I use PhpWord to generate a .docx file using TemplateProcessor. In the script, I include an image with a statement
$templateProcessor->setImageValue('aName', [
'path' => '/path/to/file',
...
1
vote
1
answer
565
views
Autofit PhpWord table to window
I want to autofit phpword table to window. So, I has add array('unit' => 'pct', 'width' => 5000) when create table. But , the table column show in reversed order in output docx file. I don't ...
0
votes
1
answer
510
views
How to remove border in PhpWord table?
I has create table using phpword. I want set border for specific cell only. For testing, I have create two array style, border=6 and border=0. I set style1 to cell 1 and style2 to cell 2. In word file ...
1
vote
0
answers
159
views
Problem with phpword converting docx to html
I'm attempting to convert a DOCX document to HTML using the PHPWord library. However, during the conversion process, it doesn't include images, backgrounds, headers, or footers. It only retains tables ...
0
votes
1
answer
147
views
Multiple comments.xml files from PhpWord
I am using PhpWord to create a document that contains comments. I can create the file successfully, but when I try to open it, Word reports that it contains unreadable content. Although Word will ...
0
votes
0
answers
87
views
Any way to preserve phpWord placeholders when populating MS word content from MySQL database using php?
I am building a document workflow system (in PHP) which utilises word templates.
I will populate some content (document number, title, issue, and signatures) from a mySQL database. The rest of the ...
1
vote
2
answers
338
views
mkdir(): No such file or directory Error In PhpWord and Laravel 10
Am trying to save a word document using PhpWord 1.0 object Writer within the storage folder in laravel 10 but am getting an exception "mkdir(): No such file or directory". The logic is as ...
0
votes
1
answer
951
views
Convert a docx file to HTML without HTML, HEAD and BODY tags using PhpWord
Hi I am using PhpWord to convert a docx file to a html file. This works well however it contains HTML, HEAD and BODY tags, how do I convert a file without these tags, just the body content.
$...
0
votes
0
answers
293
views
Problems generating a DOCX document from a template with phpWord and then converting it with LibreOffice to PDF on Ubuntu
I have template.docx template with mark ${table} inside. I create document.docx using phpWord and need to convert it to PDF using LibreOffice on Ubuntu. Here is my code
v1 filling table
$...
0
votes
1
answer
137
views
phpword create multiple object link to different sheets in same excel file
I create multiple object which link to different sheets from same excel file using phpword template processor. I have create customized function in template processor.php to create object link to ...
1
vote
0
answers
221
views
Only last page heading added to TOC in phpword
I am creating table of content using phpword from heading 1. I have added 2 heading 1 in different page. The heading 1 on last page only added to table of content in output file.
<?php
...
1
vote
1
answer
1k
views
PHPWord: unable to generate word document file in PHP
I am new to the PHPWord library, and have just now installed it using composer. I want to generate a basic word file. This is my code:
<?php
// (A) LOAD PHPWORD
require "vendor/...
0
votes
1
answer
371
views
Add nested table into word by phpword library and DOM object
I have a Full HTML text which needs to be converted accordingly to phpword and added finally in word.
HTML code is :
$html = '<table style="height:500px;width:600px;"><thead><...