In this post i am going to show how we can crop an image and upload it in Documents Object of Salesforce.
I am taking a simple example and following the below mentioned steps:-
- Create a VF page which has a upload image link.
- on click of upload link i am opening a pop up of another VF page which is used to select image file from local system.
- now after selecting file click on upload button.
- after clicking on upload button magic is started now you can zoom-in, zoom-out or drag image and can easily select part of image you needed to upload in salesforce document.
- Finally on click of save button image is inserted in document object and pop up window is closed.
Screen Shoots:-
Upload Picture Page
On click of upload link opened popup page
choose picture from local system
selected picture get uploaded
Zoom Out picture
Zoom In Picture
Finally crop Picture
cropped picture saved
Hope this helps...happy Coding
Thanks
Anurag Jain
I am not able to get the picture when i am click the OK button on popup dialog box. I am using overall code but finally image does not display in that box. please give me suggestion
ReplyDeleteDid you get any other solution for this mani :)
DeleteHello Anurag,
ReplyDeleteCrop function is not working , can you help with this.
Thanks
can you share or mail me your code because this is a working code.
ReplyDeleteHey Anurag,
DeleteMy bad... code is working fine. I have some different requirement very similar to this will get back to you.
Thanks
Hi Anurag Jain.
ReplyDeleteThanks for greate work. Have you written a Test Class for the Image Cropper?
Best regards
Soren Klint