export worksheet programmatically

How to export worksheet to the HTML format programmatically? And how to export Maple output as GIF or other graphic format programmatically?

export to html

The first thing to ask:

Have you tried "File..Export As?"

The answer to your primary question might be this simple.

For your second question: first try to select the ouput, right-click to copy, and then paste into something like Word or Paint. This is not exactly programmatic and will lead to carpal tunnel in a few years. So look at the help screen for "plotsetup".

 

 

acer's picture

programmatically

The poster wrote "programmatically". That often means using the Maple programming language rather than the GUI and the mouse.

acer

Yes, you're right.

Yes, you're right. "Programmatically" means using the Maple programming language or OpenMaple. Thanks for understanding=))

Axel Vogt's picture

why and what?

what should that be good for, why you want it that way?

i want to run the Maple code

i want to run the Maple code with third-pary application and get the images of Maple output for report. I know that I can draw a plot into a file with "plotsetup" function, so maybe there are some features to export other Maple output as images in the Maple language or OpenMaple...

Axel Vogt's picture

work around

I see ... then probably you only work with the Maple kernel and not
in an actual worksheet.

The following might be a way: save the plots to a file, read them
in later in an actual sheet for manual export:

  myDir:= "d:\\temp\\";         # your working directory

  plot(exp(x), x=-2 .. 1);      # some plot
  P:=%:                         # save plot as structure


  save P, cat(myDir,"tst.txt"); # then save into a file, that's an ASCII file

  P:='P';                       # refresh variable for a test

  read cat(myDir,"tst.txt"):    # read it
  plots[display](P);            # show the graphic


I played with 'writeto' and 'appendto', but was too stupid for that.

I need images of output of any types

Thanks for your solution but it's alright with plots. I need Maple output in math notation and exported as image files. Then I'll be able to insert it in the report (DOC format) with my program. So, can I export output programmatically or not?

My guess is yes

The same way that the stream

INTERFACE_WORKSHEET(display,file="file");

opens programmatically the worksheet "file", my guess is that there is another undocumented stream for export of worksheets to html, say.

Axel Vogt's picture

hm ...

hm ...

You said you want the images ...

... but if you want the complete 'sheet' why do you want to run
it from outside and not some sheet itself?

Note that you do not have a sheet (to be saved), if you use only
the kernel itself ... but you want the userinterface to be shown
from it (I am not aware that one would do so with other systems,
only SAP had something similar called 'batch input').

It would be far more simple to enter the commands directly than
to use the cryptic syntax for OpenMaple ...

May be you can fake some protocol, save that and reload it.

Or do you want to 'hack' the 3rd party solution? There should be
a reason, why the software allows you no deeper access ... Do
you have the source code?

If not you may also contact the software vendor, whether (s)he
offers a way to achieve your needs.

OK... Now I try to explain

OK... Now I try to explain what I want to do.

For example, someone, who's not interested to work with Maple, has to solve often some problem. Let it be a system of linear algebraic equations (my real problem is far difficult). I write the Maple code for this problem. Then this "someone" runs the shell program, inputs matrix coefficients and so on and presses "Calculate button". The shell program substitutes the values into the code and run it with the Maple through OpenMaple. It will be great to report input data (matrix and vector) and output data (vector) in the math notation.

I think there are 3 variants:

1) export output data from Maple

2) show output data with the Microsoft Equation object in Microsoft Word, but I don't know how to do it programmatically

3) make the shell program to draw output data (it's so long to do)

So, you can see the first variant is the best)) But how to do it??? I guess the Maple server (kernel) doesn't output data in the math notation or does? What can you advise me?

Axel Vogt's picture

if I understand it correctly

If I understand it correctly then I would write a Maplesheet, which receives its data and parameters from a (text) file, where that comes from the shell script (to be run before)

it's the same thing and it's

yes, Maplesheet. it's not important how the sheet gets the data. someone who makes calculations hasn't to work with Maple but with the shell program that I write in C++. and i'm sorry for my poor English)) i'll do my best, i promise)) sorry for off top))

Axel Vogt's picture

von hinten durch die Brust

do not know the English expression ... it means something like "artifically complicated"

But - if your user is not able to hit the run button in Maple - why do you not simpliy start
Maple from C++ through a shell command? That should be possible (even in Windows)?

Working in (software) industry for several years I had to learn: the most expensive solutions
arise, if you want to do soemthing through programs, which is quite easily achived through
re-organisation work (i.e. short intro to handling Maple in about 30 minutes).

and: do not mind for your English ... this is not for a test ... which would fail as well :-)

alec's picture

Latex filter

Maple can be run in Latex filter mode, see ?maple . Then you can process the latex output.

Alec

Thx, I'll try this. I also

Thx, I'll try this. I also find some help articles about MathML. Could anyone explain me how it works or give some links about it?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}