문제

This sounds really simple, but I can't find a way to load a PDF into Cairo. I want to be able to do cairo.PDFSurface.create_from_pdf in the same way I do cairo.ImageSurface.create_from_png (yes I'm using the Python bindings but that's neither here nor there).

The documentation doesn't appear to give any hints.

도움이 되었습니까?

해결책

No, cairo cannot read PDFs. However, poppler can load PDFs an paint them onto a cairo context - http://poppler.freedesktop.org/

(Oh and create_from_png() is part of cairo's toy API. It works, but you are recommended to use some "real" API which can do more things than just loading PNGs)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top