将文本围绕MPDF中的图像包裹
我试图将文本包裹在PDF中的图像上,我尝试了很多事情,但它在mpdf中不起作用
基本上我希望我的pdf格式如上图
所示是格式1代码的代码
<div class="content" style="text-align: center;">
<div class="main_img" style="height:300px; width:300px; float:right;
margin-left: 1em;">
<img src="' . "./uploads/$main_images" . '" style="height:300px; width:100%; float:right; justify:end;" />
</div>
<p style="text-align: justify; word-wrap: break-word;">' . $content . '</p>
<p style="text-align: justify;">' . $content2 . '</p>
<div class="other_img" style="height:300px width:100%; margin: 5px;">
<div class="oth_img" style=" background-image: url(' . "./uploads/$oth_images" . '); background-repeat: no-repeat; background-size: cover; height:300px; width:100%;"></div>
</div>
</div>
,用于格式2
<div class="content" style="">
<div class="other_img" style="height:300px width:100%; margin: 5px;">
<div class="oth_img" style=" background-image: url(' . "./uploads/$oth_images" . '); background-repeat: no-repeat; background-size: cover; height:300px; width:100%;"></div>
</div>
<br>
<p style="text-align: justify;">' . $content . '</p>
<div class="main_img" style="height:300px; width:300px; float:left; margin: 5px; margin-bottom:100px;">
<img src="' . "./uploads/$main_images" . '" style="height:300px; width:100%; float:left; justify:end;" />
</div>
<p style="text-align: justify;">' . $content2 . '</p>
</div>
上述代码以正常html格式工作 但是它在PDF中不起作用 请指导我在PDF中进行这项工作也要
感谢
i was try to wrap text around image in pdf, i have tried lots of things but its not work in mpdf
basically i want format of my pdf as above images
below is a code for format 1
<div class="content" style="text-align: center;">
<div class="main_img" style="height:300px; width:300px; float:right;
margin-left: 1em;">
<img src="' . "./uploads/$main_images" . '" style="height:300px; width:100%; float:right; justify:end;" />
</div>
<p style="text-align: justify; word-wrap: break-word;">' . $content . '</p>
<p style="text-align: justify;">' . $content2 . '</p>
<div class="other_img" style="height:300px width:100%; margin: 5px;">
<div class="oth_img" style=" background-image: url(' . "./uploads/$oth_images" . '); background-repeat: no-repeat; background-size: cover; height:300px; width:100%;"></div>
</div>
</div>
code for format 2
<div class="content" style="">
<div class="other_img" style="height:300px width:100%; margin: 5px;">
<div class="oth_img" style=" background-image: url(' . "./uploads/$oth_images" . '); background-repeat: no-repeat; background-size: cover; height:300px; width:100%;"></div>
</div>
<br>
<p style="text-align: justify;">' . $content . '</p>
<div class="main_img" style="height:300px; width:300px; float:left; margin: 5px; margin-bottom:100px;">
<img src="' . "./uploads/$main_images" . '" style="height:300px; width:100%; float:left; justify:end;" />
</div>
<p style="text-align: justify;">' . $content2 . '</p>
</div>
above code work in normal html format
but its not work in pdf
please guide me to make this work in pdf also
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论