How to set the height of a PDF header?

半城伤御伤魂 提交于 2019-12-12 13:15:24

问题


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

I am using <cfdocumentitem type="header">

So have something like

<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>

Thanks in advance for any pointers.

Jason


回答1:


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

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">

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.




回答2:


You can use marginTop = "number" in cfdocument.

<cfdocument
format = "PDF|FlashPaper"
authPassword = "authentication password"
authUser = "authentication user name"
backgroundVisible = "yes|no"
bookmark = "yes|no"
encryption = "128-bit|40-bit|none"
filename = "filename"
fontEmbed = "yes|no"
localUrl = "yes|no"
marginBottom = "number"
marginLeft = "number"
marginRight = "number"
marginTop = "number"
....


来源:https://stackoverflow.com/questions/11610026/how-to-set-the-height-of-a-pdf-header

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!