Quantcast
Channel: PHPWord
Viewing all 450 articles
Browse latest View live

New Post: Check system requirements are met

$
0
0
Hi

I'm having trouble getting PHPWord to work on my webserver. I have the correct version of PHP and the ZipArchive extension appears to be present, but I'm confused about the "xmllib" extension. How can I check if this is present and is "xmllib" the same as "libxml"? The documentation is pretty vague on all of this.

Any help greatly appreciated.

New Post: setValue and addImage

$
0
0
Excuse,have you solved it? I need this. Thanks!

New Post: How to merge two word documents with pictures?

$
0
0
Can anyone help me? Please. I have a problem and I can not find a solution.
1- I need merge two word documents with pictures.
2- Or something like "setValue" for images. Replace text to image.

The merge works fine, the problem is that the image does not exist in the main document, the second docx repeats the same "image1.jpeg" picture that the main document. I need add the new Image in the main document and change the reference.

I have tried many codes, but without success.

Please, somebody have any idea?

Thank you

New Post: Line breaks after image.

$
0
0
Hi
The above solution works fine for section. How can I use it for header as when I use it in header, the doc gets corrupt. Please help !!!

Created Unassigned: PageSizeH and PageSizeW don't work in github version [81]

$
0
0


Hello,
I have custom sized paper I need to dynamically create in PHP and while this worked in the old .6 version, it no longer works with the github version. Am I doing something wrong?
```

$twips = 1440;
$width = $width * $twips;
$height = $height * $twips;
$marginTop = $marginTop * $twips;
$marginLeft = $marginLeft * $twips;
$marginRight = $marginRight * $twips;
$marginBottom = $marginBottom * $twips;

// New Word Document
$PHPWord = new \PhpOffice\PhpWord\PhpWord();

// New portrait section
$section = $PHPWord->addSection(array(
'pageSizeW' => $width,
'pageSizeH' => $height,
'marginTop' => $marginTop,
'marginRight' => $marginRight,
'marginLeft' => $marginLeft,
'marginBottom' => $marginBottom));

```
The page size always is now coming out as A4 even though I am trying my own custom sizes. Any help would be appreciated.

Thanks,
David

New Post: Template setValue with caractère "&" - File corrupt

$
0
0
I find a tempory solution!

use the function htmlentities

$template = $PHPWord->loadTemplate('Client.docx');
$client = htmlentities("Ben&Nuts");
$template->setValue('CLIENTE', $cliente);
$template->save('Client.docx');

New Post: Template setValue with caractère "&" - File corrupt

$
0
0
hi,
I'm sorry for my first reply.

htmlentities resolve the problem with "&" but when you have "é" or other accented letter, the output from the page is corrupt.

I find only the problem with "&" and not with an other special caractere...

I propose this solution :
$client = str_replace("&", "&","Ben&Nuts");

New Post: Template setValue with caractère "&" - File corrupt

$
0
0
Other caractere....
$client = str_replace(array("&",'>','<'), array("&amp;","&gt;","&lt;"), $client);

New Post: Template setValue with caractère "&" - File corrupt

New Post: how to let line not breaks after addtext

$
0
0
hi there i've got a problem that is i need to creat a string with different size of word here is example

$section->addText("               ");
$section->addText("a",array('size'=>15));
$section->addText("               ");
and what i expect is like this
          a              and with bigger "a"
but this is what really show
              
a
              
and with bigger "a" too 
so how can i concatenation few string with different size of word without line break or creat one string that can show different size of word

thanks!

Reviewed: PHPWord 0.6.2-1 Beta (九月 02, 2014)

$
0
0
Rated 5 Stars (out of 5) - Hello, may I know if you are interested to find Sponsor for your product? And we want to be your sponsor. Please mail me cxienancy@gmail.com for detailed information. Thank you very much.

New Post: layout text in Vertical with addtext( )

$
0
0
hi there i got problems again is that if someone can addText in Vertical way like :
t
h
i
s
 
i
s

e
x
a
m
p
l
e
thanks!!

New Post: default grammar language

$
0
0
Is there any chance to set default grammar language? I'v generated word doc, but all text is undelined because of language difference. Of course i can set the default grammar lang in my word settings on PC. But i can't say that to all who will be use this thing

New Post: TOC spacing

$
0
0
Hi

Is it possible to set TOC spacing? It seems that default value is spacingAfter 10pt.

Thanks.

New Post: TOC not working?

$
0
0
Hii wanglei_estar,
I can see the Page number in TOC, but it does not seems to be correct page number. Any help?

New Post: How can I open an existing word doc?

$
0
0
I'd like to know how to open an existing word document and edit it...

Some can help me?

New Post: Fix problem utf8 caracters special accents and ñ

$
0
0
Thanks, you save me the day! :-)

New Post: Calling addText() method gives a line break at the end of string

$
0
0
My workaround is to use a template that has all the formats I need.

$PHPWord = new PHPWord();
$document = $PHPWord->loadTemplate('Template.docx');
$document->setValue('XXXX', 'Sun');
$document->save('doc.docx');

New Post: How can I open an existing word doc?

$
0
0
Hi,

you can use template Class

as this example

$PHPWord = new \PhpOffice\PhpWord\PhpWord();
$document = $PHPWord->loadTemplate("example.docx");

after open you can change values inside doc (but every item to change in the original docs must to be ${ITEM_TO_CHANGE}) with this command:

$document->setValue("ITEM_TO_CHANGE","New value");

to Save new File :

$document->saveAs("newfile.docx");

i hope was helpful

New Post: Can't save text in Herew

$
0
0
Hi,

When I create a docx file with Hebrew letters, all I get is:
אאב בב דדד

Can you please assist?

Thanks!
Viewing all 450 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>