We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Re: Aspose.Words is adding \ in hyperlinks

My problem:

How i Replace image to word document in php?

<?php

$doc = new COM("Aspose.Words.Document");

$comHelper = new COM("Aspose.Words.ComHelper");

$builder = new COM("Aspose.Words.DocumentBuilder");

$doc = $comHelper->Open("D:\phpStudy\WWW\TestPhpToWord\ReplaceSimple.doc");

$doc->Range->Replace("_image_",new ReplaceAndInsertImage("D:\phpStudy\WWW\TestPhpToWord\1.jpg"), false);

$doc->Save("D:\phpStudy\WWW\TestPhpToWord\ReplaceSimple Out.doc");

?><o:p></o:p>

In Word:

image<o:p></o:p>

Please help me, thank you very much.
URL:Re: Aspose.Words is adding \ in hyperlinks

<?php
$doc = new COM("Aspose.Words.Document");
$comHelper = new COM("Aspose.Words.ComHelper");
$builder = new COM("Aspose.Words.DocumentBuilder");
$doc = $comHelper->Open("D:\phpStudy\WWW\TestPhpToWord\ReplaceSimple.doc");
$doc->Range->Replace("_image_",new ReplaceAndInsertImage("D:\phpStudy\WWW\TestPhpToWord\1.jpg"), false);
$doc->Save("D:\phpStudy\WWW\TestPhpToWord\ReplaceSimple Out.doc");
?>


In Word:
_image_

how to use a picture to replace the label in word use php?think you very mach!

Thanks very mach teacher!

<?php

$doc = new COM("AsposeComWrapper.Methods");

$doc->ReplaceImage("D:\phpStudy\WWW\TestPhpToWord\ReplaceSimple.doc","D:\phpStudy\WWW\TestPhpToWord\ReplaceSimple Out.doc","D:\phpStudy\WWW\TestPhpToWord\1.jpg","_image_");

?>

I do use AsposeComWrapper tested.The result is “ReplaceSimple Out.doc” Normal output.but the label "_image_" Not replaced "1.jpg",

Other steps I will

Please help me.thank you very mach!

Hi there,

Thanks for your inquiry. Could you please share your input and output documents along with image here for testing purposes? We will investigate the issue on our side and provide you more information.

PS: To attach these resources, please zip them and Click 'Reply' button that will bring you to the 'reply page' and there at the bottom you can include any attachments with that post by clicking the 'Add/Update' button.