28-11-23 01:57 PM
Dear Community,
Need your suggestion for below POC,
Requirement:
Need to download PDF documents from one of the web application, after that we need to need to open one by one PDF documents and then crop the signature at bottom of the document and save it in black and white background with TIF format. Later save the image with below size.
Size: image size should be equal to 32 KB or within 32 KB.
Requesting you to provide your suggestion on this.
05-12-23 12:07 PM
Off the top of my head - interface with the PDF as a windows application, spy the whole window, use get image action in the windows interface.
Next use the Image Manipulation object to cut part of that image out into a small image - which you can only do if the signature is always in the same place on the PDF. If the signature can be anywhere in the document than you need to look into AI machine learning logic outside of the BP product. If the signature is always in a certain area you might be able to come up with some logic searching for non-white pixels to get the area of the image you want to grab (probably a day or so playing around for you just there!)
The Image Manipulation object has some save format options, if tiff is not one of them you will need to create a new action for it - do a google search for ".net save image as tif" to find the code you would need to use.
As for image size, no idea. There may be code you can do to ensure black and white image and to decrease quality - I don't have anything like that in my back pocket any more. The File Management object may have something for you to check file size, otherwise do a google search on ".Net code file size" to get something.