我生成一个非常基本的PDF,页眉和页脚如下:
<cfdocument format="PDF" pagetype="A4" unit="cm" scale="100">
<cfset template_stlye = fileRead(expandPath('love.css'))>
<cfdocumentitem type="header" evalatprint="true">
<cfif cfdocument.currentpagenumber eq 1>
<style type="text/css" media="screen">
<cfoutput>
#template_stlye#
</cfoutput>
</style>
<div class="pdf_header">
<div class="header_text">
I'm a lovely header
</div>
</div>
</cfif>
</cfdocumentitem>
<cfdocumentitem type="footer" evalatprint="true">
<cfif cfdocument.currentpagenumber eq 1>
<style type="text/css" media="screen">
<cfoutput>
#template_stlye#
</cfoutput>
</style>
<div class="pdf_footer">
<div class="footer_text">
I'm a lovely footer
</div>
</div>
</cfif>
</cfdocumentitem>
<style type="text/css" media="screen">
<cfoutput>
#template_stlye#
</cfoutput>
</style>
<div class="pdf_content">
<h1>Foo bar</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus dictum egestas lorem sed ultricies. Aliquam in orci eu massa semper tempor ac at nisi. Proin vestibulum dictum rhoncus. Mauris blandit congue auctor. Vestibulum sed fermentum nibh. Donec non nibh risus. Mauris vestibulum magna libero. Pellentesque vel lectus congue, eleifend sapien id, porttitor tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vivamus eget imperdiet eros, in congue massa. Curabitur eget massa aliquam, rhoncus ipsum vitae, rhoncus felis. Integer a aliquet sapien. Donec lacinia sem sed turpis pellentesque ultrices.
</p>
<p>
Aenean eget magna sodales eros ullamcorper consectetur. Maecenas varius est ac rhoncus gravida. Donec posuere rhoncus massa nec suscipit. Nullam vestibulum nunc quis nisi pharetra dignissim. Maecenas lobortis placerat sapien porta cursus. Pellentesque aliquet a massa id sodales. Curabitur massa felis, pellentesque volutpat molestie vel, mollis sit amet purus. Donec faucibus felis ut neque tristique vulputate. Phasellus facilisis lectus ac vestibulum vulputate. Vivamus quis convallis nibh. Pellentesque commodo dolor et velit volutpat ultricies. Vestibulum pharetra at nulla a pulvinar. Donec non rhoncus justo. Sed tempus, tellus sed consequat dictum, est lectus ultrices ante, a sagittis urna eros non lorem. Fusce quis sagittis diam, quis sollicitudin leo. Nulla ut dolor iaculis, fermentum turpis eu, fringilla tellus.
</p>
</div>
</cfdocument>
CSS文件:
.pdf_content {
font-size: 11pt;
font-family: Arial, Tahoma;
}
.header_text, .footer_text {
font-size: 10pt;
font-family: Arial, Tahoma;
line-height: 9pt;
text-align: center;
}
.pdf_header, .pdf_footer {
position: absolute;
top: 0.5cm;
width: 18cm;
}
任何想法,为什么会这样?
我正在使用:
答案 0 :(得分:0)
在some debugging efforts之后与同事设置进一步比较后,我们发现所包含的Java版本已经很老了,甚至不知道Windows 10。
之前的设置:
在向ColdFusion指出最新的JDK之后。
之后的设置:
PS:&#34;有趣的事实&#34;当改回包含的Java版本时,缩放问题不再可再现。 WTF