watermark in API

PDF-XChange Drivers API (only) V4/V5
This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-XChange Printer Drivers SDK (only) - VERSION 4 & 5 - Please use the PDF-Tools SDK Forum for Library DLL assistance.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Post Reply
gjw31
User
Posts: 23
Joined: Wed Oct 18, 2006 4:40 am

watermark in API

Post by gjw31 »

Are any examples available that demonstrate adding watermarks via the API, not the SDK?

.NET preferable but anything will do.

thanks

gjw
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3549
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: watermark in API

Post by Ivan - Tracker Software »

You need to use method AddTextWatermark or/and AddImageWatermark of IPXCPrinter interface to add watermark. There are no ready examples for these functions, but we will make some and will send you.
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
gjw31
User
Posts: 23
Joined: Wed Oct 18, 2006 4:40 am

Re: watermark in API

Post by gjw31 »

Thank you; I have attempted to use this call with no success. Your proposed example/s will be most welcome.
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: watermark in API

Post by Corwin - Tracker Sup »

First you need to create watermark using AddTextWatermark (or AddImageWatermark). Then add watermark name (which you specified in sName) to the list of watermark names which will be added to the document. This can be done by using set_Option("Watermarks.Watermarks", sName). Finally, enable watermarks with set_Option("Watermarks.Enabled", true);
Sample project is attached to this message.
Attachments
PDFdriverAPIExample.zip
C# sample
(11.63 KiB) Downloaded 221 times
gjw31
User
Posts: 23
Joined: Wed Oct 18, 2006 4:40 am

Re: watermark in API

Post by gjw31 »

Thank you...works perfectly
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom
Contact:

Re: watermark in API

Post by John - Tracker Supp »

Excellent :)
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
atkrotschopf
User
Posts: 7
Joined: Wed Jan 12, 2011 8:29 am
Location: Germany

Re: watermark in API

Post by atkrotschopf »

Sorry i have to reanimate this Topic 8)

Addin a TextWatermark works perfect but I've some trouble adding an ImageWatermark.

I'm using this code:

Code: Select all

    
            With goPDFPrinter
            .Option("Watermarks.Enabled") = "YES"
                      
            .AddImageWatermark "Test", "C:\Users\Public\Pictures\Sample Pictures\Qualle.jpg", -1, 210, 297, 17, 0, 0, 0, 50, 28, 0, ""
            .AddTextWatermark "WM1", "AAAAAA", "Arial", 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 50, 28, 0, ""
            .Option("Watermarks.Watermarks") = "Test;WM1"
            .ApplyOptions 0
        End With
The TextWatermark is on the document but not the ImageWatermark.
The ImageWatermark should be over the complete page as a backgroung image.

I try to represent the typical business CI as a background of every document printed. The ImageWatermark must be on every page.

Thanks for help

btw 210;297 is the standard size of a german paper :D
atkrotschopf
User
Posts: 7
Joined: Wed Jan 12, 2011 8:29 am
Location: Germany

Re: watermark in API

Post by atkrotschopf »

I've just tried but without success.

The settings are identical to the TextWatermark which is working

Arne
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3549
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: watermark in API

Post by Ivan - Tracker Software »

Can you send me you image file? I cannot reproduce the problem with any of mine.
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
atkrotschopf
User
Posts: 7
Joined: Wed Jan 12, 2011 8:29 am
Location: Germany

Re: watermark in API

Post by atkrotschopf »

Hi Ivan,
this was the hit missing 8)

After I made the zip archive the file name was Jellyfish.zip and not qualle.zip
It seems that Microsoft Windows 7 64bit designates the images internally differently. Operating System is a german Windows 7 business x64.
I changed the name to Jellyfish.jpg and it works. A little weird just that it be named when entering the printer settings as a qualle.jpg have.
:evil: M$ :evil:
atkrotschopf
User
Posts: 7
Joined: Wed Jan 12, 2011 8:29 am
Location: Germany

Re: watermark in API

Post by atkrotschopf »

It's me again :oops:

Is there an option to deactivate the "fit and retain the aspect ratio"


dwWidth, dwHeight

Specifies the dimensions of the watermark. The image specified by the sImageFileName parameter will be resized to 'fit' within the specified area and will retain its aspect ratio.

I want the picture in the complete area no matter if it fits or something :wink:
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3549
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: watermark in API

Post by Ivan - Tracker Software »

I have added two flags to dwFlags parameter of AddImageWatermark function to control Fit and KeepAspect options.
Values for these flags are:

Code: Select all

#define WATER_AX_IMAGE_FIT               0x0100
#define WATER_AX_IMAGE_NO_KEEP_ASPECT    0x0200
These changes will be available from build 192 of the driver.
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
atkrotschopf
User
Posts: 7
Joined: Wed Jan 12, 2011 8:29 am
Location: Germany

Re: watermark in API

Post by atkrotschopf »

thanks a lot.

I feel like a little kid before christmas :)
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17901
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: watermark in API

Post by Tracker Supp-Stefan »

:) Kudos for Ivan,

And we are never too old to feel like a small kid before Christmas :)
(or prepare for it from January :P)

Cheers,
Stefan
atkrotschopf
User
Posts: 7
Joined: Wed Jan 12, 2011 8:29 am
Location: Germany

Re: watermark in API

Post by atkrotschopf »

i can hardly stand up the new version comes.
I hope it's before christmas 2011 8)
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17901
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: watermark in API

Post by Tracker Supp-Stefan »

Hi Arne,

Ivan said the next Build - so it will be a few weeks, and definitely before Christmas!
I do not have a more specific date for now, but usually a build date is announced just a few days before the actual release.

Best,
Stefan
atkrotschopf
User
Posts: 7
Joined: Wed Jan 12, 2011 8:29 am
Location: Germany

Re: watermark in API

Post by atkrotschopf »

hi stefan,
i'm trying to practice in patience :wink:
but it's so damn hard :lol:
greez arne
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17901
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: watermark in API

Post by Tracker Supp-Stefan »

:)
Post Reply