[IPython-User] Automatically embedding PDF version of figures
Wed Jan 23 11:37:44 CST 2013
Do you really need to extract the files from a live notebook ?
if I were you I would parse the ipynb file If I were you,
it can already contain multiple repr of the same object, and nbconvert can extract all of them into file :
And was not the
svg -> pdf and png
Otherwise, Yes, in recent browser it is possible to dowload a local resources,
You will have to look at 'blob' url I think, and you would probably have to dive in
Js to decode the base 64 encoded stuff.
After that it behaves like normal download.
Le 23 janv. 2013 à 18:10, Jon Wilson a écrit :
> Hi Matthias,
> Thanks for the reply. I will probably have some time to look at/work on
> this tomorrow in the afternoon (central US time). I was thinking about
> trying to hook into the pylab inline backend -- have it send both the
> png and the pdf as a payload.
> With a data URI, is it possible to have a
> clickable link-like tag that will cause the user agent to request to
> save a file? In that scenario, is it possible to give the saved file a
> On 01/23/2013 02:33 AM, Matthias BUSSONNIER wrote:
>> Hi John,
>> Thank for your feedback, and happy for you that you will soon publish,
>> It is nice to see people using IPython Notebook from end to end as it is our goal.
>> To get back to your problem, and supposing you are using matplotlib,
>> I suggest you switch the backend to SVG.
>> %config InlineBackend.figure_format = 'svg'
>> for only the current session, or
>> c.InlineBackend.figure_format = 'svg'
>> in your profile.
>> Nbconvert will be smart enough to extract the svg and make pdf from them if you issue a
>> $ nbconvert --format latex yourfile.ipynb
>> As usually the sag render well in browser, It will not make png from svg for the html format,
>> but that shouldn't be too hard to add.
>> Concerning the clickable png that lead to the PDF, it shouldn't need too much change
>> on nbconvert either, and will likely not be much more complicated than adding the link by hand in the HTML.
>> As we are currently rebuilding nbconvert from the ground up, those feature will probably not
>> be integrated in the current version, but depending how much time you have, we could
>> probably hack things quickly to do something for you.
>> If this seem ok to you, I'll let you open a issue on nbconvert issue tracker, and then we'll see what we can do.
> IPython-User mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-User