|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lowagie.text.pdf.PdfObject
com.lowagie.text.pdf.PdfDictionary
com.lowagie.text.pdf.PdfLayer
public class PdfLayer
An optional content group is a dictionary representing a collection of graphics that can be made visible or invisible dynamically by users of viewer applications. In iText they are referenced as layers.
Field Summary | |
---|---|
protected ArrayList |
children
|
private boolean |
on
Holds value of property on. |
private boolean |
onPanel
Holds value of property onPanel. |
protected PdfLayer |
parent
|
protected PdfIndirectReference |
ref
|
protected String |
title
|
Fields inherited from class com.lowagie.text.pdf.PdfDictionary |
---|
CATALOG, FONT, hashMap, OUTLINES, PAGE, PAGES |
Fields inherited from class com.lowagie.text.pdf.PdfObject |
---|
ARRAY, BOOLEAN, bytes, DICTIONARY, INDIRECT, indRef, NAME, NOTHING, NULL, NUMBER, STREAM, STRING, TEXT_PDFDOCENCODING, TEXT_UNICODE, type |
Constructor Summary | |
---|---|
PdfLayer(String title)
|
|
PdfLayer(String name,
PdfWriter writer)
Creates a new layer. |
Method Summary | |
---|---|
void |
addChild(PdfLayer child)
Adds a child layer. |
static PdfLayer |
createTitle(String title,
PdfWriter writer)
Creates a title layer. |
ArrayList |
getChildren()
Gets the children layers. |
PdfLayer |
getParent()
Gets the parent layer. |
PdfObject |
getPdfObject()
Gets the dictionary representing the layer. |
PdfIndirectReference |
getRef()
Gets the PdfIndirectReference that represents this layer. |
(package private) String |
getTitle()
|
private PdfDictionary |
getUsage()
|
boolean |
isOn()
Gets the initial visibility of the layer. |
boolean |
isOnPanel()
Gets the layer visibility in Acrobat's layer panel |
void |
setCreatorInfo(String creator,
String subtype)
Used by the creating application to store application-specific data associated with this optional content group. |
void |
setExport(boolean export)
Specifies the recommended state for content in this group when the document (or part of it) is saved by a viewer application to a format that does not support optional content (for example, an earlier version of PDF or a raster image format). |
void |
setLanguage(String lang,
boolean preferred)
Specifies the language of the content controlled by this optional content group |
void |
setName(String name)
Sets the name of this layer. |
void |
setOn(boolean on)
Sets the initial visibility of the layer. |
void |
setOnPanel(boolean onPanel)
Sets the visibility of the layer in Acrobat's layer panel. |
void |
setPrint(String subtype,
boolean printstate)
Specifies that the content in this group is intended for use in printing |
(package private) void |
setRef(PdfIndirectReference ref)
Sets the PdfIndirectReference that represents this layer. |
void |
setView(boolean view)
Indicates that the group should be set to that state when the document is opened in a viewer application. |
void |
setZoom(float min,
float max)
Specifies a range of magnifications at which the content in this optional content group is best viewed. |
Methods inherited from class com.lowagie.text.pdf.PdfDictionary |
---|
contains, get, getAsArray, getAsBoolean, getAsDict, getAsIndirectObject, getAsName, getAsNumber, getAsStream, getAsString, getDirectObject, getKeys, isCatalog, isFont, isOutlineTree, isPage, isPages, merge, mergeDifferent, put, putAll, putEx, remove, size, toPdf, toString |
Methods inherited from class com.lowagie.text.pdf.PdfObject |
---|
canBeInObjStm, getBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, length, setContent, setIndRef, type |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected PdfIndirectReference ref
protected ArrayList children
protected PdfLayer parent
protected String title
private boolean on
private boolean onPanel
Constructor Detail |
---|
PdfLayer(String title)
public PdfLayer(String name, PdfWriter writer)
name
- the name of the layerwriter
- the writerMethod Detail |
---|
public static PdfLayer createTitle(String title, PdfWriter writer)
title
- the title textwriter
- the PdfWriter
String getTitle()
public void addChild(PdfLayer child)
child
- the child layerpublic PdfLayer getParent()
null
if the layer has no parentpublic ArrayList getChildren()
null
if the layer has no childrenpublic PdfIndirectReference getRef()
PdfIndirectReference
that represents this layer.
getRef
in interface PdfOCG
PdfIndirectReference
that represents this layervoid setRef(PdfIndirectReference ref)
PdfIndirectReference
that represents this layer.
This can only be done from PdfStamperImp.
ref
- The reference to the OCG objectpublic void setName(String name)
name
- the name of this layerpublic PdfObject getPdfObject()
this
.
getPdfObject
in interface PdfOCG
public boolean isOn()
public void setOn(boolean on)
on
- the initial visibility of the layerprivate PdfDictionary getUsage()
public void setCreatorInfo(String creator, String subtype)
creator
- a text string specifying the application that created the groupsubtype
- a string defining the type of content controlled by the group. Suggested
values include but are not limited to Artwork, for graphic-design or publishing
applications, and Technical, for technical designs such as building plans or
schematicspublic void setLanguage(String lang, boolean preferred)
lang
- a language string which specifies a language and possibly a locale
(for example, es-MX represents Mexican Spanish)preferred
- used by viewer applications when there is a partial match but no exact
match between the system language and the language strings in all usage dictionariespublic void setExport(boolean export)
export
- the export statepublic void setZoom(float min, float max)
min
- the minimum recommended magnification factors at which the group
should be ON. A negative value will set the default to 0max
- the maximum recommended magnification factor at which the group
should be ON. A negative value will set the largest possible magnification supported by the
viewer applicationpublic void setPrint(String subtype, boolean printstate)
subtype
- a name specifying the kind of content controlled by the group;
for example, Trapping, PrintersMarks and Watermarkprintstate
- indicates that the group should be
set to that state when the document is printed from a viewer applicationpublic void setView(boolean view)
view
- the view statepublic boolean isOnPanel()
public void setOnPanel(boolean onPanel)
false
the layer cannot be directly manipulated by the user. Note that any children layers will
also be absent from the panel.
onPanel
- the visibility of the layer in Acrobat's layer panel
|
Hosted by Hostbasket | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |