WeBWorK Problems

importing graphic files

importing graphic files

by Jay Yellen -
Number of replies: 3
Is it possible to create a graphic file (saved as .pdf) using software like EazyDraw and then import it into a WebWorK problem? Attached to this post is an example of the kind of graphic I'd like to be able to import.
In reply to Jay Yellen

Re: importing graphic files

by Gavin LaRose -
Hi Jay,

If EazyDraw allows you to save as a PNG or GIF file format, you're already done, and can use the file directly. If it doesn't, you probably want a converter to change the PDF to a PNG or GIF graphics format. There will necessarily be the required resources on your WeBWorK server (something like pdftops unit1fig1.pdf | pstopnm | pnmtopng > unit1fig1.png should work), though if you don't have command line access to your server that may be less useful.

In the absence of one of those solutions you put the PDF in the html directory of your course and just use an HTML link in the problem to provide students with access to the image. But that wouldn't be as nice, and wouldn't display in the hardcopy.

I don't know of a way to embed PDF in a problem file.

In reply to Gavin LaRose

Re: importing graphic files

by Jay Yellen -
Thanks for the quick reply, Gavin. I am able to save my file as a PNG or GIF. Can you direct me to documentation that explains how to use the file directly? It would also be helpful if I could look at some existing problems that use an imported PNG file or GIF file.

Thanks in advance,

In reply to Jay Yellen

Re: importing graphic files

by Michael Gage -
This might help:

In general this page:
and this one

are good sources of information for specific authoring techniques.

A simple version of using static graphics is in your site's
setMAAtutorial homework set.  You can also view it at

use  profa as login and profa as password to see the details.