Add new water mark

This Forum is for the use of Clarion For Windows - Software Developers requiring help and assistance for Tracker Software's PDF-Tools SDK of Library DLL functions(only) - Please use the PDF-XChange Drivers API SDK Forum for assistance with all PDF Print Driver related topics.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software, Tracker - Clarion Support, John - Tracker Supp, Support Staff, moderators

Post Reply
terryhcw
User
Posts: 14
Joined: Wed Mar 30, 2005 4:00 pm

Add new water mark

Post by terryhcw » Sun Mar 24, 2013 3:47 pm

Hi

I under the demo example "pdfmgb41.app" to add a new water mark in the pdf file.

I add the following code, in the merger pdf file process :

PDF1.AddWatermarkAsText('test title', 'Arial', 12, TextRenderingMode_Fill, 0.0, 0, 0, PlaceType_Range, PlaceOrder_Background, TextAlign_Right+TextAlign_Top, 18, -18, 255, I)

It seems it cannot work. Is there a limitation of adding water mark in each pdf file? I try to add this in the top of the page, which can not work. But if I disable the page of page water and put the above in the bottom, it will work.

What is the meaning in the last "18, -18, 255" ?

I want to put a title in the top of the page and also the page of page in the bottom.

Regards

Terry Ho

Tracker - Clarion Support
Site Admin
Posts: 1412
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA
Contact:

Re: Add new water mark

Post by Tracker - Clarion Support » Mon Mar 25, 2013 9:59 pm

Hi Terry!

This is actually described in the documentation, in the section on method AddWatermarkAsText.

You need to be aware that PDF pages have their "origin" (the 0,0 point) at the bottom left of the PDF page, unlike Windows screens which have their origins at the upper left corner of the screen. Consequently, an increasing vertical (Y) coordinate in PDF terms is moving UP the page, not down the screen. Also, all measurements are in points, which are 1/72 inch.

The Watermarking subdivides the screen into a 3x3 grid. The six TextAlign_ constants define these. There are three vertical ones (TextAlign_Top, TextAlign_Middle, TextAlign_Bottom) and three horizontal ones (TextAlign_Left, TextAlign_Center, TextAlign_Right).

The two numbers following the parameter constructed from the TextAlign_ constants are Offsets from the origin of each grid. Just to make things more interesting, the origins depend on which grid box you are in. It's easy to remember, and described in the docs: the upper left box has its origin at the upper left corner of the box; the upper middle box has its centered on the top of the page; and so forth. The offsets are in points. The 18, -18 means (X) positive indent from the left side and (Y) down (minus) from the top. The 255 is opacity, which is the maximum value, completely opaque. You can get some interesting effects by adjusting color and opacity of a bookmark.
Craig Ransom
Tracker Software - Clarion Support
http://www.tracker-software.com

Post Reply

Return to “PDF-Tools SDK (DLL Libraries Only) - Clarion For Windows Developers Only Please”