Add watermark/stamp to document
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
Add watermark/stamp to document
Hi!
Is it possible to add a watermark(for example a text), to the document when displaying it in the viewer sdk control?
Thanks for the information in advance!
-------------------EDITED
I found the stamps in pdfxchange viewer, and maybe it's enough for us, but I can't add stamp to the document .
I read the documentation, but found only how to set the properties of the stamp, but it won't add stamp to the document automatically.
I tried this:
PDFXCview.SetProperty("Commenting.Stamp.Styles[0].Type", "Expired");
PDFXCview.SetProperty("Commenting.Stamp.Styles[0].Opacity", 0.5);
I think I have to call PDFXCview.DoVerb with the right parameters, to add the stamp to the document.
Could you help me in this, how to add the stamp to the document?
--------------------------
Best Regards,
Zoli
Is it possible to add a watermark(for example a text), to the document when displaying it in the viewer sdk control?
Thanks for the information in advance!
-------------------EDITED
I found the stamps in pdfxchange viewer, and maybe it's enough for us, but I can't add stamp to the document .
I read the documentation, but found only how to set the properties of the stamp, but it won't add stamp to the document automatically.
I tried this:
PDFXCview.SetProperty("Commenting.Stamp.Styles[0].Type", "Expired");
PDFXCview.SetProperty("Commenting.Stamp.Styles[0].Opacity", 0.5);
I think I have to call PDFXCview.DoVerb with the right parameters, to add the stamp to the document.
Could you help me in this, how to add the stamp to the document?
--------------------------
Best Regards,
Zoli
- Tracker Supp-Stefan
- Site Admin
- Posts: 17941
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Add watermark/stamp to document
Hello Zoli,
You can add a stamp using JS code in our Viewer.
The below sample is taken from the JavaScript for Acrobat API Reference :
And in the sample projects included with the SDK you should be able to see how to execute JC code in our Viewer.
Best,
Stefan
You can add a stamp using JS code in our Viewer.
The below sample is taken from the JavaScript for Acrobat API Reference :
Code: Select all
var annot = this.addAnnot({
page: 0,
type: "Stamp",
author: "A. C. Robat",
name: "myStamp",
rect: [400, 400, 550, 500],
contents: "Try it again, this time with order and method!",
AP: "NotApproved" });
Best,
Stefan
Re: Add watermark/stamp to document
Hi!
Thank you very much for your reply. Good to know that, I can run javascript with your viewer .
Unfortunately it's not fully what I want, but almost .
The problem is that I can select the stamp, after I inserted it to the document. For example the user can move with grabbing, and when he zoom into the document, he can't scroll with his mouse by grabbing the document, because he selects automatically the stamp instead of the document.
So is it possible to make the stamp not selectable somehow?
Or Could you write me, how can I put a watermark to our document like "demo version" , with custom text. Maybe this would be the best solution for us, instead of stamps.
I saw this in the js api reference, what you linked: (addWatermarkFromText), but I can't use it .
Thanks for your help in advance!
Best Regards,
Zoli
Thank you very much for your reply. Good to know that, I can run javascript with your viewer .
Unfortunately it's not fully what I want, but almost .
The problem is that I can select the stamp, after I inserted it to the document. For example the user can move with grabbing, and when he zoom into the document, he can't scroll with his mouse by grabbing the document, because he selects automatically the stamp instead of the document.
So is it possible to make the stamp not selectable somehow?
Or Could you write me, how can I put a watermark to our document like "demo version" , with custom text. Maybe this would be the best solution for us, instead of stamps.
I saw this in the js api reference, what you linked: (addWatermarkFromText), but I can't use it .
Thanks for your help in advance!
Best Regards,
Zoli
- Tracker Supp-Stefan
- Site Admin
- Posts: 17941
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Add watermark/stamp to document
Hi Zoli,
Please check the readOnly property for annotations - and set it to True for the ones you create - this way they would display but would not interact with the user in any way.
Best,
Stefan
Please check the readOnly property for annotations - and set it to True for the ones you create - this way they would display but would not interact with the user in any way.
Best,
Stefan
Re: Add watermark/stamp to document
Hi!
Thanks for the reply!
I tried it, but it's only make the annotation to unmodifiable, so the user is not able to remove or resize it, but he can select it, so it isn't good .
I checked all of the properties of the annotation, but I found nothing which makes the annotation unselectable for the user.
Do you have any other idea? Or what about to use watermarks, it's impossible?
Thanks for your help in advance!
BR,
Zoli
Thanks for the reply!
I tried it, but it's only make the annotation to unmodifiable, so the user is not able to remove or resize it, but he can select it, so it isn't good .
I checked all of the properties of the annotation, but I found nothing which makes the annotation unselectable for the user.
Do you have any other idea? Or what about to use watermarks, it's impossible?
Thanks for your help in advance!
BR,
Zoli
- Tracker Supp-Stefan
- Site Admin
- Posts: 17941
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Add watermark/stamp to document
Hi Zoli,
You can flatten the annotation after placing it - but this will flatten all annotations on a given page, so it might not be an elegant solution.
I am now checking with my colleagues for other possible options.
Best,
Stefan
You can flatten the annotation after placing it - but this will flatten all annotations on a given page, so it might not be an elegant solution.
I am now checking with my colleagues for other possible options.
Best,
Stefan
Re: Add watermark/stamp to document
Hi Stefan,
Thanks! I will try to flatten it, but yes it is not so elegant .
I'm waiting for the other possibility, thanks for checking it .
BR,
Zoli
Thanks! I will try to flatten it, but yes it is not so elegant .
I'm waiting for the other possibility, thanks for checking it .
BR,
Zoli
- Tracker Supp-Stefan
- Site Admin
- Posts: 17941
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Add watermark/stamp to document
Hi Zoli,
And please make sure you are creating copies of your files before adding/flattening annotations to them! As flattening is not a reversible process.
Best,
Stefan
And please make sure you are creating copies of your files before adding/flattening annotations to them! As flattening is not a reversible process.
Best,
Stefan
- John - Tracker Supp
- Site Admin
- Posts: 5219
- Joined: Tue Jun 29, 2004 10:34 am
- Location: United Kingdom
- Contact:
Re: Add watermark/stamp to document
Hi,
sorry to say - it is not possible to make the annotation 'Visible' but unavailable in the manner required - so the only solution is the one suggested by Stefan.
sorry to say - it is not possible to make the annotation 'Visible' but unavailable in the manner required - so the only solution is the one suggested by Stefan.
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
Best regards
Tracker Support
http://www.tracker-software.com
Re: Add watermark/stamp to document
Thanks for your replies!
I think the problem is solved!
I just call the "this.flattenPages()" at the end of the javascript, and it will flatten my annotations, so the user can't select it.
I don't have to backup my pdf files, because the pdf viewer sdk won't modify it. I added the stamp annotation, than flattened it, and after that I opened the pdf file again, and it was the same like before I added annotations.
So I think it works .
Thanks for the help again!
Best Regards,
Zoli
I think the problem is solved!
I just call the "this.flattenPages()" at the end of the javascript, and it will flatten my annotations, so the user can't select it.
I don't have to backup my pdf files, because the pdf viewer sdk won't modify it. I added the stamp annotation, than flattened it, and after that I opened the pdf file again, and it was the same like before I added annotations.
So I think it works .
Thanks for the help again!
Best Regards,
Zoli
- Tracker Supp-Stefan
- Site Admin
- Posts: 17941
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Add watermark/stamp to document
Hi Zoli,
Glad to hear that this works for you! But please make sure that you do not allow the user to manually attempt to save a file - or the stamps will be saved. (You can close the file without saving it, but if you are not intercepting the save command - a user could potentially hit Ctrl-S and save the file with the flattened annotation).
Best,
Stefan
Glad to hear that this works for you! But please make sure that you do not allow the user to manually attempt to save a file - or the stamps will be saved. (You can close the file without saving it, but if you are not intercepting the save command - a user could potentially hit Ctrl-S and save the file with the flattened annotation).
Best,
Stefan
Re: Add watermark/stamp to document
Thanks for reminding me!
I use this to disable the save function. With this the user can't save the pdfs right?
PDFXCview.SetProperty("Commands[\"Save\"].State", "Offline", 0);
BR,
Zoli
I use this to disable the save function. With this the user can't save the pdfs right?
PDFXCview.SetProperty("Commands[\"Save\"].State", "Offline", 0);
BR,
Zoli
- Tracker Supp-Stefan
- Site Admin
- Posts: 17941
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Add watermark/stamp to document
Hi Zoli,
You are welcome, and yes - this is the proper command.
Best,
Stefan
You are welcome, and yes - this is the proper command.
Best,
Stefan