I don't know if I have asked the question the right way:
As CDF is essentially a simple text file, I would like to create it "on the fly" without saving it to the hard drive.
I would like to give a little bit of background: I process SQL data within Mathematica an create a little CDF containing some animated graphics and tables. Currently, the process is triggered from the SQL server and the resulting CDF is saved back to the database in compressed, binary form. The CDF is embedded into the web application as a popup.
This is my code (example):
deployobj =
Manipulate[
Column[{Rationalize[Pi, 10^-n], N[Rationalize[Pi, 10^-n], 48],
N[Abs[Pi - Rationalize[Pi, 10^-n]], 48]}, Frame -> All,
Spacings -> 1.5], {n, 0, 10, 1}, FrameMargins -> 50,
Deployed -> True, SaveDefinitions -> True];
file = ToFileName[{$TemporaryDirectory}, "CDF_Embedded.cdf"];
CDFDeploy[file, deployobj];
fnMyExportToSQLFunction[Import[file, "Text"]]
The code works well. Is there any way to create the CDF "on the fly" without saving it to the hdd? Thanks!
Answer
The format isn't exactly the same, notably there is extra spacing, but this seems to work:
ExportString[deployobj, "CDF"]
Comments
Post a Comment