Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 13 01:01
    FireworksWebsites synchronize #1780
  • Dec 13 00:35
    FireworksWebsites opened #1780
  • Dec 12 23:48
    DanielTurner commented #1779
  • Dec 11 17:08
    tomlp commented #1779
  • Dec 11 16:55
    tomlp labeled #1779
  • Dec 11 16:55
    tomlp opened #1779
  • Dec 11 16:09
    oleibman commented #1774
  • Dec 11 15:02
    r00ts3ctors edited #1778
  • Dec 11 14:59
    r00ts3ctors labeled #1778
  • Dec 11 14:59
    r00ts3ctors opened #1778
  • Dec 11 14:29
    g4rf commented #902
  • Dec 11 14:26
    g4rf commented #902
  • Dec 11 14:25
    g4rf commented #902
  • Dec 11 14:24
    g4rf commented #902
  • Dec 11 14:14
    g4rf commented #902
  • Dec 10 06:17
    1598665020 opened #1777
  • Dec 09 22:14
    coveralls commented #1774
  • Dec 09 21:56
    troosan synchronize #1774
  • Dec 09 20:36
    coveralls commented #1775
  • Dec 09 20:22
    troosan commented #1775
phpdave
@phpdave

I see in the docs

width. Table width in percent.

but I'd rather do

 $table->setWidth(Converter::inchToTwip(7));

then

$table->setWidth(5200);
yea 5000 is my 100%... and 5200 is 104% which doesn't make sense to me
phpdave
@phpdave
Any recommendations on how best to get issues looked at or help? I know what needs to get changed but not sure how the classes are structured so its hard to figure out what classes to modify.
Looking to solve this issue PHPOffice/PHPWord#957 and this issue PHPOffice/PHPWord#956 currenty
kunjan21
@kunjan21
hi, I have a PDF file. Is it posible to convert it into word or docx file by PHPWord??
José Luis Duque Gordillo
@Dapsang

@Progi1984 Hey, we are trying to use PHPWord in a new project but we aren't having much success. The sample is currently not working as expected. Do you have any pointers or are you already working in a hot fix? issue in question: PHPOffice/PHPWord#970

We also noticed that the columns are not working and a lot of styles aren't recognized

Robert Burnham
@burnhamrobertp
Does PHPOffice (specifically PHPWord and PHPExcel) support PHP 7+ ?
sahil
@sahil-github
Does PHPWord support inline css and style using addHtml() function. i am fetching the data from database and making html template and then trying to write word docx by using addHtml but some elements are not write properly. is there any solution for this issue? Please reply.
phpdave
@phpdave
@sahil-github probably not, you'll most likely have to inject it by modifying https://github.com/PHPOffice/PHPWord/blob/c71069022e07d768ec69a5e43e3b6f1fa4a95e84/src/PhpWord/Shared/Html.php
sahil
@sahil-github

@phpdave Thanks for Reply.
But i noticed that span tag is not working properly inside any other tag like heading tag, paragraph tag and list tag in addHtml() case.
Below is the the code i am fetching from database after replacing template {keywords}. Even Heading tags are also not working for writing doc file. if there is any span tag inside li tag then li content is not printing in word file.

<h1><span style="text-decoration: underline;">LME Copper 3 Month Forward - 2017-01-24 06:30:00 Contract</span></h1>

<p class="MsoNormal" style="font-size: 12.16px;">Furthermore, <span style="font-size: 12.16px;">the mid-January push above a key resistance at 2210, neutralised the bearish intermediate-term trend, shifting the intermediate term outlook to neutral.</span></p>

<ul>
<li>We see an upside bias for 1873; break here aims maybe up to 1900/1910.</li>
<li>But below 1841 opens risk down to <span style="font-size: 12.16px;">1811</span>.</li>
</ul>

Please help me to sort out these issues.

phpdave
@phpdave
Hi sahil like I said before you'll probably have to inject this in a raw format or modify phpword to do what you want it to do. PHPWord is not in a 1.0 release so I wouldn't expect it to work perfectly.
I really only know about the graphing functionality of phpword.
sahil
@sahil-github
Thanks for reply.
sahil
@sahil-github
i'll try to find some other ways to sort out this issue.
phpdave
@phpdave
Good luck!
Stephen Morley
@rowantree
I'm getting an error in the created document: Illegal name character in word/document.xml. When I look there I see an &. I called htmlentities on the string before I pass into phpword and now i'm getting "Undeclare entity" and its pointing to ’. What am I getting wrong here?
Stephen Morley
@rowantree
Is there some proper way to get non-standard characters processed? Most of these originated from people pasting word text into my web app which then placed the data in the database. They are a serious issue as I can't even export/import the database and keep the characters intact. But many of these are messing up the constructed word document. Many went away when I htmlentities() and then converted them to 'normal' characters but there a lots more.
sdclub
@wk1025
Invalid style value: japaneseCounting Options:bullet,decimal,upperRoman,lowerRoman,upperLetter,lowerLetter
pascaldls
@pascaldls
hi is there any way to keeps lines together and page break if not
pascaldls
@pascaldls
is there any way to count the number of lines left before inserting another item
Wats0ns
@Wats0ns
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
@sunchenweb
@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
@sunchenweb
PHPOffice/PHPWord#1201 is anybody there?
Arun
@arunsraga
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.
Fe-souza
@Fe-souza
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
@cesaribeiro
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);
Ghost
@ghost~552053f715522ed4b3de5c59
Hi there, these anyone knows python and PHPWord to add some features on python-docx plugin? Thanks you!
George
@georgeenciu
Hello, is there a simple way to add a new let's say ListItemRun between 2 existing ones?
AlexanderChoudhury
@AlexanderChoudhury
hey, does anyone know how to include https://github.com/PHPOffice/PhpSpreadsheet library to my code,thank you
owentl
@owentl
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
owentl
@owentl
disregard the above question, I was able to figure it out. Had to loop through the getElements to find all the instances of text.
szekelygobe
@szekelygobe
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.
tdahh
@tdahh
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.
tdahh
@tdahh
ok, solved: \PhpOffice\PhpWord\Settings\Settings::setOutputEscapingEnabled(true);
Bhatt Nishant
@bhattnishant

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';


        Settings::setPdfRendererName('dompdf');
        Settings::setPdfRendererPath('.');

        $phpWord = IOFactory::load($fileName, 'Word2007');
        $phpWord->save($newFilePdf , 'PDF');
Adrien Crivelli
@PowerKiKi
@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
@jorge_s_b_twitter
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
@jorge_s_b_twitter
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
@PowerKiKi
@jorge_s_b_twitter unfortunately I cannot help you with that. I don't know much about this lib
Florent330
@Florent330
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?
Jeremyzarra
@Jeremyzarra
alguien que haya modificado el tamaño del pdf porque me quita el enmarcado del word
Progi1984
@Progi1984
@Jeremyzarra Please speak english. You will have more answers
Zac
@Acen
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
Progi1984
@Progi1984
@Acen You can open an issue on PhpWord repository and add a sample file, please :)