如何在 Docbook 中设置最大图像高度?

发布于 2024-10-05 01:15:44 字数 710 浏览 0 评论 0原文

我目前遇到一个问题,当我将文档转换为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

拥抱我好吗 2024-10-12 01:15:44

在不知道您正在使用什么 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文