mara004

Results 316 comments of mara004

Note that `__slots__` must be defined in the actual class body in order to be effective, that's very important. The above post-definition assignment does nothing except set a casual attribute,...

To my understanding, you can't use C++ with ctypes, because it does not result in a stable, FFI-bindable ABI (as opposed to C). You'll want something like pybind11 instead. See...

I think the image is nested in a Form XObject, which is not handled by the `.images` accessor. ~~But apart from that, the image is not visible on the page...

There have been various reports about images nested in XObjects in the past. Maybe see https://github.com/pikepdf/pikepdf/issues/423#issuecomment-1396252772

> @mara004 according to this issue https://github.com/mozilla/pdf.js/issues/16073#issuecomment-1437080274 16 0 obj is an image with huge dimensions. Is this image invisible? According to PDFium, your actual image is 2x2 pixels, i....

And this is the rendered image (again using PDFium for my simplicity): `$ pypdfium2 extract-images test.pdf -o out/ --use-bitmap --render` [test_1.png](https://user-images.githubusercontent.com/65915611/220169925-1a395fa1-91f9-4457-8666-d6c7a7fe1711.png)

Ah, the image are the three arrows, right? Then it's actually visible. I was confused by the coordinates, but it makes sense if they're relative to the Form XObject.

What do you mean by resizing? Making the image visually smaller, or downsampling it?

In either case, see https://pikepdf.readthedocs.io/en/latest/topics/images.html#replacing-an-image

Just PdfImage(raw_image) I suppose