Help! I have a client that is supplying me with a ...
# cfml-general
p
Help! I have a client that is supplying me with a bunch of pdf files. I need to put a unique serial number on each one. Can I use cfdocument or cfpdf to do that?
b
Are you talking about adding metadata to the PDF or actually overlaying an image on top of a page?
p
Oh thanks for the reply! We just want to "stamp" a serial number to each one.
In the example: <*cfpdfparam* pages="2" coordinate = "397,532,519,564" iconname="Approved" note="my note goes here"/> Q: Does "my note goes here" show up in the pdf? I guess I can try it and find out.
Not metadata - we want it to appear on the printed document.
Maybe it's not using addStamp. I mean - I just need to print a number inside the document is all.
b
Yeah, I'm not sure. I assume this is possible, but I don't know if it's possible with CF's built in PDF tags. Also, whether you're using Lucee or Adobe CF will make a big difference here as they have very different PDF engines internally.
You can do a ton of stuff with DDX, but that's only supported on Adobe CF.
If you're using Lucee, I'd Google for Java examples of doing it directly with iText and then convert that to CF
c
the cfpdf addwatermark action looks like something else you could try (and possibly more flexibility with more options)
Copy code
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"> 
// one of the following: 
destination = "PDF output file pathname" 
name = "PDF document variable name" 
image = "image file name to be used as the footer" 
text = "text to be used in the footer"
p
It looks like action="addfooter" is the answer.
👍 1
Now I need to change the font and size...
m
Yeah if you're using ACF, you can do this with DDX. I think @pothys-mitrahsoft might have a link to a recent talk I did on PDF DDX workflows in ACF
p

https://youtu.be/p1GnZXohBYw