public class ImageWriter extends ColorsWriter
Encapsulates methods to generate image in PDF.
IsCoreFontUsed, isFontNotFoundExceptionThrown, IsUnderlineWritten, LastRequestedFontWasNonTruetypeItalicButWasSubtitutedWithTrueTypeNonItalic, MustUseFontMapFile, textRotatingAngle
clipObjects, ClippingArea, HasUnicodeInBookmark, IsUnicodeWithWordSpacing, JavaScripts, XmpMetadata, XmpMetadataID
LastObjIdOfEveryPage
Constructor and Description |
---|
ImageWriter() |
ImageWriter(IFontUriResolver externalFontResolver,
IResourceLoader externalResourceLoader) |
Modifier and Type | Method and Description |
---|---|
void |
arc(float[] arcData)
Draws a counterclockwise circular arc segment.
|
void |
circle(float x,
float y,
float r)
Draws a circle on given position with given radius.
|
void |
clip()
Uses the current path as clipping path.
|
void |
curveTo(float[] positionData)
Draws a curve from the current point, using three more control points.
|
void |
ellipse(float x1,
float y1,
float x2,
float y2) |
void |
fillStroke()
Fills the interior of the path with the current fill color and stroke.
|
int |
openImage(int imageType,
int sourceType,
String dataSource,
byte[] memoryData,
int width,
int height,
boolean isBlack1,
int components,
int bitsPerComponent,
String parameters,
com.aspose.ms.System.Drawing.Color color)
Reads info from image data source and puts the info into Pdf
document.
|
void |
putImageInfoToOutStream(int imageHandle,
ImageInfo imageInfo)
Places image on given position.
|
void |
rectangle(float[] rectangleData)
Draws a rectangle on specified position.
|
void |
rotate(float phi)
Rotates the user coordinate system by the given angle.
|
void |
roundRectangle(float x,
float y,
float w,
float h,
float r) |
void |
scale(float sx,
float sy)
Scales the coordinate system according to given ratio.
|
void |
setColors(GeneratorBase gen,
GraphInfo graphInfo) |
void |
setFillRule(String value) |
void |
setFlatness(float value) |
void |
setLineCapMode(int value) |
void |
setLineJoinMode(int value) |
void |
setLineWidth(float value)
Sets the line width before draw a line.
|
void |
setMiterLimit(float value) |
void |
setpolyDash(PolyDashArray polyDashArray)
Sets a more complicated dash pattern defined by an array.
|
void |
skew(float alpha,
float beta)
Skews the coordinate system according to the given degrees..
|
void |
strokeAndFill(GraphInfo graphInfo) |
void |
translate(float tx,
float ty)
Translates the origin of the coordinate system.
|
int |
tryLoadCcitImage(String fileName,
int width,
int height,
boolean bitReverse,
int encodingScheme,
boolean blackIs1,
com.aspose.ms.System.IO.Stream imgStream)
Reads info from a CCITT image and puts the info into Pdf document.
|
int |
tryLoadImageToResources(Image image,
int imageType,
String imageFileName,
String defaultImageFileName,
String stringParameter,
int intParameter,
int frameNumIfTiff,
boolean isErrIgnored,
boolean isBlackWhite,
byte[] imageData,
com.aspose.ms.System.IO.Stream imageStream,
BlendInfo blendInfo)
Reads info from an image file and puts the info into Pdf document.
|
addPatternInResource, adjustPatternMatrix, beginTilingPattern, endTilingPattern, setColor, writeShadingGradientPattern
doReverse, doReverse, findOrLoadFont, findOrLoadRelevantFont, getFontDescender, getFontStreams, getLeading, getLengthOfBiggestWordLoadFontIfNecessary, getStringWidth, getTextRise, getTtFontFileName, isFontWarning, isFontWarning, isNeedInitRes, isNeedInitRes, isOverline, isOverline, isStrikeout, isStrikeout, isUnderline, isUnderline, loadSuitableCustomFontIfAbsentYet, loadSuitableFontIfNotYetAndGetStringWidth, reverseStringAndReturnEmptyStringIfNull, setCharSpacing, setCurrentFont, setCustomFonts, setDefaultFontName, setFont, setFontStreams, setFontStretch, setFontWeight, setHorizScaling, setLeading, setOverlineOffset, setSegmentDefaultFontName, setTextRenderingMode, setTextRise, setUnderlineOffset, setWordSpacing, showBoxedText, showOnPosition
adjustBuffer, adjustBuffer1, beginContentsSection, beginDict, beginObj, beginPage, beginPath, beginStream, close, closePath, compress, endContentSection, endDict, endObj, endPage, endPath, endStream, endText, getBuffer, isIdentityMatrix, lineTo, moveTo, newXobject, open, open, putToStream, putToStream, restoreState, restoreToState, saveState, setClippingArea, setDash, setFileName, setLineCap, stroke, writeEnquotedSting
allocID, checkScope, getCommon, getCompatibility, getCompressionLevel, getConformance, getCurrentMCID, getDocInfo, getDocObject, getDocResource, getEncryptionInfo, getHyperTextInfo, getLinearized, getPageInfo, getPageLayoutInfo, getState, isBuffered, isBuffered, setCompressionLevel, setConformance, setCurrentMCID, setCurrentStructElement, setLinearized
public ImageWriter()
public ImageWriter(IFontUriResolver externalFontResolver, IResourceLoader externalResourceLoader)
public int tryLoadImageToResources(Image image, int imageType, String imageFileName, String defaultImageFileName, String stringParameter, int intParameter, int frameNumIfTiff, boolean isErrIgnored, boolean isBlackWhite, byte[] imageData, com.aspose.ms.System.IO.Stream imageStream, BlendInfo blendInfo)
Reads info from an image file and puts the info into Pdf document.
imageType
- The image file type.imageFileName
- A string that indicates the image file name.stringParameter
- A string that indicates the type of parameter used
when open the image file. This string can be :
"mask","masked","ignoremask","invert","page" and "colorize". Mask is used
to get transparent image. The "mask" parameter means this image is opened
to use as a mask for other image. Image used as mask can be 1 bit depth
PNG or TIFF image. The parameter "masked" means the image be opened with
given mask. The "ignoremask" parameter means ignores transparent info of
the image. The "invert" parameter means inverts black and white for 1
bits TIFF image. The "page" parameter means the image is a multi-page
TIFF file. The parameter "colorize" means colorizes grayscale image with
a spot color returned by MakeSpotColor() method.intParameter
- If the string parameter is "mask", this parameter
should be 0; If the string parameter is "masked", this parameter should
be the handle of the mask; If the string parameter is "ignoremask", this
parameter should be 0; If the string parameter is "invert", this
parameter should be 0; If the string parameter is "page", this parameter
should be the page number; If the string parameter is "colorize", this
parameter should be the spot color handle;public int openImage(int imageType, int sourceType, String dataSource, byte[] memoryData, int width, int height, boolean isBlack1, int components, int bitsPerComponent, String parameters, com.aspose.ms.System.Drawing.Color color)
Reads info from image data source and puts the info into Pdf document.
imageType
- The iamge type. Jpeg and ccitt are supported.sourceType
- A string that indicates the type of the data source.
"fileref","url" and "memory" are supported.dataSource
- A string that indicates the name of the data source.memoryData
- If the source type is "memory", this bytes array
contains the image data. If not,this parameter should be null.width
- The width of the image.height
- The height of the image.components
- The number of color component.bitsPerComponent
- The number of bits per compont of the image.parameters
- If this parameter is "mask",this image will be used as
a mask.public int tryLoadCcitImage(String fileName, int width, int height, boolean bitReverse, int encodingScheme, boolean blackIs1, com.aspose.ms.System.IO.Stream imgStream)
Reads info from a CCITT image and puts the info into Pdf document.
fileName
- A string that indicates the image file name.width
- An int value that indicates the width of the image.height
- An int value that indicates the height of the image.bitReverse
- A bool value that indicates whether do bitwise
reversal.encodingScheme
- An int value that indicates the encoding sheme of
the CCITT image. -1 means group4 encoding, 0 means group3-1D encoding,1
means group3-2D encoding.blackIs1
- A bool value that indicates whether the bit 1 should be
interpreted as black.public void putImageInfoToOutStream(int imageHandle, ImageInfo imageInfo)
Places image on given position.
imageHandle
- The image handle.imageInfo
- A float array that contains position and scale info.
This array should contains 3 numbers. The first number indicates
x-coordinate of the position; the second number indicates y-coordinate of
the position;the last number indicates the scale value which should be
between 0 and 1.public void curveTo(float[] positionData)
Draws a curve from the current point, using three more control points.
positionData
- The coordinates array,size is 6,which contains the coordinates of
the three control points.public void circle(float x, float y, float r)
Draws a circle on given position with given radius.
x
- The x-coordinate of the center of the circle.y
- The y-coordinate of the center of the circle.r
- The radius of the circle.public void ellipse(float x1, float y1, float x2, float y2)
public void arc(float[] arcData)
Draws a counterclockwise circular arc segment.
arcData
- An array with five float object that indicates the arc info.
public void rectangle(float[] rectangleData)
Draws a rectangle on specified position.
rectangleData
- An array contains four float number which indicate the rectangle info.
public void roundRectangle(float x, float y, float w, float h, float r)
public void setpolyDash(PolyDashArray polyDashArray)
Sets a more complicated dash pattern defined by an array.
dashData
- An array which contains alternating values for black and white dash lengths.public void setFlatness(float value)
public void setLineWidth(float value)
DocumentWriter
Sets the line width before draw a line.
setLineWidth
in class DocumentWriter
value
- the width value.public void setLineJoinMode(int value)
public void setLineCapMode(int value)
public void setMiterLimit(float value)
public void setFillRule(String value)
public void translate(float tx, float ty)
Translates the origin of the coordinate system.
tx
- The x-coordinate of the new origin of the coordinate system,measured in the old coordinate system.ty
- The y-coordinate of the new origin of the coordinate system,measured in the old coordinate system.public void fillStroke()
Fills the interior of the path with the current fill color and stroke.
public void clip()
Uses the current path as clipping path.
public void scale(float sx, float sy)
Scales the coordinate system according to given ratio.
sx
- The scale ratio on x diration.sy
- The scale ratio on y diration.public void rotate(float phi)
Rotates the user coordinate system by the given angle.
phi
- The rotation angle in degrees.public void skew(float alpha, float beta)
Skews the coordinate system according to the given degrees..
alpha
- The degree in x direction.beta
- The degree in y direction.
public void setColors(GeneratorBase gen, GraphInfo graphInfo)
public void strokeAndFill(GraphInfo graphInfo)
Copyright © 2016 Aspose. All Rights Reserved.