Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • 09:25
    hazington closed #2231
  • 09:25
    hazington commented #2231
  • 09:25
    hazington closed #2230
  • 09:25
    hazington commented #2230
  • May 27 12:11
    sawirricardo labeled #2234
  • May 27 12:11
    sawirricardo opened #2234
  • May 27 05:17
    sirfragalot commented #2232
  • May 27 00:38
    lizhixiong1991 commented #2200
  • May 26 20:07
    wube1 commented #2232
  • May 26 14:13
    velPL opened #2233
  • May 24 16:48
    VITEK-THE-BEST commented #1909
  • May 23 10:01
    sirfragalot edited #2232
  • May 23 07:44
    sirfragalot opened #2232
  • May 23 07:44
    sirfragalot labeled #2232
  • May 20 17:51
    tarnawski commented #2216
  • May 20 14:44
    hazington opened #2231
  • May 20 14:37
    hazington opened #2230
  • May 20 07:51
    fd6130 commented #2194
  • May 20 07:49
    fd6130 commented #2226
  • May 19 13:59
    daniser labeled #2229
is there any way to count the number of lines left before inserting another item
Hi everyone !
Did anyone give a try to the SO thread about replacing pictures in templates ?
I'm able to replace the picture, but the one I insert is duplicated
Sun Chen
@pascaldls $textrun = $section->addTextRun();$textrun->addText('superscript', array('superScript' => true)); $textrun->addText(' and ');$textrun->addText('subscript', array('subScript' => true));
@Wats0ns PHPOffice/PHPWord#1084
Sun Chen
PHPOffice/PHPWord#1201 is anybody there?
HI All, I'm trying to use password protection for docx, i'm using sample code "https://github.com/PHPOffice/PHPWord/blob/develop/samples/Sample_38_Protection.php" it's not working. Is any changes required in sample code.
I have a code here and I can not join the session of the table with the session that generates the file word someone has a tip?
Augusto César Ribeiro
Hello! Does anybody knows how to get the character count of a .doc file? I've already loaded the file using a code found in one of the samples.
$phpWord = \PhpOffice\PhpWord\IOFactory::load($source);
Hi there, these anyone knows python and PHPWord to add some features on python-docx plugin? Thanks you!
Hello, is there a simple way to add a new let's say ListItemRun between 2 existing ones?
hey, does anyone know how to include https://github.com/PHPOffice/PhpSpreadsheet library to my code,thank you
I am trying to pull elements out of a table, I have been able to do that for most cells but if a cell had (or has) a spell checking error or grammar error the "getText" method fails to get anything after the spell checking/grammar error. Anyone know how I can get the whole contents of the cell? I have tried setHideGrammaticalErrors and setHideSpellingErrors on the document before going through the elements and that doesn't help
disregard the above question, I was able to figure it out. Had to loop through the getElements to find all the instances of text.
Hi! I am trying to download the PHPWord master branch from github, but I only get the src directory. How can I get all the other directories. Mostly I need the samples directory.
hi. Is there any chance to use the characters < and > in a $section->addText() ?? Whenever I try this the document will not be recognized as a valid .docx document by Word and by TextMaker.
ok, solved: \PhpOffice\PhpWord\Settings\Settings::setOutputEscapingEnabled(true);
Bhatt Nishant

Hello, I'm trying to generate pdf from .docx, however, some style could not be set also most important table data doesnot show inside pdf. it generate blank table.

I use following code

use PhpOffice\PhpWord\IOFactory;
use PhpOffice\PhpWord\PhpWord;
use PhpOffice\PhpWord\TemplateProcessor;

        $fileName = base_path('templates').'/'.'FINAL Desk.docx';
        $newFilePdf = base_path('templates').'/'.'final_'.time().'.pdf';


        $phpWord = IOFactory::load($fileName, 'Word2007');
        $phpWord->save($newFilePdf , 'PDF');
Adrien Crivelli
@troosan, Progi1984 is about to release PhpPresentation 1.0.0 according to https://gitter.im/PHPOffice/PHPPresentation?at=5d00f03c049bf9263c59c406. I strongly encourage you to do the same with PHPWord as it's now been 5 years since first release and the current state of the project seems stable enough to be reflected in a proper 1.0.0 version
Jorge Sapena
Hi all
I'm using the dev-develop version of this library because I need "setComplexValue" method. I've seen that the generated file cannot be opened on windows. I think it's related with that method.
Any idea about it? I've tried escaping characters and so on, but at the end seems to be more related with the addition of tables on the templateProcessor
Jorge Sapena
Hi @PowerKiKi, I've been checking the document.xml, seems that somehow setComplexValue using a table element is creating a no-compliant xml. Any idea/feedback? Thanks in advance
Adrien Crivelli
@jorge_s_b_twitter unfortunately I cannot help you with that. I don't know much about this lib
Hi! I want to modify a document '.docx' following the submission of a form.
But I can't get my POST data in the modifyDoc() method. Can you help me please?
alguien que haya modificado el tamaño del pdf porque me quita el enmarcado del word
@Jeremyzarra Please speak english. You will have more answers
I'm having an issue with the PHPWord library fails to open a .doc file. Is it just impossible to do this on unix? Seems like the error is related to a microsoft library for reading the fonts within a doc file.
error: https://gist.github.com/Acen/1ba81979a10b336fe548f575653ef54d
@Acen You can open an issue on PhpWord repository and add a sample file, please :)
guys, is there any way to make img tag works for html convertion to docx without the need of the closing bracket?
this works <img src="logo.png" alt="" height="42" width="42" /> but this does not work <img src="logo.png" alt="" height="42" width="42" >
the issue is that I need to use jquery .html to retrieve the content and it removes the "/" by default.
I wonder if I can use php tidy to fix ç.ç.
how can i add column break in phpword ??

is there any way to count the number of lines left before inserting another item

@pascaldls have u got any solutions

I am using phpword to convert a doc file loaded from source to pdf but all design header footer and charts images not converted to pdf
what shouuild i try
@woganmay @Attu123
I am using phpword to convert a doc file loaded from source to pdf but all design header footer and charts images not converted to pdf
what shouuild i try
$phpWord->addFontStyle seems to be ignored. I'm using the example on the github page.
Am I missing something obvious? I can't figure it out
Edvin Hultberg
Hello, I have a question. I've been working with the TemplateProcessor and noticed that the word document is created in and downloaded from Microsoft Office.com has no "word/document.xml" file, but its located at "word/document2.xml". Has anyone experienced this before? I noticed that inside "[Content types].xml" there is a tag "Override" referencing the document2.xml file.
<Override PartName="/word/document2.xml" ContentType="application/vnd.openxmlformats-officedocument.wo rdprocessingml.document.main+xml" />
Edvin Hultberg
I ended up with some an overrode of TemplateProcessor::getMainPartName() which looks for any override in Content_Types file
I need to create conventions from the data of a form. Is it possible to take a static model of the convention and insert the information of the form in order to generate a new convention????
if so how can I do it please?
Parijit Kedia
borderStyle for table cell property doesnt work. For some reason the table is not getting rendered. Any reason for that?
Parijit Kedia
is there a way to know that you are rendering the last page of the document
Parijit Kedia
Is there a way to set different column width in section
Hy, i would like to know if is possible to add html code with TemplatingProcessor .
Parijit Kedia
is there an option for the checkbox called straight quote with smart quote