如何设置PDF标头的高度?

如何设置PDF标头的高度?

问题描述:

有人知道如何在<cfdocumentitem format="pdf:...生成的pdf中设置标题的高度吗?

Does anyone know how I can set the height of a header in a pdf generated by <cfdocumentitem format="pdf:...?

我正在使用<cfdocumentitem type="header">

所以有类似

<cfdocument format="pdf" marginbottom="0" margintop="4" marginleft="0" marginright="0" pagetype="a4" unit="cm" fontembed="no">
<cfdocumentitem type="header">
  This is my header.. I want to reduce the height but can't work out how.
<cfdocumentitem>
</cfdocument>

预先感谢任何指针.

Jason

使用 cfdocument 标签中的边距设置来控制为页眉或页脚保留多少空间.

Use the margin settings in the cfdocument tag to control how much space is reserved for headers or footers.

因此,在您的情况下,请将margintop值从4更改为较低的值.

So in your case, change the margintop value from 4 to a lower value.

<cfdocument format="pdf" marginbottom="0" margintop="4" marginleft="0" marginright="0" pagetype="a4" unit="cm" fontembed="no">

要进一步控制标题的外观(例如填充,行高),您需要在标题内容中添加HTML和CSS样式.

To further control the appearance of your header, such as padding, line-height, you would need to add HTML and CSS styles to your header content.