pdf - Apache FOP 外部图形自动高度以适应页面
问题描述
我有一个场景,我使用fo:external graphic
. 但是图像大小是动态的,我必须将其放入单页中。我通过保持如下纵横比来缩小水平和垂直图像。
<fo:block text-align="left" margin-top="10"
height="22cm" width="18cm">
<fo:external-graphic height="100%" width="100%"
content-height="scale-to-fit" content-width="scale-to-fit"
scaling="uniform" >
<xsl:attribute name="src">
<xsl:text>url('data:image/png</xsl:text>
<xsl:text>;base64,</xsl:text>
<xsl:value-of select="BASE_64_IMAGE"/>
<xsl:text>')</xsl:text>
</xsl:attribute>
</fo:external-graphic>
</fo:block>
这适用于大型垂直图像。但是一旦按比例缩小,如果图像垂直尺寸较小,则文本内容不会填充到图像下方。相反,它将在下一页中填充。但如果图像很小,我希望文本显示在图像下方。
有人可以帮我解决这个问题吗?
解决方案
推荐阅读
- c# - UserManager.Create 函数调用后的问题
- python - 堆叠 tkinter 小部件的强制高度
- mongodb - 为什么我无法访问在 Azure Web 应用程序的 docker 容器中运行的 mongodb?
- image - 参数类型“String”不能分配给参数类型“Uint8List”
- python - 尝试在 Windows 10 上打开任何 Python 库时,Visual Studio Code 中的“DLL 加载失败”
- javascript - 捕获传递给函数的函数参数作为javascript中的裸符号
- php - 发布登录凭据并通过登录页面并保持登录状态
- c# - 无法在 C# 中连接到 mySQL
- c# - C#将“2019/02/13 05:00 PST”从json反序列化为UTC DateTime
- html - 您能否仅使用“text-shadow”CSS 属性创建水平翻转的文本阴影