Mobility
1st May 2013, 08:30
Hi,
I've got following problem: My app creates several different kind of PDFs and problem is that file sizes are way too large. The PDFs include pictures that cause the problem. After debugging a while, I found out that if I just scaled the pictures into smaller size (scaledToWidth() ), the PDF size would be ok. Now the problem is that the PDF is created with "highResolution" which I think is 1200dpi and if I reduce the picture size, it will not fill the whole PDF width. As a result, I think I need to set the resolution of the QPainter for example to 600dpi, so that the picture can be scaled to smaller size and it will still fill the whole PDF width. But this is easier said than done because there are so much small details in the PDF, adjusted just in the correct place. I just would not like to do it all again, for every PDF type.
Is there any other way? Something that crossed my mind:
1. Could I somehow rescale the PDF after it's ready?
2. Copy PDF to another file with lower resolution?
3. Set the resolution to 600dpi in the beginning, but somehow change the coordinate system so that even text is written with the highResolution (1200dpi) coordinates, it would be written correctly to the 600dpi PDF?
4. Some other way?
PS. I'm using Qt's internal PDF libraries.
Cheers!
I've got following problem: My app creates several different kind of PDFs and problem is that file sizes are way too large. The PDFs include pictures that cause the problem. After debugging a while, I found out that if I just scaled the pictures into smaller size (scaledToWidth() ), the PDF size would be ok. Now the problem is that the PDF is created with "highResolution" which I think is 1200dpi and if I reduce the picture size, it will not fill the whole PDF width. As a result, I think I need to set the resolution of the QPainter for example to 600dpi, so that the picture can be scaled to smaller size and it will still fill the whole PDF width. But this is easier said than done because there are so much small details in the PDF, adjusted just in the correct place. I just would not like to do it all again, for every PDF type.
Is there any other way? Something that crossed my mind:
1. Could I somehow rescale the PDF after it's ready?
2. Copy PDF to another file with lower resolution?
3. Set the resolution to 600dpi in the beginning, but somehow change the coordinate system so that even text is written with the highResolution (1200dpi) coordinates, it would be written correctly to the 600dpi PDF?
4. Some other way?
PS. I'm using Qt's internal PDF libraries.
Cheers!