PXC_Watermark

This Forum is for the use of 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, Andrew - Tracker Support, Tracker - Clarion Support, John - Tracker Supp, Support Staff, moderators

Post Reply
docu-track99
User
Posts: 495
Joined: Thu Dec 06, 2007 8:13 pm

PXC_Watermark

Post by docu-track99 » Wed Jun 25, 2008 4:27 pm

Hi, I'm trying to use the Watermark method to add different images to different pages of a pdf (so none of the constants will work), the problem is I can't use a page number for m_PlaceType that corresponds to one of the constants.

How am I suppose to watermark something onto the second page of a PDF?


m_PlaceType definition:
Specifies on which page(s) the watermark will be placed. May be a valid page number or one of the following constants:

Lzcat - Tracker Supp
Site Admin
Posts: 712
Joined: Thu Jun 28, 2007 8:42 am

Re: PXC_Watermark

Post by Lzcat - Tracker Supp » Thu Jun 26, 2008 7:16 am

Just read help file and do as described:
m_PlaceType should be PlaceType_Range
m_NumRanges should be 1 if you want to place only to ine page range.
m_Range should point to array of m_NumRanges * 2 DWORDs. They are treated as pairs, first two correspond first range and so on. First DWORD in pair is start page number, second - last included page, so if you need just one page in rage - start and last page numbers should be equal. Also note that page numbers are zero-based.
Victor
Tracker Software
Project manager

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.

docu-track99
User
Posts: 495
Joined: Thu Dec 06, 2007 8:13 pm

Re: PXC_Watermark

Post by docu-track99 » Thu Jun 26, 2008 2:07 pm

I've added the range properties to my watermark code as seen below, but it always returns an error of -2113404927 - Invalid Argument. I'm pretty sure it isn't any of the other values since when I say the m_PlaceType = PlaceType_AllPages it works. Any pointers you have on translating your examples into VB6 would be very helpful. (I've looked through the VB6 Examples provided, none of them use a range for watermarking.)

VB6 Code:

Dim nPageRange(0 To 1) As Long
'Ranges
Watermark.m_NumRanges = 1
nPageRange(0) = 0
nPageRange(1) = 0
Watermark.m_Range = VarPtrArray(nPageRange())

Lzcat - Tracker Supp
Site Admin
Posts: 712
Joined: Thu Jun 28, 2007 8:42 am

Re: PXC_Watermark

Post by Lzcat - Tracker Supp » Fri Jun 27, 2008 6:10 pm

Here is updated Watermark sample which places watermark always for first page (or any other if you modify code) using page ranges. See comments in Sub OKButton_Click() in WatermarkDlg form. Not so simple, but for now I don't know better way to handle this.
Attachments
PXCPro_Demo.zip
(53.14 KiB) Downloaded 227 times
Victor
Tracker Software
Project manager

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.

docu-track99
User
Posts: 495
Joined: Thu Dec 06, 2007 8:13 pm

Re: PXC_Watermark

Post by docu-track99 » Fri Jun 27, 2008 6:23 pm

Thank you very much! Works perfectly.

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

Re: PXC_Watermark

Post by John - Tracker Supp » Wed Jul 02, 2008 8:54 am

Pleased all is now well.
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

Post Reply