Developer Tools
|
Office Productivity Applications
|
Enterprise Solutions
|
|||||||||||||||||||||||||||
Important
This product has been discontinued. Please check our old products page for more information.
Document watermarks are implemented in a wide variety of ways and for a number of reasons. Some watermarks are placed so prominently that they are hard to miss, such as a "CONFIDENTIAL" strewn diagonally across a page. Some others are so subtle that they are seen as an easy, low-cost security measure, somewhat similar to those on paper. Most people typically use watermarks to add an official logo or seal, or to simply identify the contents of the documents as "draft" or "not to be filed."
The Gnostice Print2eDoc "application" was designed to suit such diverse requirements. It uses watermark profiles to store different watermark settings. A watermark profile can contain several watermark items, both text and images - each with its own position, dimension, and alignment settings.
Gnostice Print2eDoc SDK allows you to perform all watermark application and maintenance tasks entirely through code.
The following code snippet demonstrates how to create watermark items, add them to a watermark profile, and then use that watermark profile when converting a document.
Dim PrinterObj As New gtPrint2eDoc Dim AProfile As gtProfileSettingsX 'Declare a watermark profile object Dim AWatermarkProfile As IgtWatermarkProfileX 'Declare a text watermark object Dim ATextWatermarkItem As IgtTextWatermarkX 'Declare an image watermark object Dim AImageWatermarkItem As IgtImageWatermarkX 'Create a new watermark profile object Set AWatermarkProfile = _ PrinterObj.CreateWatermarkProfile("NewWatermarkProfile1", _ True) 'Create a new text watermark item object Set ATextWatermarkItem = _ PrinterObj.CreateTextWatermarkItem("Text1") 'Specify settings for the text watermark item With ATextWatermarkItem .Text = "Gnostice" .Font.Name = "Monotype Corsiva" .Font.Size = 44 .TextColor = RGB(0, 0, 200) .RectColor = RGB(150, 200, 255) .Angle = 45 .HorizontalAnchorPoint = apCesnter .VerticalAnchorPoint = apMiddle End With 'Add the text watermark item to the watermark profile AWatermarkProfile.AddTextItem ATextWatermarkItem, True 'Create a new image watermark item and assign it Set AImageWatermarkItem = _ PrinterObj.CreateImageWatermarkItem("Image1") 'Specify settings for the image watermark item With AImageWatermarkItem .ImagePath = "C:\sample_image.bmp" .Height = 3.72 'Height and weight are dependant on .Width = 5.21 'MeasurementUnit property of current profile .HorizontalAnchorPoint = apCenter 'Horizontal alignment .VerticalAnchorPoint = apMiddle 'Vertical alignment .X = 0 'Displacement along X axis .Y = 0 'Displacement along Y axis .Angle = 45 'Rotatation angle End With 'Add the image watermark item to the watermark profile AWatermarkProfile.AddImageItem _ AImageWatermarkItem, True 'Load a custom profile PrinterObj.SelectCurrentProfile("xyz") 'Get current profile object Set AProfile = PrinterObj.CurrentProfile With AProfile .WatermarkOverlay = True .WatermarkPageRange = prAllPages .WatermarkMeasurementUnit = muInches 'Set current watermark profile .WatermarkSelectedProfile = "NewWatermarkProfile1" .WatermarkEnabled = True End With PrinterObj.ApplyChangesToCurrentProfile 'Print the document PrinterObj.PrintWordDocument ("C:\input.doc")
In this code snippet, a watermark profile consisting of an image item and a text item is created. The watermark profile is set as the current watermark profile of the current document creation profile. Thus, when a document is converted, the output document is created with all watermarks specified in the new watermark profile.
| Privacy | Legal | Feedback | Newsletter | © 2002-2010 Gnostice Information Technologies Private Limited. All rights reserved. |
This site is best viewed on a screen with minimum resolution of 1152 x 864 pixels. Windows users are advised to use Microsoft ClearType Tuning for optimal experience. Linux and other users can enable font smoothing, as supported by their OS. Also, please use the latest version of a standards-compliant browser such as Opera, FireFox, Chrome or Safari.