Hi,
As title, I need a feature like the redact in export setting, but is paste a watermark instead of overlay with black. There is detail idea as following:
1. retrieve the coordinate of specified field
2. add a watermark beside it after data verification
3. export to a searchable PDF
My problem are how can get the coordinate in FC11 and is there a simplest way to put a watermark on document.
If any one know one of above or other suggestions are appreciated.
As title, I need a feature like the redact in export setting, but is paste a watermark instead of overlay with black. There is detail idea as following:
1. retrieve the coordinate of specified field
2. add a watermark beside it after data verification
3. export to a searchable PDF
My problem are how can get the coordinate in FC11 and is there a simplest way to put a watermark on document.
If any one know one of above or other suggestions are appreciated.
Comments
8 comments
I guess what you are asking about is possible to do at the custom script stage which can be run e.g. after verification.
After recognition you can access all field coordinates via the corresponding IField objects. The whole page image can be obtained via IPage.Picture. As soon as you obtain the page image, you can create its editable copy using CreateEditableCopy method and then replace certain field region by a watermark image (that is, modify a part of the picture object programmatically) and then call IPage.ReplaceImage to apply modifications to a document page.
For more details about mentioned objects and methods please refer to FlexiCapture Help, Appendix > Using scripts in ABBYY FlexiCapture > Scripts for customizing processing stages > Objects.
Thanks for your reply of complete procedure in advance.
I can extract the coordinate of fields with "me.Field.Regions(0).SurroundingRect." now. Is the custom script stage mean event handlers(after document state changed) in project properties? It is sorry that I am confused when to use it among rule script/rule global script module/export global script module and event script. Can IPage.Picture.CreateEditableCopy and IPage.ReplaceImage excute with only one script? Or, it need to separate to several script in different stage?
I will do my best to study how to use those method first. Frankly speaking, I don't have enough confident to achieve it at once.
Custom script stage is a part of advanced workflow. In batch properties find workflow tab and change workflow type to advanced, then you will be able to create additional processing stages such as script stages.
Regards
Tim
Why the FC11 standalone workflow only "skip verification and data verification if percentage of..................." but the FC11 distributed has drop list can choose?
FC11 standalone doesn't support any advanced workflow settings so there is no way to create custom processing stages, if you have FC11 standalone you will need to use events in order to adjust document images.
Regards
Timur
I have added a custom stage in batch properties, but where can I write script in this stage? It seems can't add scripts if I select this custom stage and click edit.
You have added an export stage, scripts can only be added in automatic stage.
When adding a stage, you are promted a dialogue where you need to select "automatic" stage type. This type of stage allows you to add scripts for batch or documents processing.
Regards
Tim
There is my test code, this script seems correct when I click check. Should I right about the Katja's suggestion? How to load and add a watermark on specified coordinate or field in next step? If field is need, I can create a empty field in target region in FLS.
int x,y = 100; //assume coordinate of target field = 100,100
IPictureObject image = Document.Pages[0].Picture;
IPictureObject image_modified = Document.Pages[0].Picture.CreateEditableCopy();
///////////////below is modify the image////////////////
Document.Sections[0].Field("TaegetFeildName").Regions[0].Picture = IPictureObject watermark;
//I don't make sure this pseudocode is workable or not
/////////////////////////////////////////////////////////////
Document.Pages[0].ReplaceImage(image_modified);
Please sign in to leave a comment.