4
$\begingroup$

I am creating a computable document format (CDF) to embed in an HTML page. I would like to have a button that can be clicked to create/save a PDF of the CDF fromt he browser. The idea is that a person would be able to manipulate the document, enter in specific values for equations and graphs, and then be able to download the resulting visualization as a PDF.

For starters I have created a simple sin plot and then added a button at the bottom for exporting the document. I am not sure what would go in the Export expression or if the export expression is even the correct approach to doing this.

Here is my code:

sinplot = 
  Manipulate[Plot[Sin[a x + b], {x, 0, 6}], {a, 1, 4}, {b, 0, 10}];
nb = CreateDocument[
   {Cell["Sin Curve Simulation", "Section"],
    ExpressionCell[sinplot],
    Button["Export Graph", Export[ ... ]]}];

Ideas of how to get this working?

$\endgroup$

2 Answers 2

2
$\begingroup$

Having Mathematica Enterprise Edition you can do it - export, import - in a manual or automated way. Take a look at the following blog:

Using Mathematica Enterprise Edition to Create Professional Apps, Tools, and Reports

For example quoting from the blog:

We needed a way for Mathematica users to create CDFs that could link and interact with proprietary data sources, respond to arbitrary user input, and generate automated results in formats that the rest of their organizations might need, such as PDF, JPG, XLSX, or even new CDFs.

.............

EnterpriseCDF files can be saved with user data and exported to a variety of supported file formats. For management and customers alike, the ability to interact with a document, make changes that update in real time, and then export the results as customized reports or files (e.g. JPG, PDF, TXT, XLSX, CDF) is a tremendous asset.

$\endgroup$
1
$\begingroup$

.cdf's cannot read to write to files. Perhaps you could instruct your viewers to take a screen shot of the .cdf, that would contain much of the information that you want to preserve.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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