Aspose Slides: Responsive slider with fixed slide width

H,
I would like to create a slides by a pdf file.
I would like to fix the width and calculate automatically the height
I am doing this:

int targetWidth = 1920;

for (int pageCount = 1; pageCount <= pageCollection.size(); pageCount++){
String name = pattern + pageCount + “.jpg”;
// Create stream object to save the output image
OutputStream imageStream = new FileOutputStream(imgOutputDirPath + File.separatorChar + name);
// Create Resolution object
Resolution resolution = new Resolution(100);
// Create JpegDevice object where second argument indicates the quality of resultant image
JpegDevice jpegDevice = new JpegDevice(targetWidth,targetHeight,resolution, 100);
// Convert a particular page and save the image to stream
jpegDevice.process(pageCollection.get_Item(pageCount), imageStream);
// Close the stream
imageStream.close();
}

How I can calculate the targetHeight?
Thanks a lot

@cateshop18,

Can you please share your requirements in form of sample so that we may further investigate to help you out.