Finally figure out a simple way to embed a pdf stored in the DATA folder
into the notebook:
def embedPdf(fname,width=800,height=400):
dataurl='/'+'/'.join(DATA.split('/')[-5:])
html.iframe(dataurl+fname,width=width,height=width)
Just in case someone finds it useful
Fred
On Monday, May 12, 2014 10:03:34 AM UTC-4, Fred Gruber wrote:
>
> Hi
> I wanted to embed a pdf in a sage notebook. I noticed that if the browser
> I'm using is able to open pdfs then I can use the html.iframe function to
> open any pdf that is online is some server.
>
> My question is how can I open a pdf store in the DATA directory?
>
> I know I could open the file by using the full URL of the notebook for
> example:
> html.iframe("http://localhost:8083/home/admin/16/data/tmp.pdf")
> would open the tmp.pdf that is store in the DATA folder of the notebook
>
> Is there a way to find out the URL of the notebook within sage?
>
> thanks
> FKG
>
>
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.