That should be achievable.
How do you intend to define the target document?
I do that all the time however you did not mention how you want to handle Aspect Ratio mismatches. I always size the pixels to fill the area up or down in size and maskoff any over fill. Sometimes I will also rotate the source area for a better aspect ratio match so landscapes are not made into portrait and portraits are not made into landscapes they wind up rotated 90 degrees instead. The result is like a centered crop. Here is a link to an example script and some documentation on it.