I need to get the watermark functionality to work on my 2.06 version of PDF Converter. Right now it is saying missing operand on the setwatermark line. What's wrong?
Also does anyone know what the 16 and the 128 do in the filenameoptions line? (this code was written before my time here--I just need to add watermarks)
SET PRINT ON
SET DEVI TO PRINT
pdf=CREATEOBJECT("cdintf.cdintf")
pdf.driverinit("Amyuni PDF Converter")
pdf.filenameoptions=1+2+16+128+64
pdf.defaultfilename="c:\test.pdf"
pdf.setwatermark("Testing", "Arial", 32, 450, &HFF, 100, -100, False)
SET PRINTER TO NAME "Amyuni PDF Converter"
SET MEMOWIDTH TO 80
* --- Print Page Header
SET PRINTER FONT 'Arial',14 STYLE "B"
@ 1,80 say '____'
.
.
.
I've looked in the "Common Driver Interface" and "Amyuni PDF Converter" documentation files but can't get it to work. I understand that everything I set here is actually being set in the properties of the Amyuni printer driver. I see it has a check box for first page only too. Any idea how to get that checked from code?
Ok I got a "Testing" watermark (see code below). That's progress. But, I still want to know about the 16 and 128. Please someone?
Now I need to go from fixed test watermark of "Testing" to a pdf file c:\compad.pdf. I know the print driver has a setup for a pdf file to be used as the watermark. Any ideas how to do this in code?
Joan, thanks for the answers on the #s. I see now. There is no mention of the values in "Common Driver Interface.pdf" and in "Amyuni PDF Converter.pdf" they were listed in Hex values. How was I to know they needed to be used in decimal. I wish the manuals mentioned this.
Are you saying there is no programming way to use a pdf as a watermark other than a document merge?
Is there no way from the program to change the settings of the watermark options in the printer preferences box?
You can use the values of FileNameOptions() in either Hexadecimal or decimal, there is not 'must' in this.
For the watermark question:
adding a pdf file as a watermark is exactly merging this file to the original pdf. Why you prefer not to use the Merge() or MergeEx() functions?
Depending on the license of the PDF Converter you have, you might be able to set the watermark from the Printer Preferences. You can try to right click on your PDF Printer, choose Preferences and click on the watermark tab. In this tab you can specify to have a text watermak or a pdf file as watermak. If this si done you will not need to add the PDF watermark programmatically anymore.