JEuclidMathMLPostProcessor to determine
where to save each generating MathML image and the URL to use in the resulting
HTML as it traverses a given DOM Document.
You should implement this to do whatever is appropriate for your needs.
This can be used independently of SnuggleTeX.
JEuclidMathMLPostProcessor
| Modifier and Type | Method and Description |
|---|---|
| public String | getImageContentType(int
identifies the position of the image within the document being processed,
which can be used to ensure unique file names. mathmlCounter)Implement to return the desired MIME type for the resulting image. |
| public File | getImageOutputFile(int
identifies the position of the image within the document being processed,
which can be used to ensure unique file names. mathmlCounter)Implement if you want the resulting image to be written to a |
| public OutputStream | getImageOutputStream(int
identifies the position of the image within the document being processed,
which can be used to ensure unique file names. mathmlCounter)Implement this if you want the resulting image to be written to an |
| public String | getImageURL(int
identifies the position of the image within the document being processed,
which can be used to ensure unique file names. mathmlCounter)Implement to return the URL String that will be put into the img src attribute to refer to the image. |
| public net. | getLayoutContext(int
identifies the position of the image within the document being processed,
which can be used to ensure unique file names. mathmlCounter)Implement to fill in the JEuclid |
| public void | imageSavingFailed(Object
File or OutputStream that would have
been written if successfulidentifies the position of the image within the document being processed,
which can be used to ensure unique file names. mathmlCounter, String content type of the saved image File contentType, Throwable cause of the failure, which may be null exception)Called back if MathML image could not be saved for some reason. |
| public void | imageSavingSucceeded(Object
File or OutputStream writtenidentifies the position of the image within the document being processed,
which can be used to ensure unique file names. mathmlCounter, String content type of the saved image File contentType)Called back once a MathML image has been saved successfully. |
| getImageContentType | back to summary |
|---|---|
| public String getImageContentType(int mathmlCounter) Implement to return the desired MIME type for the resulting image. Consult the JEuclid documentation for what is supported; you may need to add additional libraries for certain MIME types. SnuggleTeX contains everything required to support PNG. Note that conversion to GIF does not generally work well so should be avoided...!
| |
| getImageOutputFile | back to summary |
|---|---|
| public File getImageOutputFile(int mathmlCounter) Implement if you want the resulting image to be written to a
| |
| getImageOutputStream | back to summary |
|---|---|
| public OutputStream getImageOutputStream(int mathmlCounter) Implement this if you want the resulting image to be written to an
| |
| getImageURL | back to summary |
|---|---|
| public String getImageURL(int mathmlCounter) Implement to return the URL String that will be put into the img src attribute to refer to the image.
| |
| getLayoutContext | back to summary |
|---|---|
| public net. Implement to fill in the JEuclid
| |
| imageSavingFailed | back to summary |
|---|---|
| public void imageSavingFailed(Object imageFileOrOutputStream, int mathmlCounter, String contentType, Throwable exception) Called back if MathML image could not be saved for some reason.
| |
| imageSavingSucceeded | back to summary |
|---|---|
| public void imageSavingSucceeded(Object imageFileOrOutputStream, int mathmlCounter, String contentType) Called back once a MathML image has been saved successfully. Implementors can do anything they need to do at this point.
| |