680 questions
1
vote
3
answers
180
views
firstLine indentation not working with PHPWord
I'm trying to apply firstLine indentation to a paragraph but it's not working. Below is my code:
$phpWord = new \PhpOffice\PhpWord\PhpWord();
$section = $phpWord->addSection();
$fontStyle = array(...
1
vote
1
answer
93
views
PhpWord generates paragraph breaks in addhtml
I am using PHPWord from within PHP to generate a word docment. I do use addHtml to transform some Mysql text containing multiple lines into a Word paragraph.
My input text contains:
<pre>
Lorem ...
1
vote
0
answers
87
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">...
1
vote
2
answers
136
views
How to Replace DOCX Placeholder with Formatted HTML in PHPWord where data came from the HubSpot?
I'm using the PHPWord package in Laravel to replace placeholders in a DOCX template.
I have a placeholder ${html} in my DOCX file, and I'm trying to replace it with HTML content like:
<p>Hello,&...
0
votes
0
answers
71
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
40
views
phpWord make Table of Contents text different from section titles text?
In phpWord, I would like to modify the text that appears on the Table of Contents to be different from what appears in the individual section titles.
// Add title styles
$phpWord->addTitleStyle(1,[]...
0
votes
0
answers
24
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 ...
0
votes
0
answers
241
views
Formatting with PHPWord's Template Processor
I'm writing code that inserts sections of content into a pre-defined Word template using PHPWord. I put tags like ${INTRODUCTION} in my template, and then I use the Template Processors's setValue ...
-2
votes
1
answer
49
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
23
views
Addimage() creates unwanted text line in PhPWord
Using this code with PhPWord, the addImage() function seems to inject a line break.
$Format['width']=36;
$Format['height']=36;
$Format['wrappingStyle']='square';
$Format['positioning']='absolute';
$...
0
votes
0
answers
62
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 ...
-1
votes
1
answer
70
views
How using phpword delete personal data left in word template when generate file?
When generating a file from a word template, is it possible to delete personal data left in the template? For example, the author's name.
I checked if the author's name is left in the template, in the ...
0
votes
1
answer
96
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:
+---------------------------------------------------------------...
1
vote
1
answer
178
views
The image showing in docx file is not visible in pdf when converted using unoconv
The image showing in docx file is not visible in pdf when converted using unoconv where the image is displayed using
$document = new \PhpOffice\PhpWord1\TemplateProcessor($docx_temp_file_path);
$...
0
votes
0
answers
79
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 ...