Sorry, I am not sure I understand. If your converted image is 200 px smaller in height than the area you want to fill, then it needs to be padded or some of your background will show. If you leave it at 2000x700, you can use -gravity center before the -compose, if your region of the background is centered
The first thing you need to do is to get the right density so that your resulting images will be 2000xH, where we do not know yet the height. So convert the first page to jpg and see what size it comes out.
then you can compute the needed density as density=72*2000/width, where 72 is nominal dpi and width is the width of the resulting jpg.
Or you can use a large density and resize down to 2000, such as
Code: Select all
convert -density 300 image.pdf -resize 2000x2000 image.jpg
This will make either the width or height of the result 2000 depending upon the pdf aspect ratio and the other dimension will be smaller in proportion. The disadvantage is that it will be slower, but the result will be higher quality.
Once you have the right size, you can just composite it in the center of the background
Code: Select all
convert backgroundimage image-N.jpg -gravity center -compose over -composite result-N.jpg