public class PDFEmbedder extends Embedder
Constructor and Description |
---|
PDFEmbedder()
Create a new PDFEmbedder
|
Modifier and Type | Method and Description |
---|---|
void |
convert()
Convert the object returned by
Embedder.getGraph() to an appropriate binary form,
write it to Embedder.getImageOutputStream() and write the HTML required to embed it to
Embedder.getPageWriter() , referencing the image at Embedder.getImagePath() . |
PDFCanvas |
getCanvas()
Return the PDFCanvas that was generated by the XML.
|
String |
getMIMEType()
Get the MIME type for the image that will be written by this Embedder to
Embedder.getImageOutputStream() |
PDF |
getPDF()
Return a single page PDF that contains the Graph, as returned
by
getCanvas() . |
PDFFont |
getPDFFont(String fontname)
Return the PDF font that is mapped to the specified font name.
|
XMLGraphResourceProvider |
getResourceProvider()
Return the
XMLGraphResourceProvider to use with this format |
PDFAction |
parseHREF(String url)
Return a PDFAction for the specified URL.
|
void |
setPDFFont(String fontname,
PDFFont font)
Map the specified fontname, which may appear in the XML, to the specified PDF font
|
getAction, getActionKeys, getAttribute, getAttributes, getFont, getFonts, getForeignXML, getGraph, getHeight, getId, getImageOutputStream, getImagePath, getPageResources, getPageWriter, getPaint, getWidth
public XMLGraphResourceProvider getResourceProvider()
Embedder
XMLGraphResourceProvider
to use with this formatgetResourceProvider
in class Embedder
public String getMIMEType()
Embedder
Embedder.getImageOutputStream()
getMIMEType
in class Embedder
public void setPDFFont(String fontname, PDFFont font)
public PDFFont getPDFFont(String fontname)
public void convert() throws IOException
Embedder
Embedder.getGraph()
to an appropriate binary form,
write it to Embedder.getImageOutputStream()
and write the HTML required to embed it to
Embedder.getPageWriter()
, referencing the image at Embedder.getImagePath()
.
At it's very minimum it could look something like this:
ImageOutput output = new ImageOutput(); getGraph().draw(output); output.writePNG(getImageOutputStream(), 0); getPageWriter().write("<img src='"+getImagePath()+"' />");which is suitable for embedding an image with no mouse interaction.
convert
in class Embedder
IOException
public PDFCanvas getCanvas()
public PDF getPDF()
getCanvas()
. The page may also have annotations
which will reflect any interactivity specified in the XML, for
example it will have AnnotationLink
objects for any
"href" attributes.public PDFAction parseHREF(String url)
PDFAction.goToURL(url)
,
but this can be overridden to convert special URLs into a
particular PDFActionCopyright © 2001-2016 Big Faceless Organization