dongtan8532 2015-11-19 03:36 采纳率: 0%
浏览 26
已采纳

如何在php doc中调整图像大小的正确方法[关闭]

I'm trying to create a .doc file using php that has image inside it. The image inside it has a quite big weight and height, but i want to include it without creating a new small version image of it.

Here is my code

<?php
    set_time_limit (0);
    header("Content-type: application/vnd.ms-word");
    header("Content-Disposition: attachment;Filename=test.doc");    
?>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
        <title>Hello World</title>
    </head>
    <body>
        <img src="http://localhost/test_zip/img/jesse_what.png" style="max-width:50; width:50;max-height:50; height:50;">
    </body>
</html>

How is the correct way to resize it? because the style i place in the image tags is not working.

  • 写回答

2条回答 默认 最新

  • dongzhun8449 2015-11-19 04:11
    关注

    After a while of searching, i found a way to do it. So I add width and heigh attributes to the img tag

    now it looks like this

    <img src="http://localhost/test_zip/img/jesse_what.png" width="160" height="200">
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥50 yalmip+Gurobi
  • ¥20 win10修改放大文本以及缩放与布局后蓝屏无法正常进入桌面
  • ¥15 angular开发过程中,想要读取模型文件,即图1的335行,会报404错误(如图2)。但我的springboot里配置了静态资源文件,如图3。且在该地址下我有模型文件如图4,请问该问题该如何解决呢?
  • ¥15 itunes恢复数据最后一步发生错误
  • ¥15 关于#windows#的问题:2024年5月15日的win11更新后资源管理器没有地址栏了顶部的地址栏和文件搜索都消失了
  • ¥100 H5网页如何调用微信扫一扫功能?
  • ¥15 讲解电路图,付费求解
  • ¥15 有偿请教计算电磁学的问题涉及到空间中时域UTD和FDTD算法结合的
  • ¥15 vite打包后,页面出现h.createElement is not a function,但本地运行正常
  • ¥15 Java,消息推送配置