Add a watermark, the hard way

Ask a Question related to Adobe Acrobat SDK, Design and Development.

  1. #1

    Default Add a watermark, the hard way

    Hi.
    I've been drooling over the Acrobat 7.0 SDK documentation. It talks about an addWatermarkFromFile() function in JavaScript. You lucky, lucky, lucky people.
    I have Acrobat 6.0 (Pro). Ugh. You can add a watermark in the application, but there is no addWatermarkFromFile(). I had thought of using MenuItemExecute to work the menus...

    acrApp.MenuItemExecute "COMP:AddBack"
    SendKeys "%b"
    SendKeys MY_PATH & "MY_FILE.pdf"
    SendKeys "{ENTER}"

    However, the crafty dialog seems to be modal, ie the code halts at MenuItemExecute and waits for me to dismiss it before executing the SendKeys commands.
    Is there a way round this?
    Jon

    MS Office 2003
    MS Windows XP Pro SP2
    Adobe Acrobat 6.0 Pro
    Jon_Pyne@adobeforums.com Guest

  2. Similar Questions and Discussions

    1. Watermark
      How to remove watermark form an image,downloaded from net.
    2. Remove watermark
      Is it ever possible to remove a watermark from a PDF? We generate PDFs from InDesign and send watermarked versions to the client until we get paid. A...
    3. Watermark???
      Hello, How does one create an image thats nearly white/gray, as a watermark on an image in PS? I have an image for a community website. I...
    4. Picture over watermark
      I have a big watermark on a page. The page is constructed with tables. I want to put a photo over the watermark. The photo is shaped as an elipse....
    5. how hard to replace titanium internal hard drive? How to cloneold hard drive onto it?
      Hi all - I have a 2001 titanium laptop with a 20 Gig hard drive. The thing is getting too full and I'm toying with the idea of getting a bigger...
  3. #2

    Default Re: Add a watermark, the hard way



    Is there a way round this?




    Upgrade to Acrobat 9.
    Bernd Alheit Guest

  4. #3

    Default Re: Add a watermark, the hard way

    On Mar 31, 3:29*am, Jon_P...@adobeforums.com wrote:
    > Hi.
    > I've been drooling over the Acrobat 7.0 SDK documentation. It talks aboutan addWatermarkFromFile() function in JavaScript. You lucky, lucky, lucky people.
    > I have Acrobat 6.0 (Pro). Ugh. You can add a watermark in the application, but there is no addWatermarkFromFile(). I had thought of using MenuItemExecute to work the menus...
    >
    > acrApp.MenuItemExecute "COMP:AddBack"
    > SendKeys "%b"
    > SendKeys MY_PATH & "MY_FILE.pdf"
    > SendKeys "{ENTER}"
    >
    > However, the crafty dialog seems to be modal, ie the code halts at MenuItemExecute and waits for me to dismiss it before executing the SendKeys commands.
    > Is there a way round this?
    > Jon
    >
    > MS Office 2003
    > MS Windows XP Pro SP2
    > Adobe Acrobat 6.0 Pro
    ************************************************** **************************************************
    * Procedure: m_insertWatermark
    * Author: Larry Leo
    * Creation Date: 04/23/2008
    * Purpose: Add water mark to pdf document from another pdf
    document
    * Parameters: l_pInputFile - full path of pdf to be "water
    marked"
    * l_pWatermarkFile - full path of pdf file
    containing water mark to be used
    * l_pOutPutFile - full path of resulting pdf with
    water mark added
    * ALL PARAMETERS ARE REQUIRED STRINGS
    ************************************************** **************************************************
    * Modifications:
    * Date Init Reason
    * 04/14/2009 CLB Moved into PDF doc,
    ************************************************** **************************************************

    LPARAMETERS l_pInputFile, l_pWatermarkFile, l_pOutPutFile

    LOCAL l_opdDoc, l_oJSobj,l_nTotalDocs

    l_oAcrobat = CREATEOBJECT("AcroExch.App") && Acrobat
    l_opdDoc = CREATEOBJECT("AcroExch.PDDoc") && Document Object
    l_opdDoc.OPEN(l_pInputFile)

    l_oJSobj = l_opdDoc.GetJSobject && JavaScript Object
    l_nTotalDocs = ALEN(l_oJSobj.app.activedocs) && needed so we don't
    close acrobat if others are opened

    l_oJSobj.addWatermarkFromFile( ;
    l_pWatermarkFile ; && Watermark File
    , 0 ; && SourcePage
    , 0 ; && Start
    , 99999 ; && End
    , .T. ; && OnTop
    , .T. ; && OnScreen
    , .T. ; && OnPrint
    , 0 ; && HorizAlign 1000
    , 2000 ; && VertAlign 2000
    , 140 ; && HorizValue 40
    , 10 ; && VertValue -35
    , .F, ; && Percentage
    , .5 ; && Scale
    , .F. ; && FixedPrint
    , 0 ; && Rotation
    , 1.0) && Opacity

    * save file
    l_opdDoc.SAVE(21, l_pOutPutFile)
    l_opdDoc.CLOSE()

    IF l_nTotalDocs = 1
    l_oAcrobat.Exit()
    ENDIF

    l_opdDoc = NULL
    l_oJSobj = NULL
    l_oAcrobat = NULL

    RETURN
    scollaris@gmail.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139