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.
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?
Specifies on which page(s) the watermark will be placed. May be a valid page number or one of the following constants:
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.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
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.)
Dim nPageRange(0 To 1) As Long
Watermark.m_NumRanges = 1
nPageRange(0) = 0
nPageRange(1) = 0
Watermark.m_Range = VarPtrArray(nPageRange())
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.