Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

Displaying a PDF file on Plotly Dash dashboard in python

$
0
0

@kapital1 wrote:

0

I am working on a simple dashboard using Dash Plotly. On my dashboard, I would like to display a PDF file that is found from my local disc. But I couldn’t find a way to do that.

I was trying by converting the PDF file into an image and displaying it as an image file. But my idea is to preview as the PDF file as it is.

Below shown how I tried to approach it.

html.Div([ 
   dcc.Graph(id='pdf_view')
], style= {'width': '50%', 'display': 'inline-block'})       

Here is my function to display the PDF on the browser.

def open_pdf (file_path):
    read_pdf = webbrowser.open_new(file_path)
    return read_pdf

Here is my callback

@app.callback(
Output('pdf_view', 'figure'),
[Input('first-process', 'value')])

def pdf_viewer(one_process):
       return open_pdf(pdf_file)

Can anyone help me to do this?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 6271

Latest Images

Trending Articles



Latest Images