If you embed a GeoGebra into a problem, what do you do about the TeX version of the problem?
One solution is to just have it print "A GeoGebra applet is here. Go online to see it." Or print some generic GeoGebra image to convey the same message.
Another solution is to take a screen shot of the GGB in its initial state and print that in the PDF. If there is randomization in the problem, I've seen examples that take several screenshots, cleverly name the screenshot files, and rely on the randomization to use the right image file name. This seems tedious, even without randomization with only one image, taking screen shots manually. Also I'm not a fan of having to manage the separate image files.
First, is there any other known approach to this issue?
Second, I have an outline of an idea. I am posting about it here to see if someone can shoot it down immediately for some reason, specifically a security reason.
With the GGB API, you can get a base64 encoding of a PNG image of the GGB applet in its current state. So I'm thinking to run the GGB, get that base64 encoding, and print that in the .tex. There would be two steps. My question is really about the first step.
1. Since we are in TeX mode, how to run the javascript to run the GGB API to get the base64 string? I'd go out looking for a perl module that can function like a headless browser. Is it going to be a security concern to enable WW problems to activate a headless browser?
2. Once I have the base64, how to bring it to life as an image in the tex? I'd go looking for perl modules that could decode the base64 and write it as a temporary file, and include the image in the tex in the usual way.