3

I need to add a dynamic watermark to my PDF document using javscript.

E.g: When a customer does not accept the terms and conditions of a particular document (which is a flag from database), I need to have a watermark "Denied" (say) on the pdf. This watermark should be 45 degrees rotated.

Please help. Thanks in advance.

Newman
  • 31
  • 3
  • It's going to take more than just Javascript to do it. http://acrobatusers.com/tutorials/watermarking-a-pdf-with-javascript – Robert Harvey Aug 12 '13 at 20:44
  • From what database? Should it be read from some RDBMS via javascript within the PD when the user opens it? – mkl Aug 12 '13 at 21:08
  • Are you sure Javascript within a PDF can access a database? And can your customers always directly access that database? – mkl Aug 13 '13 at 06:44
  • Well, that is already configured. I am wondering if a code snippet like this would work - if(this.getField(Field1).value == 0) { this.addWatermarkFromText({ cText: "DECLINED", nTextAlign:app.constants.align.center, cFont: "Helvetica-Bold", nFontSize:36, aColor: color.red, nStart: this.pageNum, nOpacity: 0.5 }); – Newman Aug 13 '13 at 14:42
  • Is the "from database" part misleading? In other words, at the time of applying the watermark, do you already have the value of the flag, i.e. code external to the watermark code has already made the database call? If so, please remove the "database" part, as that seems to have confused the answerers. I ended up asking [almost the same question](http://stackoverflow.com/questions/28335605/how-can-i-update-a-pdf-with-text-stamp-watermark-in-client-side-javascript). – Dan Dascalescu Feb 05 '15 at 03:40

0 Answers0