Jump to content

Watermark problem in appending


atiqkhan

Recommended Posts

Hi All!

 

I have doc ( word ) file which has a watermark in it . I want to append some text in it so that the text comes in front of Watermark . In other words , there is a background image in a word file , in front of which I want to append some text and then want to send that word as an attachment . I have tried the following but the text not appending due to watermark in it . Please any body can help me ..... Thanks in advance....

 

I am using this ....

 

$msg="I am testing. I am testing. I am testing. I am testing. I am testing. I am testing. I am testing. I am testing.

I am testing. I am testing. I am testing. I am testing. I am testing. I am testing. I am testing. I am testing. ";

$my_file = "frank.doc";

$ourFileHandle = fopen($my_file, 'a');

fwrite($ourFileHandle, $msg);

fclose($ourFileHandle);

 

PLease note the file frank.doc contains watermark . Its totally PHP....

 

The Doc file is attached...

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/200921-watermark-problem-in-appending/
Share on other sites

Word docs are not plain text documents. You can't simply "write" text to the dcoument. Prior to Office 2007 word docs were stored in a proprietary format. Starting with 2007 they are being stored in an XML format. You will need to write the data in a format that is appropriate to the document you have.

 

I think your only option is going to be to find a class or some third-party plug-in that allows you to modify word documents.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.