-
Im using the library for 2 reasons. I need to convert a pdf to a jpg and also crop the pdf before the conversion. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Am I right to assume the pages of your PDF are in fact embedded JPEG images? However, note that |
Beta Was this translation helpful? Give feedback.
If the PDF pages in question do not consist of just an embedded image each, then there may be some fundamental misunderstanding in the first post.
What then do you mean by "I need the image file to have the same size and without losing quality"? PDFs are vector and images are raster, so rendering is by design a lossy operation that will create a bitmap of a certain size in pixels, and thereby a fixed displaying quality. Rendered bitmaps are bound to be bigger than the vector source in terms of file size.
to_pil()
does not take any such argument:pypdfium2/src/pypdfium2/_helpers/bitmap.py
Line 210 in ff2ff4b
If you mean P…