-
I'm testing this code, but it doesn't matter what values you put in set_dpi. As a test image I am using this one: https://www.pngarts.com/files/2/Orange-Abstract-Lines-Transparent-Background-PNG.png
Thank you in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
What do you want to achieve:
With all of the above, the image resolution has nothing to do. |
Beta Was this translation helpful? Give feedback.
-
It seems you want to give up image quality for the sake of inserted image size. |
Beta Was this translation helpful? Give feedback.
-
Yes.
No. I think that I can control it with rect.
It is pissible and the result pdf is more lightweight? I have tried using shrink, but the minimum reduction is half and, in some cases, it is too much. I will have a look at the documentation about pixmap constructors. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Thank you very much. It works like a charm. |
Beta Was this translation helpful? Give feedback.
If you insert the same image on multiple pages the logic automatically determines this and reuses the already embedded image.
It is however much faster to avoid the effort detecting this and use this kind of loop:
This is how to scale down continuously:
At the end, do not forget to save the document with garbage>=3, deflate=True