I just upgraded from SDK 8.2 to SDK 9.1. Code that worked to add watermarks to an exported document (PDF or TIFF) no longer works, as the DocumentExporter.Watermarktext property is no longer available. Is there an example of how to add watermarks with the new SDK ?
Question
Question
Replies
Thank you, Miruna. I am trying to instantiate a WatermarkSpecification object :
oLFWatermark = CREATEOBJECT(DocumentProcessor.WatermarkSpecification)
oLFWatermark.Text = "Whatever my Message Is"
oLFExporter.Addwatermark(oLFWaterMark)
I get no errors (yes, this is Foxpro - don't laugh), but I also get no watermark.
Any ideas ?
I know nothing about FoxPro, but could it be eating the errors? The namespace for DocumentProcessor 9.1 is "DocumentProcessor91", so if you are using version 9.1 now, I'd expect at least some error about that on the first line. If you are accidentally still using DocumentProcessor 8.2 with RA 9.1, I'd expect to see an error about DP82 not having a WatermarkSpecification class.
Sorry - mistyped the CREATEOBJECT line - I do have the DocumentProcessor91 specified. I did some more digging and the Watermark object is created, it's apparently the AddWaterMark that's failing or there's some property of the watermark that I'm not setting to make it visible.
BTW - I probably should have mentioned that I am working with PDFs. Don't know if that makes a difference.
When you say you're working with PDFs, you mean you have image documents in Laserfiche and are exporting them to PDF, right?
No, the documents are PDFs in LaserFiche and I am exporting them but want to put a watermark on them before presenting them to the user. The actual LaserFiche folder is not normally available to the user, but I am using a different login via the LFSO object to connect to the repository and export the document for the user to view. Long Story.
The Laserfiche SDK can't add watermarks to PDFs. The methods above only apply to exporting images (watermarks added to the image, then the image can be exported to a PDF).
OK - well that would explain it...Thanks for your help. I guess I have to find another way to do this...
You can convert the PDFs to image, then export the images, but that is sort of convoluted.
itextsharp is a 3rd party library that can edit PDFs directly.
Thanks - we have a third party tool - XFRX - that we are going to try and see if we can use to add the watermark. I will keep your suggestion in mind, though.
Can I use the PDFExporter DLL ? I have tried to instantiate objects with the DLL, but have been unsuccessful.