1

cfpdfsaveoption = "linear"或一起使用"full"。我看不出使用它有什么区别。如果有人知道这是什么意思,请在这里分享。谢谢你。

<cfoutput>
    <cfdocument name="myBook" format="PDF">
    <cfloop from="1" to="200" index="i">
        <h1>"Gandhi"redirects here. For the third prime minister of India, see Indira Gandhi. For other uses, see Gandhi (disambiguation).
        MahātmāMohandas Karamchand GandhiStudio photograph of Mohandas K. Gandhi, London, 1931.Born Mohandas Karamchand Gandhi2 October 1869Porbandar, Kathiawar Agency, British-ruled IndiaDied 30 January 1948 (aged 78)New Delhi, IndiaCause of death Assassination (gunshot)
        Monuments Raj Ghat,Gandhi SmritiNationality IndianOther names Mahatma Gandhi, Bapu ji, Gandhi jiEducation Bachelor of LawsAlma mater University College London[1]Inner TempleOccupation LawyerPoliticianActivistWriterYears active 1893–1948Era British RajKnown for Indian Independence Movement,Nonviolent resistanceNotable work
        </h1>
    </cfloop>
    </cfdocument>
</cfoutput>
<cfpdf action="write" source="myBook"   destination="res.pdf" overwrite="yes" saveoption="linear">
4

1 回答 1

1

来自https://cfdocs.org/cfpdf

  • PDF 输出的保存选项:
  • full:正常保存(默认)
  • 增量:保存对已签名 PDF 文档的修改时需要。
  • 线性:用于更快的显示。

“为了通过 Web 高效访问 PDF 文件,请线性化 PDF 文档。线性化 PDF 文件的结构方式是,在从 Web 服务器下载整个文件之前,会在浏览器中显示 PDF 文件的第一页。因此线性 PDF 文档几乎可以立即打开。”

我注意到您在问题中标记了 Lucee 以及 Coldfusion 的多个版本。请注意,当我写这篇文章时,有一个开放(但未经验证)的票证声称 saveoption="linear" 在 Lucee 上无法正常运行 - https://luceeserver.atlassian.net/browse/LDEV-2537

于 2019-11-01T14:28:48.787 回答