I'm trying to display a PDF I created (using fpdf2) in a Pyside6 app. There seems to be two roads there: I can use QWebEngineView with plugins enabled, in which I can inject the PDF raw bytes, which works. It is not ideal for me since there's a lot of UI involved ; I'd like something cleaner. Or I can use QPdfView. That widgets takes an QPdfDocument object from which it reads from. Unfortunately, QPdfDocument only have a .load() function that takes a filename. Since I'm looking to avoid disk writes there, I'm not interested in temporarly saving the file to disk to show it on the GUI. There's two signatures on the .load() function tho : Supported signatures: PySide6.QtPdf.QPdfDocument.load(PySide6.QtCore.QIODevice, /) PySide6.QtPdf.QPdfDocument.load(str, /) Here's the thing: I can't instantiate a QIODevice from Python, so I can't feed it PDF's bytes like a buffer (there's a .write() function that looks interesting). I've tried using BytesIO (from io package), but no luck there. Is there a way to create a QPdfDocument object from a PDF file's bytes? Thanks for your help! Continue reading...