<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi Matthias,<br>
      I had been thinking that the converter could only use the data
      that was already stored in the ipynb file in JSON, and so to have
      both PNG and PDF in my static HTML, I would need the notebook
      server to ask matplotlib to produce both versions and send them to
      the frontend.&nbsp; Now I understand that nbconvert can internally
      convert SVG into both PNG and PDF (this should have been clear
      from your first mail, but I did not apprehend it).&nbsp; I will look
      again and more closely at svg -&gt; pdf and png.<br>
      <br>
      And yes, I *will* be citing IPython, never fear!<br>
      Regards,<br>
      Jon<br>
      <br>
      On 01/23/2013 11:37 AM, Matthias BUSSONNIER wrote:<br>
    </div>
    <blockquote
      cite="mid:AD372FAE-935A-4D68-BE81-1A2CFD255867@gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      HI Jon,&nbsp;
      <div><br>
      </div>
      <div>Do you really need to extract the files from a live notebook
        ?</div>
      <div>if I were you I would parse the ipynb file If I were you,&nbsp;</div>
      <div>it can already contain multiple repr of the same object, and
        nbconvert can extract all of them into file :&nbsp;</div>
      <div><br>
      </div>
      <div><a moz-do-not-send="true"
href="https://github.com/ipython/nbconvert/blob/master/converters/latex.py#L176">https://github.com/ipython/nbconvert/blob/master/converters/latex.py#L176</a></div>
      <div><a moz-do-not-send="true"
href="https://github.com/ipython/nbconvert/blob/master/converters/base.py#L246">https://github.com/ipython/nbconvert/blob/master/converters/base.py#L246</a></div>
      <div><br>
      </div>
      <div>And was not the&nbsp;</div>
      <div>svg -&gt; pdf and png&nbsp;</div>
      <div>enough ?&nbsp;</div>
      <div><br>
      </div>
      <div>Otherwise, Yes, in recent browser it is possible to dowload a
        local resources,&nbsp;</div>
      <div>You will have to look at 'blob' url I think, and you would
        probably have to dive in&nbsp;</div>
      <div>Js to decode the base 64 encoded stuff.&nbsp;</div>
      <div><br>
      </div>
      <div>After that it behaves like normal download.</div>
      <div>--&nbsp;</div>
      <div>Matthias</div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>
        <div>
          <div>Le 23 janv. 2013 &agrave; 18:10, Jon Wilson a &eacute;crit :</div>
          <br class="Apple-interchange-newline">
          <blockquote type="cite">
            <div>Hi Matthias,<br>
              Thanks for the reply. &nbsp;I will probably have some time to
              look at/work on <br>
              this tomorrow in the afternoon (central US time). &nbsp;I was
              thinking about <br>
              trying to hook into the pylab inline backend -- have it
              send both the <br>
              png and the pdf as a payload. &nbsp;</div>
          </blockquote>
          <div><br>
          </div>
          <br>
          <blockquote type="cite">
            <div>With a data URI, is it possible to have a <br>
              clickable link-like tag that will cause the user agent to
              request to <br>
              save a file? &nbsp;In that scenario, is it possible to give the
              saved file a <br>
              filename?<br>
              Regards,<br>
              Jon<br>
              <br>
              On 01/23/2013 02:33 AM, Matthias BUSSONNIER wrote:<br>
              <blockquote type="cite">Hi John,<br>
              </blockquote>
              <blockquote type="cite"><br>
              </blockquote>
              <blockquote type="cite">Thank for your feedback, and happy
                for you that you will soon publish,<br>
              </blockquote>
              <blockquote type="cite">It is nice to see people using
                IPython Notebook from end to end as it is our goal.<br>
              </blockquote>
              <blockquote type="cite"><br>
              </blockquote>
              <blockquote type="cite">To get back to your problem, and
                supposing you are using matplotlib,<br>
              </blockquote>
              <blockquote type="cite">I suggest you switch the backend
                to SVG.<br>
              </blockquote>
              <blockquote type="cite"><br>
              </blockquote>
              <blockquote type="cite"> &nbsp;%config
                InlineBackend.figure_format = 'svg'<br>
              </blockquote>
              <blockquote type="cite">for only the current session, or<br>
              </blockquote>
              <blockquote type="cite">c.InlineBackend.figure_format =
                'svg'<br>
              </blockquote>
              <blockquote type="cite">in your profile.<br>
              </blockquote>
              <blockquote type="cite"><br>
              </blockquote>
              <blockquote type="cite">Nbconvert will be smart enough to
                extract the svg and make pdf from them if you issue a<br>
              </blockquote>
              <blockquote type="cite">$ nbconvert --format latex
                yourfile.ipynb<br>
              </blockquote>
              <blockquote type="cite"><br>
              </blockquote>
              <blockquote type="cite">As usually the sag render well in
                browser, It will &nbsp;not make png from svg for the html
                format,<br>
              </blockquote>
              <blockquote type="cite">but that shouldn't be too hard to
                add.<br>
              </blockquote>
              <blockquote type="cite"><br>
              </blockquote>
              <blockquote type="cite">Concerning the clickable png that
                lead to the PDF, it shouldn't need too much change<br>
              </blockquote>
              <blockquote type="cite">on nbconvert either, and will
                likely not be much more complicated than adding the link
                by hand in the HTML.<br>
              </blockquote>
              <blockquote type="cite"><br>
              </blockquote>
              <blockquote type="cite">As we are currently rebuilding
                nbconvert from the ground up, those feature will
                probably not<br>
              </blockquote>
              <blockquote type="cite">be integrated in the current
                version, but depending how much time you have, we could<br>
              </blockquote>
              <blockquote type="cite">probably hack things quickly to do
                something for you.<br>
              </blockquote>
              <blockquote type="cite"><br>
              </blockquote>
              <blockquote type="cite">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.<br>
              </blockquote>
              <blockquote type="cite"><br>
              </blockquote>
              <br>
              _______________________________________________<br>
              IPython-User mailing list<br>
              <a moz-do-not-send="true"
                href="mailto:IPython-User@scipy.org">IPython-User@scipy.org</a><br>
              <a class="moz-txt-link-freetext" href="http://mail.scipy.org/mailman/listinfo/ipython-user">http://mail.scipy.org/mailman/listinfo/ipython-user</a><br>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
IPython-User mailing list
<a class="moz-txt-link-abbreviated" href="mailto:IPython-User@scipy.org">IPython-User@scipy.org</a>
<a class="moz-txt-link-freetext" href="http://mail.scipy.org/mailman/listinfo/ipython-user">http://mail.scipy.org/mailman/listinfo/ipython-user</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>