0
$\begingroup$

This is related to my previous question here

A series of my questions are related to an important problem: It is important to be able to CDF-publish a document, and be able to open a separate interactive window from this document. Let me explain in more details.

In my concrete situation I have a document in a form of a cdf file. I would like to open, say, a manipulate-based demonstration in a separate window. To enable the reader to read the rest of the document, and to use the demonstration while reading further.

The discussion here has shown that it is likely to be impossible. What is impossible, however? What I tried to achieve at that point was to open an nb notebook from a cdf file within the CDF Player. That is clear that it is counter logic. If this would be possible, it would be the work around to use the free CDF Player instead of Mathematica.

OK, is it possible to create a cdf document, and then to embed this document into another one in a form of a code? This is to be able to open one (slave) cdf document from another (master) CDF document.

Then one will open a cdf, rather than nb within the CDF Player. This should not be forbidden.

To be precise, let us assume a notebook with this simple code:

 Manipulate[Plot[Sin[a*x],{x,0,6}],{a,1,2}]

This notebook can be saved as a stand-alone cdf.

My question is this: Is it possible to get a code corresponding to this cdf document, such that it can be launched by, say, the following code:

Button["Launch cdf file", the_code_in_question]

from another notebook. This notebook will also be transformed into the cdf form

So, do you see such a possibility?

$\endgroup$
1
  • $\begingroup$ As I understand it, CDF documents that are written to run in the free CDF player cannot access the file system of the computer they are running on. This is a matter of system security. $\endgroup$
    – m_goldberg
    Commented Apr 15, 2014 at 14:33

1 Answer 1

1
$\begingroup$

I think m_goldberg is right: you can't access files on your local filesystem from CDF. AFAIK you can open new windows from CDF-Player with e.g.

CreateDocument["hello"]

but these will have dynamic update disabled, so that something like

CreateDocument[Manipulate[Plot[x^n, {x, 0, 1}], {n, 0.1, 10}]]

won't work. I also would expect that this only works in the standalone player, not in the embedded CDF-Browser-Plugin. What seems to work in the standalone player without restrictions is to open files from public URLs, and code like this should work:

NotebookOpen["http://demonstrations.wolfram.com/VoronoiImage/VoronoiImage.cdf"]

I have not tested what happens if you evaluate something like that in the browser plugin, but I'd expect that won't work either. So if making your target cdfs available on a webserver instead of embed them in the main CDF is an option you could probably achieve what you want, at least if the reader uses the standalone player...

$\endgroup$
1
  • $\begingroup$ This can be a possibility, though I do not like it too much. I had a hope to be able to somehow embed a preexisting cdf file into the document. Well, seems to be impossible. $\endgroup$ Commented Apr 17, 2014 at 18:00

Your Answer

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

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