I have used reportlab to generate several pdf files using python3 on linux. Is there anyway to use reportlab to view the files once they are generated? I want to be able to open the file for viewing using python3 code.
The ReportLab toolkit doesn't provide a viewer, but your python3 process could
open a viewer using eg os.system or the subprocess module. That of course
requires you to have a viewer installed in your linux.
On my ubuntu I can do this inside a python3 script
os.system("/usr/bin/evince ./z....er/rml/narf/logo.pdf >/dev/null 2>&1 &")
and evince opens in my main display.
On 24/07/2019 04:31, Paul Henry via reportlab-users wrote:
> I have used reportlab to generate several pdf files using python3 on linux. Is there anyway to use reportlab to view the files once they are generated? I want to be able to open the file for viewing using python3 code.
>
........
--
Robin Becker
_______________________________________________
reportlab-users mailing list
reportl...@lists2.reportlab.com
https://pairlist2.pair.net/mailman/listinfo/reportlab-users
To my knowledge this
is not a pure python (3 or 2) module that will open a PDF for
view on the display. There are of course many programs that
do as you requested and python can access those programs via
the OS. As pointed out earlier if you are on Ubuntu there is
"evince". And of course there are PDF viewers for other
OS's.
I use ghostscript mostly on windows (only because it does a good job and has a long history) - but requires that it be installed. Recently, I have been using browsers (they are harder to work with but will display a PDF).
Johnf