Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CFPDF Addwatermark using Text, change font size?

    I've been having lots of fun with trying to get a watermark to behave the way I want it to using CFPDF. I first tried an image...which looked bad, and caused printing issues with certain printer drivers. Then I tried using the new Text="Your Watermark text" property in a <CFPDF Action="addwatermark"> tag, and I have everything working almost perfectly except that I cannot for the life of me find out how to change the font size. Here's the code:

    Code:
    <cfsavecontent variable="myWatermark">
            	<body style="font-size:30pt;font-family:Arial;">
            	<p>Watermark Text</p>
            	</body>
            </cfsavecontent>
    
    	<cfpdf
    		action = "addwatermark"
    		source = "strFile"
    		text = "#myWatermark#"
    		foreground = "yes"
    		rotation = "45"
    		opacity = "2"
    		showonprint = "yes"
    		name = "strFile"
    	>
    The watermark comes out in Arial font at the desired angle and opacity, but it completely ignores the font-size:30pt; and I've tried placing that style attribute within the <p> tag as well as wrapping the text in a <font size='2'> tag, and nothing works. I even get errors when I try to use a plain <font> tag. I've tried using DDX and got the results I am after, but I dislike having to generate files, and would like to keep using a PDF variable if possible (which DDX doesn't seem to support).

    Anyone have any ideas?

    Thanks!

    Toby

  • #2
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can try using the 'height' and 'width' attributes which is used to make bounding box for the watermark. playing with different height and width values you will see the font-size change.


  •  

    Posting Permissions

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