开发者

Adding a text watermark

开发者 https://www.devze.com 2023-01-04 22:57 出处:网络
I\'ve learned how to add a watermark to a pdf. <cfpdf action=\"addwatermark\" image=\"NoteToSelf.png\"

I've learned how to add a watermark to a pdf.

<cfpdf action="addwatermark" image="NoteToSelf.png" 
    pages="1" 
    position="0,0" 
    showOnPrint="no"
    source="my.pdf" 
    destination="#myDir#\new.pdf" 
    overwrite="yes"
    opacity="10">

The way I read it, the watermark has to be an image. 开发者_开发技巧But NoteToSelf.png needs to be text that I've read from a database.

Q: How can I add text as a watermark?

Q: If I am required to use an image for the watermark, then how do I use the ImageNew tag to create an image of text?


ColdFusion 8.0.1 onwards you can supply text directly to the cfpdf tag:

<cfpdf action="addwatermark" position="10,10" text="I am the watermakr" source="pdfContent" rotation="90" foreground="yes">

If you are not on on 8.0.1 then you would need to use imageNew and the image write text functions and pass that in.

0

精彩评论

暂无评论...
验证码 换一张
取 消