Error!! (Can anyone help?)

Jun 13, 2010 at 3:04 PM
Edited Jun 13, 2010 at 3:04 PM

Hello everyone,

I am using :
Word 2007 (12.0.6535.5002) SP2 MSO (12.0.6535.5002)

and when I try and open a .docx file generated by any of the PHPWord example scripts, I get the following error.

Is anyone able to tell me why I am getting this?

 

Kind regards,

Anthony Myatt

Coordinator
Jun 13, 2010 at 3:46 PM

Hello Anthony,

can you post your PHP Code? thanks.

Jun 13, 2010 at 4:07 PM

Hello raw_venture_ad,

I was using the examples that came with PHPWord.

After doing some research I managed to fix my own problem. It turns out that PHP 5.2.6 and above, have a problem with the php_zip extension under windows that causes it to write files as ascii not binary.
After replacing my php_zip.dll file from a CVS snapshot I managed to get it to work.

Whilst I am here, is there any plans for watermarks and page borders in PHPWord?

 

Kind regards,

Anthony Myatt

Coordinator
Jun 13, 2010 at 5:23 PM

Hello Anthony

Which example did you tried? However, I'm glad to hear that your problem is fixed.

 

I haven't looked at the XML Source but think I can integrate the feature of watermarks and page borders in the next release.

Best regards

Matthias

Jun 14, 2010 at 3:21 AM
Edited Jun 14, 2010 at 3:23 AM

Hello Matthias,

I tried the “text” and “advanced table” examples.

When would the next release be likely to come out? I am using PHPWord for a Merit System that will be used by a school and watermarks and page borders are a requirement of this project.

Any chance of these features being added in the next few days?

Kind regards,

Anthony Myatt

Jun 15, 2010 at 10:50 PM
Edited Jun 15, 2010 at 10:51 PM

hi!
I have nearly the same problem but with some additions. When I specify a filename to save as, I get nothing. No error messages in the logs and no file saved in the web directory.

When I specify php://output as filename I get the popup to save a file with the same name as my script and with a zip extension. The file wont open with zip. If I rename the file to docx I get the same error message as Matthias.

If I specify php://output as filename using NON-IE browser (Safari on my Mac) I don't not get any popup to save, instead I get the raw code-output from the generated file in the window.

I use the example code as well.

Coordinator
Jun 18, 2010 at 4:38 PM
computerguy wrote:
When would the next release be likely to come out? I am using PHPWord for a Merit System that will be used by a school and watermarks and page borders are a requirement of this project.

Any chance of these features being added in the next few days?

Yes. I think I can add these features to the next release.

I can't tell when the next release cames out, but the weekend cames with bad weather to germany. ;)

Jun 21, 2010 at 9:51 AM
Edited Jun 21, 2010 at 9:52 AM
sugardad wrote:

hi!
I have nearly the same problem but with some additions. When I specify a filename to save as, I get nothing. No error messages in the logs and no file saved in the web directory.

When I specify php://output as filename I get the popup to save a file with the same name as my script and with a zip extension. The file wont open with zip. If I rename the file to docx I get the same error message as Matthias.

If I specify php://output as filename using NON-IE browser (Safari on my Mac) I don't not get any popup to save, instead I get the raw code-output from the generated file in the window.

I use the example code as well.

To fix the error with a corrupt zip, simply replce the original zip.dll file in your php directory with the one from here http://snaps.php.net/win32/php5.2-win32-latest.zip

I think the problem with the file not saving may be a windows permision problem, try changing the file permisions on the folder you are trying to save to.

Jun 21, 2010 at 10:55 AM

Thanks for your reply! It's a little bit more problemtaic I'm afraid..

You see, I run PHP version 5.1.6 so the latest zip wont work. And because of another extension (php_perl.dll) I can not upgrade at the momemt. So my options are:

1. Re-compile latest zip extension together with PHP 5.1.6
2. Best option: Re-compile php_perl together with  PHP 5.3

I have spent quite a few days trying to to both without luck.. My experience with visual studio compiling is rather limited. Do any of you have experiences with this type of work? I would gladly pay a small sum for a working php_perl.dll for PHP 5.3 on windows.. 

The perl extension is located here:
http://pecl.php.net/package/perl

Here is a fix for compiling it with PHP 5.3:
http://svn.php.net/viewvc/pecl/perl/trunk/

I've also seen a guide for doing it on linux:
http://www.wowtutorial.org/linux-servers/how-compile-php-53x-support-perl-extensions-344.html

But as I said I need the dll for windows.

I'm getting desperate.. 

 

Jun 24, 2010 at 8:13 PM

Try use utf8_encode in string values. Works for me.

Example: $properties->setCreator(utf8_encode('sóme text with especial çhars'));

Jun 29, 2010 at 9:29 AM

Thanks for the tip about utf8_encode. Unfortunately it didn't help. I have tested with different php versions and anything above my current 5.1.6 version seems to work. But as I said in my previous post I cant not upgrade at the moment.

Is there anyone out there who can compile PHP extension DLL's ?

Coordinator
Jul 25, 2010 at 9:09 PM
computerguy wrote:

Whilst I am here, is there any plans for watermarks and page borders in PHPWord?

Hey,

both features are implemented in the current release 0.6.2.

Regards

Raw

Jul 26, 2010 at 1:28 AM

Thank you

From: raw_venture_ad [mailto:notifications@codeplex.com]
Sent: Monday, 26 July 2010 6:09 AM
To: anthony@tmcp.com.au
Subject: Re: Error!! (Can anyone help?) [phpword:215859]

From: raw_venture_ad

computerguy wrote:

Whilst I am here, is there any plans for watermarks and page borders in PHPWord?

Hey,

both features are implemented in the current release 0.6.2.

Regards

Raw

Read the full discussion online.

To add a post to this discussion, reply to this email (phpword@discussions.codeplex.com)

To start a new discussion for this project, email phpword@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com