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, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan

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

watermark in API

Post by gjw31 » Wed Oct 08, 2008 5:22 am

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

.NET preferable but anything will do.

thanks

gjw

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

Re: watermark in API

Post by Ivan - Tracker Software » Wed Oct 08, 2008 8:06 am

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: 25
Joined: Wed Oct 18, 2006 4:40 am

Re: watermark in API

Post by gjw31 » Wed Oct 08, 2008 8:26 pm

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: 670
Joined: Tue Nov 14, 2006 12:23 pm

Re: watermark in API

Post by Corwin - Tracker Sup » Mon Oct 13, 2008 2:03 pm

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 173 times

gjw31
User
Posts: 25
Joined: Wed Oct 18, 2006 4:40 am

Re: watermark in API

Post by gjw31 » Mon Oct 13, 2008 10:38 pm

Thank you...works perfectly

John - Tracker Supp
Site Admin
Posts: 8205
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Re: watermark in API

Post by John - Tracker Supp » Wed Oct 15, 2008 3:25 am

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 » Wed Jan 12, 2011 9:39 am

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 » Wed Jan 12, 2011 1:40 pm

I've just tried but without success.

The settings are identical to the TextWatermark which is working

Arne

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

Re: watermark in API

Post by Ivan - Tracker Software » Wed Jan 12, 2011 3:45 pm

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 » Wed Jan 12, 2011 3:56 pm

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 » Wed Jan 12, 2011 4:03 pm

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:

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

Re: watermark in API

Post by Ivan - Tracker Software » Thu Jan 13, 2011 5:16 pm

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 » Wed Jan 19, 2011 9:39 am

thanks a lot.

I feel like a little kid before christmas :)

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 14154
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: watermark in API

Post by Tracker Supp-Stefan » Wed Jan 19, 2011 11:15 am

:) 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 » Wed Jan 19, 2011 11:18 am

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: 14154
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: watermark in API

Post by Tracker Supp-Stefan » Wed Jan 19, 2011 11:21 am

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 » Wed Jan 19, 2011 11:29 am

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: 14154
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: watermark in API

Post by Tracker Supp-Stefan » Wed Jan 19, 2011 3:39 pm

:)

Post Reply