如何在 Docbook 中设置最大图像高度?
我目前遇到一个问题,当我将文档转换为 pdf 时,图像有点不稳定。我的屏幕截图 90% 都很好,但其余部分的高度超过 740 像素,这会导致它们超出页面。我对宽度没有任何问题。
<?xml version="1.0" encoding="UTF-8"?>
<section xmlns="http://docbook.org/ns/docbook" xml:id="newNote">
<title>New Note</title>
<section>
<title>Screenshot</title>
<mediaobject>
<imageobject>
<imagedata fileref="./views/screenshots/newNote.png" scalefit="1" width="100%" contentdepth="100%"/>
</imageobject>
</mediaobject>
</section>
</section>
我尝试过 contentdepth="740"
和 contentdepth="740px" width="100%"
但没有运气。 我希望告诉图像具有最大高度,但填写宽度。
I'm currently having an issue that when I convert my docbook to pdf, the images are a tad wonky. 90% of my screenshots are fine, but the remainders have a height beyond 740 pixels and this causes them to run off the page. I'm having no problems with width.
<?xml version="1.0" encoding="UTF-8"?>
<section xmlns="http://docbook.org/ns/docbook" xml:id="newNote">
<title>New Note</title>
<section>
<title>Screenshot</title>
<mediaobject>
<imageobject>
<imagedata fileref="./views/screenshots/newNote.png" scalefit="1" width="100%" contentdepth="100%"/>
</imageobject>
</mediaobject>
</section>
</section>
I've tried contentdepth="740"
and contentdepth="740px" width="100%"
But no luck.
I'm looking to tell the image to have a max height but fill out the width.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在不知道您正在使用什么 DocBook 实现的情况下,我建议使用深度属性(深度=“740px”)设置视口区域的高度,以确保缩放按预期工作。并尝试较小的值(即 320px)以确保页面大小不会溢出。
如果这不起作用,您可能在实现中遇到了错误。
Without knowing what DocBook implementation you are using, I would recommend setting the height of the viewport area using the depth attribute (depth="740px") to make sure that the scaling works as expected. And try smaller values (ie. 320px) to make sure you are not overflowing the page size.
If that doesn't do the trick, you may be experiencing a bug in the implementation.