Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplaying a pdf document within a PySide python application
    text
    copied!<p>I have a python application using PySide, Qt and python. In my application I would like to open and display a pdf document, but have the viewer within the application and not using the default viewer on the operating system.</p> <p>I have not as of yet been able to find a widget which is capable of doing this or some example code. I have never used these tools before and this is my first Qt &amp; PySide application so I am sure there is a widget which is capable of this but that I am just not aware of it.</p> <p>I found this <a href="https://stackoverflow.com/questions/16315418/pdf-with-qwebview-missing-refresh-repaint-after-loading">post</a> and when I take the sample code I am unable to get any pdf to show and cannot replicate the behaviour of the poster, but I am using python 2.7.3, PySide 1.1.1 so perhaps this is why. The error that I get when trying to run the sample code in the other post is:</p> <p>QWebInspector: QSettings couldn't read configuration setting [resourceTrackingEnabled].</p> <p>and the pdfs I would like to render are saved locally, in the same directory as the the python script and not accessible via the web.</p> <p>Could somebody point me in the direction of some sample code or a Qt widget which I would be able to use to render a pdf?</p> <p>As an aside, I am not sure that it matters but the pdf will be generated using LaTeX.</p> <p>Edit --More information--</p> <p>The program has to run on both Windows and Mac OSX environments but it is just for a personal project which wont be distributed. Using PyQt is not an option as it is not compatible with the python editor that I use and PySide is the requirement. I have read the following <a href="http://qt-project.org/wiki/Handling_PDF" rel="nofollow noreferrer">link</a> but from what I understood under the Rendering section it said that the 3rd party libraries available worked with C, C++ and Qt not python or PySide but maybe I have misunderstood this?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload