Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Decrease PDF size. Compress images?
Decrease PDF size. Compress images? [message #49437] |
Fri, 09 February 2018 15:38  |
shockjockey
Messages: 3 Registered: July 2016
|
Junior Member |
|
|
Hello all!
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:
Image img = StreamRaster::LoadStringAny("C:\\path\\to\\jpg.jpg");
Report r;
r.SetPageSize(img.GetWidth(), img.GetHeight());
r.DrawImage(0, 0, img);
String pdf_contents = Pdf(r);
SaveFile("C:\\path\\to\\pdf.pdf", pdf_contents);
Thanks in advance for any pointers in the right direction that you might be able to give me!
[Updated on: Fri, 09 February 2018 15:49] Report message to a moderator
|
|
|
|
|
|
Goto Forum:
Current Time: Sat Apr 26 22:11:13 CEST 2025
Total time taken to generate the page: 0.00941 seconds
|