watermarks

If you are a VFP developer and have any questions about using our products from VFP here is the place to post them.
Post Reply
cj
Posts: 17
Joined: Tue Aug 15 2006

watermarks

Post by cj » Tue Aug 22 2006

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)

Code: Select all

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 '____'
.
.
.

cj
Posts: 17
Joined: Tue Aug 15 2006

Post by cj » Tue Aug 22 2006

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?

cj
Posts: 17
Joined: Tue Aug 15 2006

Post by cj » Tue Aug 22 2006

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
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan » Tue Aug 22 2006

Hello,

Here is the description of all the filenameoptions parameters you used.

1 : For NoPrompt
2: UseFileName
16 : EmbedFonts
64: PrintWatermark
128 : Multilanguage Support

I am not sure what the call to SET MEMOWIDTH TO 80 is used for.

As i see your code it should add a watermark to the PDF File. Please try running your code in debug mode and let me know what it gives you.

thanks.

cj
Posts: 17
Joined: Tue Aug 15 2006

Post by cj » Tue Aug 22 2006

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?

memowidth is a unrelated foxpro thing.

Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan » Tue Aug 22 2006

Hello,

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.

Hope this helps.

Post Reply