Copy link to clipboard
Copied
Running:
I have 2 questions regarding PDFs.
1) Will the watermarking not work in developer edition because of the Adobe watermark that is already there or am I doing it wrong?
<cfpdf action="addwatermark" source="reports/#FileName#" image="text.tiff"
destination="c:\Inetpub\wwwroot\admin\reports\#FileName#" overwrite="yes">
2) Is there any way to lock down a PDF file? I'm writing tables of text and I want to make it so users can't select the text, is this possible?
The Coldfusion Developer Edition watermark is a large
white rectangle
Oh yeah, I forgot about the big white rectangle issues Any difference if you use foreground=true?
Copy link to clipboard
Copied
source="reports/#FileName#" image="text.tiff"
No, it works even under the developer edition. Perhaps one of your paths is off?=. Have you tried using absolute file paths?
2) Is there any way to lock down a PDF file? I'm writing
tables of text and I want to make it so users can't select
the text, is this possible?
Cfpdf allows you to disable certain features like copying by using action="protect". See the "permissions" section of the documentation for a complete listing. Just keep in mind these settings are not bullet proof. A determined user can find a way around such restrictions.
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7995.html
Copy link to clipboard
Copied
Thanks for the help, the link you provided answered all the questions I had concerning PDF protections.
I am still having problems with the watermarking. I used absolute pathing and still no dice. Here's the code I'm using, that I took a snippet of from a tutorial I can't find at the moment.
<cffile action="write" output="#HOLPDF#" file="c:\Inetpub\wwwroot\admin\reports\#FileName#">
<!--- Create a blank image that is 500 pixels square. --->
<cfset myImage=ImageNew("",500,500)>
<!--- Set the background color for the image to white. --->
<cfset ImageSetBackgroundColor(myImage,"white")>
<!---Clear the rectangle specified on myImage and apply the background color. --->
<cfset ImageClearRect(myImage,0,0,500,500)>
<!--- Turn on antialiasing. --->
<cfset ImageSetAntialiasing(myImage)>
<!--- Draw the text. --->
<cfset attr=StructNew()>
<cfset attr.size=50>
<cfset attr.style="bold">
<cfset attr.font="Verdana">
<cfset ImageSetDrawingColor(myImage,"blue")>
<cfset ImageDrawText(myImage,"IPSUMDIPSUM",100,250,attr)>
<!--- Write the text image to a file. --->
<cfimage action="write" source="#myImage#" destination="text.tiff" overwrite ="yes">
<!--- Use the text image as a watermark in the PDF document. --->
<cfpdf action="addwatermark" source="c:\Inetpub\wwwroot\admin\reports\#FileName#" image="c:\Inetpub\wwwroot\admin\text.tiff"
destination="c:\Inetpub\wwwroot\admin\reports\#FileName#" overwrite="yes">
Copy link to clipboard
Copied
You were right, the watermarking does work. I tried it with a gigantic image and it only shows around the edges of the page. The Coldfusion Developer Edition watermark is a large white rectangle that takes almost all the page, and adding a watermark places it under the existing watermark.
EDIT:
Using foreground="yes" lets you show the watermark on top of the Adobe watermark.
Copy link to clipboard
Copied
The Coldfusion Developer Edition watermark is a large
white rectangle
Oh yeah, I forgot about the big white rectangle issues Any difference if you use foreground=true?
Copy link to clipboard
Copied
EDIT: Using foreground="yes" lets you show the watermark on top of the Adobe watermark.
Oh, duh! I see you figured it out. Unfortunately edits are only visible via the web interface and I usually respond via email instead.