Watermark AutoSize

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
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Watermark AutoSize

Post by anovy » Tue Dec 13, 2011 11:25 am

Hi,
If I good understand, for the text watermarks the auto sizing (fit the watermark to page) is achieved by setting the nFontSize parameter to 0. However I cannot find in the documentation how to achieve similar auto sizing for the image watermarks.

And another question:
How I can for image watermarks switch off "keeping of aspect ratio"?

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

Re: Watermark AutoSize

Post by Tracker Supp-Stefan » Tue Dec 13, 2011 1:57 pm

Hello Anovy,

Looking at the documentation - you need to specify the dwWidth, dwHeight for an image based watermark - and the image will be stretched to fit the specified area, and will keep it's aspect ratio. Sorry - it seems there is no way to make it "auto Size" by default and for all different page sizes, nor to turn off the "Keep aspect" - but I will double check that with my colleagues.

Best,
Stefan

anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: Watermark AutoSize

Post by anovy » Tue Dec 13, 2011 2:50 pm

I'm asking because XChange printer allows this - see the Properties dialog, Edit image watermark - here are options 'Keep aspect ratio' and 'Fit to page' (i.e. auto size). All other options refer to some parameter in the AddImageWatermark method, however these two not.

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

Re: Watermark AutoSize

Post by Ivan - Tracker Software » Wed Dec 14, 2011 2:48 pm

There are two flags

Code: Select all

#define WATER_AX_IMAGE_FIT				0x0100
#define WATER_AX_IMAGE_NO_KEEP_ASPECT	        0x0200
if WATER_AX_IMAGE_FIT is specified in dwFlags passed to AddImageWatermark, watermark will fit the page (the same effect can be reached passing 0 as width or height)
Flag WATER_AX_IMAGE_NO_KEEP_ASPECT turns off keeping aspect ratio for the image.
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.

anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: Watermark AutoSize

Post by anovy » Thu Dec 15, 2011 12:32 pm

Thanks Ivan, all these options work perfectly as described. Will you document them?

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

Re: Watermark AutoSize

Post by Tracker Supp-Stefan » Thu Dec 15, 2011 1:11 pm

Hi anovy,

I will speak with Ivan, and if there isn't any reason why these shouldn't be publicly announced - you can be sure we will add them in the documentation.

Best,
Stefan

Post Reply