Coldfusion 将水印图像添加到PDF附件

Coldfusion 将水印图像添加到PDF附件,coldfusion,Coldfusion,我有一个创建pdf附件的链接 <a href="filename.cfm?id=#id#" target="_blank">create pdf attachment</a> < >创建一个附加的PDF,我想在PDF的中间添加水印图像? filename.cfm文件 <cfsetting enablecfoutputonly="true"> <cfcontent type="application/pdf"> <cfheader name=

我有一个创建pdf附件的链接

<a href="filename.cfm?id=#id#" target="_blank">create pdf attachment</a>
< >创建一个附加的PDF,我想在PDF的中间添加水印图像? filename.cfm文件

<cfsetting enablecfoutputonly="true">
<cfcontent type="application/pdf">
<cfheader name="Content-Disposition" value="attachment;filename=nameoffile.pdf">

<cfdocument format="PDF" localurl="yes"
  marginTop="0.1" marginLeft="0.2" marginRight="0.2" marginBottom="0.1"
  pageType="custom" pageWidth="8.5" pageHeight="10.2">

  ...pdf content...
</cfdocument>

你看过使用cfpdf标签吗?它的一个选择是在PDF文档中添加水印

:

请注意,源属性可以是cfdocument变量

Add a watermark to a PDF document 

<cfpdf
required: 
    action = "addwatermark"
    source = "absolute or relative pathname to a PDF file|PDF document variable|cfdocument variable" 
one of the following: 
    copyfrom = "absolute or relative pathname to a PDF file from which the first page is used as a watermark" 
    image = "absolute or relative pathname to image file|image variable used as a watermark" 
optional:
    foreground = "yes|no"
    isBase64 = "yes|no"
    opacity = "watermark opacity"
    overwrite = "yes|no"
    pages = "page or pages to add the watermark"
    password = "user or owner password for the PDF source file"
    position = "position on the page where the watermark is placed"
    rotation = "degree of rotation of the watermark"
    showonprint = "yes|no">