Skip to main content
Participant
December 1, 2008
Question

CFPDF action="addWatermark" ISSUE/BUG

  • December 1, 2008
  • 3 replies
  • 2164 views
Hello,

I am trying to add an image as a watermark into pdf file using the CFPDF tag. Here is the code:
quote:

<cfpdf action="addWatermark" source="template.pdf" image="bottle.jpg" destination="ad.pdf" overwrite="yes" foreground="yes" showOnPrint="yes" >



The source file is not password protected.
And I get always the following error:
quote:

An error occurred during ADDWATERMARK operation in <CFPDF>.
Error: The password provided is either wrong or does not have sufficient permission to perform this action.



I made the PDF password protected and used the password attribute in order to eliminate the pass protection error but it does not help.

Please help!
thank you!


    This topic has been closed for replies.

    3 replies

    Participant
    December 3, 2008
    Looks like the security functions of CFPDF also contain this bug. Each time I try to add security using the "protect" action for existing PDFs created in Acrobat 8 Pro, I receive the following error:
    -----------------
    An error occurred during PROTECT operation in <CFPDF>. Error: The password provided is either wrong or does not have sufficient permission to perform this action.
    -----------------
    This also occurs when I try to apply a watermark. If I try the same actions with a simple PDF without interactive elements (form fields) it works fine. I'm going to try to apply permissions with DDX next and will report back any success.

    Thanks,
    Merritt
    laheylaAuthor
    Participant
    December 2, 2008
    okay!
    I found something about this.

    A. I created the first (in the case above) source PDF using Adobe LiveCycle Designer 8.0, with three dynamic textfileds so I can update them later using CFPDFFORM. If I use this PDF to insert watermark I get the error message above.

    B. Than, I created plain PDF using Adobe Acrobat Proffesional, CFPDF/addWatermark works perfect. The sad thing is that I do not need just flat PDF, but with fileds on it.

    Unfortunatelly the addWatermark will not resolve my issue, because there is no option to set the size of the watermark/image inside of the PDF.

    What I need is:
    I have 1 PDF template and 1 JPG image.
    In the PDF template I have three dynamic textfileds.
    The goal is - to insert the jpg into the PDF (and to shrink/strech the jpg to fixed dimensions - I do not know in front, what the JPG size will be) and to fill into the fileds using CFPDFFORM.

    The final result - PDF with the inserted image and three fileds with new values.

    I have Coldfusion 8 on Microsoft Server 2003.
    I will really appreciate any help!
    Thanks!
    p.p. so still the bug is there if you do not have flat PDF (or maybe if it is created with the livecycle designer i do no know what is the case exactly).
    Inspiring
    December 3, 2008
    I do not see any addWatermark limitations in the documentation. So that sounds like a possible bug.

    AddWatermark does work with regular acrobat forms and with Live Cycle forms (using ddx anyway). One thing that comes to mind is you would probably want to flatten forms before applying a watermark. CFPDF does not support flattening live cycle forms. Perhaps that is related ..
    laheylaAuthor
    Participant
    December 3, 2008
    Yes I think it is a bug.
    It depends on how the PDF is created. I think if the PDF has dynamic fileds on it, CF throw the password error.
    Inspiring
    December 2, 2008
    Hi,

    Welcome to the Coldfusion Forums!...

    Have you installed the 8.0.1 updates?.. If not give it a try...

    laheylaAuthor
    Participant
    December 2, 2008
    Thank you, Daverms, I am glad to be a part of this ColdFusion forum! :)

    Yes, I have installed update 8.0.1, the current version is: 8,0,1,195765, and the code doesn't work.
    Do I need to install any other updates?
    Thank you!
    Angel