Subscribe: phpword Issue Tracker Rss Feed
http://phpword.codeplex.com/project/feeds/rss?ProjectRSSFeed=codeplex://workitem/phpword
Preview: phpword Issue Tracker Rss Feed

phpword Issue Tracker Rss Feed



phpword Issue Tracker Rss Description



 



Created Unassigned: How to add special character(↑) in word document [110]

Thu, 07 Sep 2017 06:50:26 GMT

HI,

I want to add special character(↑) like $section->addText('Hello World! ↑ U+2B06');.

Could you please tell me what is the procedure to add special character in the word file.

Thanks,
Avinash



Created Unassigned: How to embed and external font into the Word doc [109]

Mon, 31 Jul 2017 15:00:03 GMT

Hi, PHPWord has been working wonderfully for me for last couple of years but I am running into an issue now. I have to use an external font into the document.
PHPWord allows me to set the font name which is great as far as the computer the word document is being opened has the said font installed.

MS Word allows to embed the font being used into the document so that it loads the font correctly even if the font used does not exist on the system (see attached).

How can I use PHPWord library to embed the font into the doc? I don't mind making changes to the library if needed.

Thanks.



Edited Unassigned: PhpWord not rendering html properly in Word doc [108]

Wed, 03 May 2017 20:04:50 GMT

html markup renders in browser: "The County Partnership for Children is a not-for-profit agency" - renders in bold, and italics, respectively.

here is my code:
```
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter( $PHPWord, 'Word2007' );
$fileloaction = '/var/www/rootwebfolder/contracts/tmp';
$filename = 'OCA_'.$LPShort."_".date('YmdHis',time()).'.docx';
$FullName = $fileloaction.'/'.$filename;
//echo $FullName;
$objWriter->save($FullName);
```

yet the rendered Word document still shows those html tags: The Caswell County Partnership for Children is a not-for-profit agency.

in fact, my app exports 2 files to Word, the first shows the html tags, the 2nd in Word ignores the tags altogether, the text not marked up at all. yet, in the sql database, the tags are in each of the files.

Help?




Created Unassigned: PhpWord not rendering html properly in Word doc [108]

Wed, 03 May 2017 20:03:33 GMT

html markup renders in browser: "The County Partnership for Children is a not-for-profit agency" - renders in bold, and italics, respectively.

here is my code:
```
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter( $PHPWord, 'Word2007' );
$fileloaction = '/var/www/ncpcphp/contracts/tmp';
$filename = 'OCA_'.$LPShort."_".date('YmdHis',time()).'.docx';
$FullName = $fileloaction.'/'.$filename;
//echo $FullName;
$objWriter->save($FullName);
```

yet the rendered Word document still shows those html tags: The Caswell County Partnership for Children is a not-for-profit agency.

in fact, my app exports 2 files to Word, the first shows the html tags, the 2nd in Word ignores the tags altogether, the text not marked up at all. yet, in the sql database, the tags are in each of the files.

Help?




Created Unassigned: Mail Image issue [107]

Sat, 08 Oct 2016 07:08:07 GMT

php word document issue in gmail attachment .
When i open file in gmail doc the image of word document is not displayed only just text will appear.





Created Unassigned: after save i have a corrupted file [106]

Thu, 08 Sep 2016 07:51:16 GMT

here is my code :


$phpWord = new \PhpOffice\PhpWord\PhpWord();
$phpWord->getCompatibility()->setOoxmlVersion(15);

$phpWord->setDefaultFontSize(10);
$sectionRun = $phpWord->addSection(array('marginLeft'=>"900",'marginRight'=>"900"));
$section= $sectionRun->addTextRun();
$filename = "Arrete-Renouvellement.docx";

$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
$objWriter->save($webPath . '/courrier/renouvellement/'.$filename);

when I open the saved file it 's corrupted, i'm on symfony2

I dont know what is the problem can you help me

thank you

my file on the attachment




Edited Unassigned: How to insert an image in existing word file at a specified position? [105]

Fri, 08 Jul 2016 10:34:43 GMT

I started using PHPWORD, it is a nice API to work on. But, I have an issue regarding this. I didn't find the way to __insert an image in a existing word file at a specified position I need.__

Can anyone help me understanding of how to insert it...



Created Unassigned: How to insert an image in existing word file at a specified position? [105]

Tue, 05 Jul 2016 09:06:11 GMT

I started using PHPWORD, it is a nice API to work on. But, I have an issue regarding this. I didn't find the way to __insert an image in a existing word file at a specified position I need.__

Can anyone help me understanding of how to insert it.



Created Unassigned: How to add 2 or more diffrent text styles on a single table cell ? [104]

Wed, 13 Apr 2016 06:41:19 GMT

Great code, thank you for that !!!
I have just one issue, can't manage to add diffrent text styles on a single table cell, is there any way to do this ?



Created Unassigned: How to write rtl by phpword? [103]

Tue, 19 Jan 2016 09:35:55 GMT

Hi;
I want to use phpword to create a persian text.

please help me to set utf-8 charset and style paragraph to set dir=rtl in phpword

Thanks in advance.



Commented Issue: Use template to create sequential pages [51]

Thu, 17 Dec 2015 22:25:25 GMT

I have rewritten the template.php code so that it can create a new page from a single page/document, for when a user has to create a page for each loop. My code is not great, but it seems functional. Please feel free to use it, if it helps in anyway

USAGE:
require_once '../classes/PHPWord/PHPWord.php';
$PHPWord = new PHPWord();
$document = $PHPWord->loadTemplate($template_path);

$j = 0;
foreach( $tenant_arr as $value)
{
if($j > 0){$document->AddPage();}
$document->setValue('name', $tenant_arr[$j]['name']);
$document->setValue('email', $tenant_arr[$j]['email']);
$document->setValue('phone', $tenant_arr[$j]['phone']);
$j++;
}
etc...........
Comments: Hiiii, thank you very much for this code, i spent a long time searching a solution for "clone part or clone block", this is a better solution... thanksss again :)



Created Unassigned: I have a form where user are filling questionnaire , When they submit special characters The doc created is corrupted [102]

Wed, 04 Nov 2015 07:27:55 GMT

I have a form where user are filling questionnaire , When they submit special characters The doc created is corrupted

How can I fix this

My code

```
require_once 'src/PhpWord/Autoloader.php';
\PhpOffice\PhpWord\Autoloader::register();

if(isset($_POST['submit_docs'])){
$companyname= $_POST['companyname'];
// Creating the new document...
$phpWord = new \PhpOffice\PhpWord\PhpWord();
// Adding an empty Section to the document...
$section = $phpWord->addSection();

$html .= '
  • Company Name and Address : '.$_POST["companyname"].'
';
\PhpOffice\PhpWord\Shared\Html::addHtml($section, $html);
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
$objWriter->save('questionnaire/DMKSA_Questionnaire_'.$arr[0].'.docx');
```

Error

```
Warning: DOMDocument::loadXML(): StartTag: invalid element name in Entity, line: 1 in /home/iclock/public_html/test/src/PhpWord/Shared/Html.php
```

This happens only when special characters like '<' is being submitted

Any leads on this





Commented Unassigned: setValue() not working [57]

Wed, 21 Oct 2015 23:41:45 GMT

here is my php code:
```
$PHPWord = new PHPWord();
$template = $PHPWord->loadTemplate(APPPATH.'files/test.docx');
$template->setValue('test1', 'hello');
$template->setValue('test2', 'whats');
$template->setValue('test3', 'up');
$template->setValue('test4', 'koby');
$template->setValue('test5', '!!!!!!');
$template->save('files/test.docx');
```

here is my word document text:

${test1}
${test2}
${test3}
${test4}
${test5}

The output word content:

hello
${test2}
${test3}
${test4}
${test5}

setValue(); only sets the value for the first line ${test1}

Any help would be great
Comments: ok but what is the solution for this, how do i edit the function setValue



Edited Unassigned: Georgian characters in a template [101]

Thu, 30 Jul 2015 13:20:21 GMT

I use TemplateProcessor class
```
$templateProcessor = new \PhpOffice\PhpWord\TemplateProcessor('PhpWord/doc/temp/test.docx');
$templateProcessor->setValue('test','თბილსერვის' );
. . .
```
and ${test} field in the output file looks run down like it is in the image. How can I fix this?



Created Unassigned: Georgian characters in a template [101]

Thu, 30 Jul 2015 13:19:39 GMT

I use TemplateProcessor class
```
$templateProcessor = new \PhpOffice\PhpWord\TemplateProcessor('PhpWord/doc/temp/test.docx');
$templateProcessor->setValue('test','თბილსერვის' );
. . .
```
and ${test} field in the output file looks run down like it is in the image



Created Unassigned: Edit header/footer of an existing document through PHPWord. [100]

Tue, 09 Jun 2015 10:34:04 GMT

Hello,

Could somebody please help me out with this? I need to add a functionality to my web application that enables the user to replace the content of header/footer of a existing Word document with some other content. In other words, I need to edit the header/footer of a document.

A solution with an example would be very much appreciated.

Thanks!



Created Unassigned: In IPAD Download docx issues [99]

Wed, 06 May 2015 11:39:32 GMT

In IPAD when I download the docx files it will download the file in .html & data are in discarded format



Created Unassigned: Edit an Existing document and add watermark [98]

Thu, 12 Mar 2015 17:26:14 GMT

I want to be able to edit and watermark an existing word documents, is that possible? and the code does not recognize .doc or rtf documents, is there a way i can tweak to recognize them. Please anybody help with this asap as the project i am working on now depends on it.



Commented Unassigned: not working word.php just show blank page [73]

Thu, 12 Feb 2015 10:53:39 GMT

Dear All,
please help me to start work this project. i can not start. when run the word.php file then only blank page shown. i want to make a web based word processor like google document. but the white working area cannot design. so plz help me.
Comments: Same here. I had been struggling with OpenTBS, and managed to generate .odt docs, although not achieveing exactaly what I wanted. So I've changed to PHPWord, but all I got is a blank screen. Besides, PHP debugging is kind of hell, so I don't truly know what's wrong with my code. As far as I know, if you are using a template, you won't need to add sections. My code looks like this: ``` title: " + $title + "

"); echo ("

msg: " + $msg + "

"); echo ("

name: " + $name + "

"); //Include PHPWord $require = require_once '../librerias/PHPWord/PHPWord.php'; //Instance PHPWord object $PHPWord = new PHPWord(); //Load Template (same directory as this .php file) $document = $PHPWord->loadTemplate('test.docx'); //Replace template fields $document->setValue('title', $title); $document->setValue('msg', $msg); $document->setValue('name', $name); $document->setValue('weekday', date('l')); $document->save('show.docx'); ?> ```



Commented Unassigned: Get a blank word document [86]

Thu, 12 Feb 2015 10:51:01 GMT



$PHPWord = new PHPWord();
$document = $PHPWord->loadTemplate('./documents/invoice1.docx');
$section = $PHPWord->createSection();
$section->addText( $invname);
$section->addText( $organization_link_record['organization_link_address_1'] );
$section->addText( $organization_link_record['organization_link_address_2'] );
if (!empty( $organization_link_record['organization_link_address_3']))
{$section->addText( $organization_link_record['organization_link_address_3'] );}
if (!empty( $organization_link_record['organization_link_address_4']))
{$section->addText( $organization_link_record['organization_link_address_4'] );}
$$section->addText($city);
$document->save('invoice/'.$invoicedoc);

what am i doing wrong?

Comments: Same here. I had been struggling with OpenTBS, and managed to generate .odt docs, although not achieveing exactaly what I wanted. So I've changed to PHPWord, but all I got is a blank screen. Besides, PHP debugging is kind of hell, so I don't truly know what's wrong with my code. As far as I know, if you are using a template, you won't need to add sections. My code looks like this: ``` title: " + $title + "

"); echo ("

msg: " + $msg + "

"); echo ("

name: " + $name + "

"); //Include PHPWord $require = require_once '../librerias/PHPWord/PHPWord.php'; //Instance PHPWord object $PHPWord = new PHPWord(); //Load Template (same directory as this .php file) $document = $PHPWord->loadTemplate('test.docx'); //Replace template fields $document->setValue('title', $title); $document->setValue('msg', $msg); $document->setValue('name', $name); $document->setValue('weekday', date('l')); $document->save('show.docx'); ?> ```