public class Artifact extends Object implements com.aspose.ms.System.IDisposable
Class represetns PDF Artifact object.
Modifier and Type | Class and Description |
---|---|
static class |
Artifact.ArtifactSubtype
Enumeration of possible artifacts subtype.
|
static class |
Artifact.ArtifactType
Enumeration of possuble artifact types.
|
Constructor and Description |
---|
Artifact(ArtifactCollection owner,
Resources resources,
Matrix matrix,
com.aspose.ms.System.Collections.ArrayList _contents,
com.aspose.pdf.engine.data.IPdfDictionary _properties)
This constructor is used when artifact is read from the page.
|
Artifact(int type,
int subType)
Constructor of artifact with specified type and subtype
|
Artifact(String type,
String subType)
Constructor of artifact with specified type and subtype
|
Modifier and Type | Method and Description |
---|---|
void |
beginUpdates()
Start delated updates.
|
void |
dispose()
Dispose the artifact.
|
int |
getArtifactHorizontalAlignment()
Horizontal alignment of artifact.
|
int |
getArtifactVerticalAlignment()
Vertical alignment of artifact.
|
double |
getBottomMargin()
Bottom margin of artifact.
|
com.aspose.ms.System.Collections.IList |
getContentsInternal()
Gets collection of artifact internal operators.
|
String |
getCustomSubtype()
Gets name of artifact subtype.
|
String |
getCustomType()
Gets name of artifact type.
|
XForm |
getForm()
Gets XForm of the artifact (if XForm is used).
|
XImage |
getImage()
Gets image of the artifact (if presents).
|
double |
getLeftMargin()
Left margin of artifact.
|
double |
getOpacity()
Gets or sets opacity of the artifact.
|
Point |
getPosition()
Gets or sets artifact position.
|
Rectangle |
getRectangle()
Gets rectangle of the artifact.
|
double |
getRightMargin()
Right margin of artifact.
|
double |
getRotation()
Gets or sets articat rotatin angle.
|
int |
getSubtype()
Gets artifact subtype.
|
String |
getText()
Gets text of the artifact.
|
double |
getTopMargin()
Top margin of artifact.
|
int |
getType()
Gets artifact type.
|
String |
getValue(String name)
Gets custom value of artifact.
|
void |
removeValue(String name)
Remove custom value from the artifact.
|
void |
saveUpdates()
Saves all updates in artifact which were made after BeginUpdates() call.
|
void |
setArtifactHorizontalAlignment(int value) |
void |
setArtifactVerticalAlignment(int value) |
void |
setBottomMargin(double value) |
void |
setCustomSubtype(String value) |
void |
setCustomType(String value) |
void |
setImage(com.aspose.ms.System.IO.Stream imageStream)
Sets image of the artifact.
|
void |
setImage(String imageName)
Sets image of the artifact.
|
void |
setLeftMargin(double value) |
void |
setOpacity(double value) |
void |
setPdfPage(Page page)
Sets PDF page which is placed on the document page as artifact.
|
void |
setPosition(Point value) |
void |
setRightMargin(double value) |
void |
setRotation(double value) |
void |
setSubtype(int value) |
void |
setText(FormattedText formattedText)
Sets text of the artifact.
|
void |
setText(String value) |
void |
setTopMargin(double value) |
void |
setType(int value) |
void |
setValue(String name,
String value)
Sets custom value of artifact.
|
public Artifact(ArtifactCollection owner, Resources resources, Matrix matrix, com.aspose.ms.System.Collections.ArrayList _contents, com.aspose.pdf.engine.data.IPdfDictionary _properties)
owner
- resources
- matrix
- _contents
- _properties
- public Artifact(String type, String subType)
type
- Name of artifact type.subType
- NAme of artifact subtype.public Artifact(int type, int subType)
Constructor of artifact with specified type and subtype
type
- Artifact type.subType
- Artifact subtype.public String getCustomType()
Gets name of artifact type. May be used if artifact type is non standard.
public void setCustomType(String value)
public String getCustomSubtype()
public void setCustomSubtype(String value)
public int getType()
Gets artifact type.
public void setType(int value)
public int getSubtype()
public void setSubtype(int value)
public com.aspose.ms.System.Collections.IList getContentsInternal()
public XForm getForm()
Gets XForm of the artifact (if XForm is used).
public Rectangle getRectangle()
public Point getPosition()
Gets or sets artifact position. If this property is specified, then margins and alignments are ignored.
public void setPosition(Point value)
public double getRightMargin()
public void setRightMargin(double value)
public double getLeftMargin()
public void setLeftMargin(double value)
public double getTopMargin()
Top margin of artifact. If position is specified explicitly (in Position property) this value is ignored.
public void setTopMargin(double value)
public double getBottomMargin()
Bottom margin of artifact. If position is specified explicitly (in Position property) this value is ignored.
public void setBottomMargin(double value)
public int getArtifactHorizontalAlignment()
public void setArtifactHorizontalAlignment(int value)
public int getArtifactVerticalAlignment()
Vertical alignment of artifact. If position is specified explicitly (in Position property) this value is ignored.
public void setArtifactVerticalAlignment(int value)
public double getRotation()
Gets or sets articat rotatin angle.
public void setRotation(double value)
public String getText()
Gets text of the artifact.
public void setText(String value)
public XImage getImage()
public double getOpacity()
Gets or sets opacity of the artifact. Possible values are in range 0..1.
public void setOpacity(double value)
public void setText(FormattedText formattedText)
Sets text of the artifact.
formattedText
- FormattedText object which contains artifact text.public void setImage(com.aspose.ms.System.IO.Stream imageStream)
Sets image of the artifact.
imageStream
- Stream which contains image data.public void setImage(String imageName)
Sets image of the artifact.
imageName
- Name of image file.public void setPdfPage(Page page)
Sets PDF page which is placed on the document page as artifact.
page
- Page which is placed as Artifcact.public void dispose()
Dispose the artifact.
dispose
in interface com.aspose.ms.System.IDisposable
public String getValue(String name)
Gets custom value of artifact.
name
- Name of value.public void setValue(String name, String value)
Sets custom value of artifact.
name
- Name of custom value.value
- Custom value in the artifact.public void removeValue(String name)
Remove custom value from the artifact.
name
- Name of custom value to be removed.public void beginUpdates()
Artifact art = doc.getPages().get_Item(1).getArtifacts().get_Item(1);
art.beginUpdates();
art.setOpacity ( 0.3f);
art.setPosition ( new Point(10,10));
art.setRotation (30);
art.saveUpdates();
public void saveUpdates()
Saves all updates in artifact which were made after BeginUpdates() call.
Copyright © 2014 Aspose. All Rights Reserved.