I'm using Mathematica for Students on a Mac. How do I export a CDF document to HTML? According to the Wolfram website I should click on File > Deploy > Export as HTML. But I do not see the Deploy contextual menu item in my File menu. Has it been moved on the Mac version?

  • $\begingroup$ What OS are you using? $\endgroup$ – rcollyer Apr 23 '12 at 0:17
  • $\begingroup$ Mac OS X 10.7; Mathematica 8 $\endgroup$ – Michael Apr 23 '12 at 0:34
  • 1
    $\begingroup$ Hmm, didn't read far enough, I see. On my machine (OS X 10.6.8 - MMA v.8), Deploy is the fifth item from the bottom. It is right above Install and the 3 printing commands. $\endgroup$ – rcollyer Apr 23 '12 at 0:45
  • $\begingroup$ @rcollyer What licence do you have? I'm using Mathematica Home Edition v. 8.0.4 for OS X, and there is no menu item called Deploy in my version either. $\endgroup$ – Heike Apr 29 '12 at 9:37
  • $\begingroup$ @Heike I'm running the Student Edition v8.0.4. $\endgroup$ – rcollyer Apr 29 '12 at 12:56

You do not really need a tool to depoly your CDF to HTML. It is very simple to do by hand. Here is what I do

  1. open your text editor and create a file called index.htm

    <BODY >
    This is my CDF
    <script src="http://www.wolfram.com/cdf-player/plugin/v1.0/cdfplugin.js"
    type="text/javascript"></script><script type="text/javascript">// 
    var cdf = new cdf_plugin();
    cdf.addCDFObject("source", "source.cdf",840,1435);
    // ]]></script>
  2. From Mathematica, save your notebook as source.cdf (using SAVE AS->CDF). Save it to the same folder your created the above index.htm file to. So now your folder have 2 files in it: source.cdf and index.htm

  3. use your ftp program and upload these 2 files to your web site tree where you want to put them.
  4. that is all. Click on the index.htm and will run the CDF.

ps. If you want to just show the Manipulate part in your CDF and not the code around it, then before doing SAVE AS, select the code cells and do CELL->CELL properties-> and un check the open option so that the cell becomes closed.

So that the code cells (or any other cell you choose to close) are not open for view. This way, when someone sees your CDF, they only see the GUI part (i.e. the manipulate) and not any other cell you did not want them to see).

  • 1
    $\begingroup$ Hi, I don`t understand what am I supposed to replace your "This is my CDF" by. Is it the path to the file ? $\endgroup$ – 500 Oct 1 '12 at 19:11
  • $\begingroup$ Did not work for me! Any updates to your wonderful answer over the years? I use version 12.0 $\endgroup$ – Dean Aug 13 '19 at 21:58
  • 1
    $\begingroup$ @Dean CDF's no longer work in HTML. This has been the case for may be 2-3 years. All browsers I know about have stopped supporting these types of plugins. Only way to run CDF's now is to download it to your computer and use the CDF player. $\endgroup$ – Nasser Aug 14 '19 at 3:17
  • $\begingroup$ @Nasser, many thanks for this important information. I have got CDF player, thank you for your suggestion. However, are there other means of web deployment for my mathematica code? I have a project that would not be nice if only CDF player is to be used, $\endgroup$ – Dean Aug 18 '19 at 20:56
  • 1
    $\begingroup$ @Dean I have not kept up with cloud activity with WRI. But you could try getting a cloud account at Wolfram. Check https://www.wolfram.com/mathematica/online/. You could also ask about this as separate question, as I really know very little about it. I do all my programing on the PC directly using Mathematica and Maple these days. Do not use any cloud/internet things. $\endgroup$ – Nasser Aug 22 '19 at 7:17

The deploy functionality was introduced in Mathematica 8.0.4. To my knowledge, it is not available in, see the changelog.

  • $\begingroup$ Okay I have installed. I will update my software. Thanks! $\endgroup$ – Michael Apr 23 '12 at 3:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.