Hello all! Relative Codea noob here, but have been fooling around with it for a while. Was playing around with the nifty Cider tools, trying to think of fun things that could be done with a nice, simple front end, and settled on the idea of an app generating a kind of one-page “standardized” document that gets used a fair bit in my actual day job (and often gets mangled by people who, to put it charitably, don’t care about the details much). Ideally the output has mostly text with a few graphics, and some small, individualized details that change for the given encounter. What’s the best way to output that to a one page file that could be easily shared or printed and looks the same every time? My natural thought would be a PDF, but it looks like I might have to build my own code for creating a PDF document and that looks to be fairly involved/daunting. Anybody know of a PDF library for codea? Or a different file format that plays nicely with iDevices and is easily shared and can be rendered consistently? Or do you think it’d be relatively straightforward to make a single fixed PDF file, and I’m just being a wimp?Thanks for the help, in advance!
i dont know how to make pdf with codea.
What you could do easily is share the report as an image (png or jpeg) and share it by mail (via pasteboard.copy() ). Or you could make it text-only too.
Saving as an image seems like it might be a reasonable idea. Is it particularly difficult to translate data into an image file format? It’s a kind of document that does require graphics in it to be done appropriately, the whole point of it is that it’s easily interpreted even by people with low literacy, though I agree that it would be greatly simplified by being text-only!
it is quite simple to draw anything into an image with setContext(). Check the doc.
@Therighttoarmbears - creating an image is as simple as writing out your page to an image in memory and saving it. How you do things like sharing the results with other people, and maintaining the app if you happen to leave the company, is a little trickier.
Personally, although you can contort Codea to try to do this, I don’t think it is really the right tool. Excel+VBA would do a much better job for an office task like this (including PDF generation and file sharing), and would be way easier to build and maintain. I could probably do it inside an hour with very little code.
I’m sure the others who have used Codea for office work will disagree with me, and I’m not trying to be rude to you in any way, but I don’t see the point of using an app which was created to make graphic animations, to create static forms and output for office related tasks. Yes, you can do it, but it is not playing to Codea’s strengths. It is like using Excel to create an animated game, or a baseball bat to play tennis. For me, Codea’s magic lies in its ability to create amazing visual effects using a language that is way simpler than the alternatives, and that is a whole lot of fun.
Anyway, that’s my two cents worth. You are welcome to ignore it!