|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.io.IOHandler yext.export.io.OutputHandler yext.export.io.PDFOutputHandler
public class PDFOutputHandler
Writes a Graph2D in PDF vector graphics format.
The size, viewport, and zoom level of the output will be determined by the Graph2DView associated with the input graph.
A PDFOutputHandler
is used the same way as any other
IOHandler
. E.g. the simplest way to export a given
Graph2D
instance to PDF is:
try { new PDFOutputHandler().write(graph2D, "myGraphAsPDF.pdf"); } catch(IOException ex) { // error handling code }
Graph2DView
Field Summary | |
---|---|
static byte |
PLAIN_TEXT
Text handling policy which will result in regular text (i.e. plain text glyphs). |
static byte |
PLAIN_TEXT_WITH_EMBEDDED_FONTS
Text handling policy which will result in regular text (i.e. plain text glyphs) and fonts used in labeled graph elements being embedded into the resulting PDF output. |
static byte |
VECTORIZED_TEXT
Text handling policy which will result in text being rendered as vectorized shapes instead of plain text glyphs. |
static PageFormat |
VIEW_FORMAT
Symbolic page format that may be used to create PDF documents for which the page size is determined by the size of the exported graph's view. |
Constructor Summary | |
---|---|
PDFOutputHandler()
Creates a new instance of PDFOutputHandler |
Method Summary | |
---|---|
String |
getFileNameExtension()
Returns "pdf", the standard file name extension for the Portable Document Format. |
PageFormat |
getPageFormat()
Returns a PageFormat object representing the desired page size
and page orientation for this output handler. |
byte |
getTextRenderingPolicy()
Returns the text handling policy used by this output handler. |
boolean |
isMultiPageTilingEnabled()
Returns true , iff this output handler is configured to split
content across multiple pages if necessary; false , if the
page will be resized to accommodate the content. |
boolean |
isPageOutlinesEnabled()
Determines whether or not this output handler automatically creates outlines (or "bookmarks") for each page in the generated document. |
void |
setMultiPageTilingEnabled(boolean multiPageTilingEnabled)
Specifies whether this output handler should split content that does not fit onto a single page across multiple pages instead of automatically resizing the page to accommodate the content. |
void |
setPageFormat(PageFormat pageFormat)
Specifies the desired page size and page orientation to be used in the generated PDF. |
void |
setPageOutlinesEnabled(boolean enabled)
Specifies whether or not this output handler should automatically create outlines (or "bookmarks") for each page in the generated document. |
void |
setTextRenderingPolicy(byte textRenderingPolicy)
Specifies the text handling policy to be used by this output handler. |
Methods inherited from class yext.export.io.OutputHandler |
---|
addRenderingHint, canRead, canWrite, createDefaultGraph2DView, createGraphicsContext, getCreator, getFileFormatString, read, removeRenderingHint, setCreator, write |
Methods inherited from class y.io.IOHandler |
---|
canWriteSubset, createObjectInputStream, createObjectOutputStream, hide, read, read, shouldSerialize, shouldSerialize, write, writeSubset, writeSubset |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final PageFormat VIEW_FORMAT
Warning: This format is meant as a marker only and does not provide
the usual PageFormat
functionality. All of its
PageFormat
methods throw UnsupportedOperationException
.
setPageFormat(java.awt.print.PageFormat)
,
getPageFormat()
public static final byte PLAIN_TEXT
setTextRenderingPolicy(byte)
,
PLAIN_TEXT_WITH_EMBEDDED_FONTS
,
VECTORIZED_TEXT
,
Constant Field Valuespublic static final byte PLAIN_TEXT_WITH_EMBEDDED_FONTS
Although font embedding ensures that the original graph element's label font can be used when displaying or printing PDF on a platform where that font is not normally available, it is not always advisable to embed fonts, e.g. when the size of the generated PDF needs to be kept as small as possible or when a font's license terms prohibit embedding.
setTextRenderingPolicy(byte)
,
PLAIN_TEXT
,
VECTORIZED_TEXT
,
Constant Field Valuespublic static final byte VECTORIZED_TEXT
Rendering text as vectorized shapes will result in smoothly scalable vector graphics and prevent the need for font embedding at the expense of generating output that is no PDF text and therefore cannot be selected as such.
setTextRenderingPolicy(byte)
,
PLAIN_TEXT
,
PLAIN_TEXT_WITH_EMBEDDED_FONTS
,
Constant Field ValuesConstructor Detail |
---|
public PDFOutputHandler()
Method Detail |
---|
public String getFileNameExtension()
getFileNameExtension
in class IOHandler
public byte getTextRenderingPolicy()
PLAIN_TEXT
,
PLAIN_TEXT_WITH_EMBEDDED_FONTS
,
VECTORIZED_TEXT
public void setTextRenderingPolicy(byte textRenderingPolicy)
Default to VECTORIZED_TEXT
.
textRenderingPolicy
- one of
public boolean isMultiPageTilingEnabled()
true
, iff this output handler is configured to split
content across multiple pages if necessary; false
, if the
page will be resized to accommodate the content.
true
, iff this output handler is configured to split
content across multiple pages if necessary; false
, if the
page will be resized to accommodate the content.public void setMultiPageTilingEnabled(boolean multiPageTilingEnabled)
Defaults to false
.
multiPageTilingEnabled
- iff true
, content will be
split across multiple pages if necessary;
otherwise, the page will be resized to
accommodate the contentpublic boolean isPageOutlinesEnabled()
true
if this output handler automatically creates
outlines for each page in the generated document; false
otherwise.
Defaults to true
.
setPageOutlinesEnabled(boolean)
public void setPageOutlinesEnabled(boolean enabled)
Defaults to true
.
enabled
- if true
, a bookmark for each page in the
generated document is created; otherwise, no bookmarks are created.isPageOutlinesEnabled()
public PageFormat getPageFormat()
PageFormat
object representing the desired page size
and page orientation for this output handler.
PageFormat
object representing the desired page size
and page orientation for this output handler.public void setPageFormat(PageFormat pageFormat)
Use VIEW_FORMAT
as page format to create PDF documents for which
the page size is determined by the size of the exported graph's view.
pageFormat
- a PageFormat
object representing the
desired page size and page orientation
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |