I am working on a converter that will extract and stitch a number of JPG files together into a single PDF file and lay text on top of it. This works fine but my problem is that the PDF file is very big, about 5 to 10 times the size of the JPG files combined. I wondered if I should take a different approach or could add some code to compress the images in the resulting PDF?\
This is a simplified code example of what I am doing so far: