CDF (.cdf)

Background

    • MIME types: application/vnd.wolfram.cdf, application/vnd.wolfram.cdf.text
    • Wolfram Computable Document Format (CDF).
    • Used as a deployment format for interactive use in Wolfram Player.
    • ASCII format based on the Wolfram Language expression syntax.
    • CDF is an acronym for Computable Document Format.
    • Stores text, typeset expressions, graphics, interface elements, and other Wolfram Language input and output.

Import & Export

  • Import["file.cdf"] reads a .cdf file and returns it as a Notebook expression.
  • Export["file.cdf",expr,"CDF"] exports a Notebook or NotebookObject as a .cdf file.
  • Import["file.cdf",elem] imports the specified element from a .cdf file.
  • Import["file.cdf",{{elem1,elem2,}}] imports multiple elements.
  • Export["file.cdf",expr,{"CDF",elem}] creates a .cdf file by treating expr as specifying element elem.
  • Export["file.cdf",expr,"CDF",opt1->val1,] exports expr with the specified option elements taken to have the specified values.
  • See the reference pages for full general information on Import and Export.
  • ImportString and ExportString support .cdf files.

Notebook Interface

  • File Save As can be used to save the current notebook to a .cdf file.
  • In the notebook front end, File Preview for Wolfram Player can be used to create a new .cdf file under an Enterprise license.

Import Elements

  • General Import elements:
  • "Elements" list of elements and options available in this file
    "Rules"full list of rules for each element and option
    "Options"list of rules for options, properties, and settings
  • Data representation elements:
  • "Notebook"Notebook expression representing a .cdf file
    "NotebookObject"NotebookObject expression
    "Plaintext"plain text version
  • Import by default uses the "Notebook" element for Computable Document Format (CDF) files.

Examples

Basic Examples  (1)

Export a notebook with an interactive manipulation to the Computable Document Format (CDF) file:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2010
(8.0)