2012-07-23 46 views
2

有沒有人知道我可以如何設置由<cfdocumentitem format="pdf:...生成的pdf格式的頁眉高度?如何設置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> 

預先感謝任何指針。

傑森

+0

您是否嘗試過向其添加CSS? – 2012-07-23 15:05:40

+0

我將CSS添加到什麼?我曾嘗試在標題內容周圍放置一個div包裝,並將CD應用於該包,但隻影響了div ..不是標題容器。我將使用CSS來操縱文檔頭是什麼選擇器?謝謝馬克 – Jason 2012-07-23 15:12:40

+0

傑森,你將不得不嘗試。可能的高度,字體大小,行高等 – 2012-07-24 12:52:11

回答

1

使用在cfdocument標籤頁邊距設置來控制多少空間保留給頁眉或頁腳。

因此,在您的情況下,將margintop值從4更改爲較低的值。

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

爲了進一步控制標題的外觀(如填充,行高),您需要在標題內容中添加HTML和CSS樣式。

+0

THanks CFSimplicity ..運作良好。不允許像素級別的控制,但肯定會達到我需要的。謝謝! – Jason 2012-07-28 03:38:58

0

您可以在cfdocument中使用marginTop =「number」。

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