Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.