

To view Google Drive docs from fileviewer links, use the file ID as the srcid attribute in the iframe. Google Drive Viewer: Non-PDF files (fileviewer URL) The files don't have to be uploaded to Google Docs, but they need to be available online. Google Docs offers an undocumented feature that lets you embed PDF files and PowerPoint presentations in a web page. Google Drive viewer helps you preview over 16 different file types, listed below: Only files under 25 MB can be previewed with the Google Drive viewer. So in this way you can create a simple PDF viewer, I hope this article might be fruitful to you, thank you ‘Keep Learning Keep Coding’.('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx') The conclusion that I could arrive at is that every image needs the separate permanent storage until the PDF is rendered.īy looking at this task code it seems to be simple, but it took me around 8 hours to arrive at this solution because in this I had tried every possible solution I could have found and lastly I had found it, this was really a challenging and interesting task. Here you must be thinking why I have used two for loops one adding images to list and the second one for adding images to the text widget, I had actually used one loop but then it was only showing the last page in the PDF, this might be happening, because I was using a single variable to hold the image and store into text widget. # Adding all the images to the text widget

# Here the PDF is converted to list of images # Setting the scrollbar to the right side Pdf = Text(pdf_frame,yscrollcommand=scrol_y.set,bg="grey") # Adding text widget for inserting images

Scrol_y = Scrollbar(pdf_frame,orient=VERTICAL) Pdf_frame = Frame(root).pack(fill=BOTH,expand=1) Source Code: Create a PDF viewer GUI in Python # Importing required modules Installation: $ sudo apt-get install python3-tkĪfter installing the above modules and required dependencies you can get into actual code.

Tkinter – It is the most preferred GUI toolkit available in python, which posses the faster and easiest way of producing GUI software.In this tutorial we will learn how to create PDF viewer using python, this is a GUI toolkit which uses python Tkinter module, Pdf2img module, and Python Imaging Library ( PIL).Īs the increasing popularity and compatibility of PDFs in almost each and every document format, whether it is Invoices, Reports or other official documents, we need an onboard PDF viewer or renderer to seek out the information repeatedly.
