kamalpreet kaur
kamalpreet kaur

Reputation: 31

Images embedded in doc generated from php not showing up when opened in mobile(android and ios)

I have used the following code to convert html to doc using php.It works perfectly fine on pc but when accessed from any mobile device then the text part is showing up fine but not the embedded images.It is showing the img src link i.e http://domain/image.jpg but not the images.How can I solve this issue?

<? header("Content-Type: application/vnd.ms-word");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("content-disposition: attachment;filename=Report.doc");
?>

Upvotes: 0

Views: 276

Answers (1)

Matthew Turland
Matthew Turland

Reputation: 763

From the last example here, try adding images to your document like so

$source = file_get_contents('/path/to/my/images/earth.jpg');
$textrun->addImage($source);

Upvotes: 0

Related Questions