My goal is to create a pdf viewer that can select a text in the viewer.
is it possible?
i'm only experienced using wxpython for deleveloping gui application. I just heard poppler can support rendering pdf, but i did not found any snippet or example. please help.
If you are looking for how to create a wxPython PDF viewer, I've found a couple of examples. The first one uses Poppler as you mentioned in conjunction with wxPython:
http://code.activestate.com/recipes/577195-wxpython-pdf-viewer-using-poppler/
It's a pretty old example, so I don't know how well it works now. The other one I found uses PyMuPDF and fitz and was published this year (2016):
http://code.activestate.com/recipes/580621-wxpython-pdf-viewer-using-pymupdf-binding-for-fitz/
If you happen to be on Windows, wxPython comes with an ActiveX wrapper around Adobe's reader. You can read more about it here:
https://wxpython.org/Phoenix/docs/html/wx.lib.pdfviewer.viewer.pdfViewer.html
Related
I'm starting with tkinter with Python3 and I found some issues in Ubuntu practising with the exercises when coming to icons.
I'm reading Mark Lutz's "Programming Python" and he uses a ".ico" file, but it does not work in Ubuntu. I got curious and started to search on the web, and it seems that few icon formats work (.xbm) in Ubuntu, less in color mode.
I was googling and also found that using PIL or pillow is useful for managing and using color icons in tkinter applications and GUIs, but I didn't found yet any piece of code or detailed explanation on how to use an ".ico" file for an icon in a tkinter GUI in a portable way.
I find pretty weird as well not finding some reusable piece of code or library/module which takes a graphics file and returns some kind of usable icon object ready for being used.
Any reccomendation? Am I searching badly?
I suppose a good alternative is having some software to convert formats, but I would prefer the best code-oriented solution with multiplatform applications in mind and as many supported formats as possible.
Edit: For making this clear, when I talk about icons, I'm referring to icons, those little images in the top-left corner of our windows or in the OS bar when minimized. This isn't about any other kind of image in labels, buttons or other widgets (I don't even think that should be called an icon)
Thanks in advance
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.
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 & PySide application so I am sure there is a widget which is capable of this but that I am just not aware of it.
I found this post 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:
QWebInspector: QSettings couldn't read configuration setting [resourceTrackingEnabled].
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.
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?
As an aside, I am not sure that it matters but the pdf will be generated using LaTeX.
Edit --More information--
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 link 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?
I'm building a Gtk3 application using Python. I was wondering if there was a standard way for building and displaying inline help (the manual). More specifically:
What text format should I use for storing it (html? XML? other?)
How should I display it? I need to be able to browse the contents, the search for specific terms, to display formatted text with images, and to open the help window at a specific location when the user request online help about a specific part of the user interface.
Finally, in the ideal case, it should be cross-platform (e.g. I plan to port it to Windows)
Didn't know your app needed to be multiplatform. Be careful, because GTK3 on Windows is quite difficult to use for the time being (AFAIK there are no official installer either for GTK3 nor PyGObject on Windows, only community stuff).
On Linux, GNOME uses Yelp to handle documentation, but I don't know if it has been ported to Windows.
CLI applications like Vim, cdargs can open a new screen then allow users to draw characters there. I'd like to try making some tools like that with Node and was told that it was called "alternative screen"(?).
I'm familiar with JS. But if there's not a solution, Python maybe(..) OK. Want some code example please :)
Found a modules according to tMC's anwser, trying to figure out...
https://github.com/mscdex/node-ncurses
Vim uses the ncurses library to do drawing. You have already found a Node.JS bindings, so you should have no trouble using this library within your application.
I propose you to read the NCURSES tutorial and attempt to do it in Node.JS.
Im new to python and want to create a GUI front-end (desktop, rather than web) for my python script. The script essentially parses XML files and runs various searches over the contents (eg. accepts regex searches from the user, returns results etc).
It works well on the command line but I want to present a more user friendly interface.
There seems to be a lot of options out there - http://docs.python.org/faq/gui.html
Or should I look elsewhere?
Can someone recommend a GUI toolkit for Python?
Cheers.
I recommend using one of Tkinter, wxPython or PyQt. They are all equally suitable for a simple task. My personal favorite is Tkinter because I think it is the simplest way to get started. However, any of those would make a fine choice.
Here is a page on the Python wiki with some fifty options.
PyQt is great, although it's on GPL. There is also PySide alternative on LGPL.
You can also try wxPython or PyGTK if you don't like Qt for some reason. There is also gui library in python standard library called Tkinter, but I haven't used it and don't have any experience with it.