public abstract class DocumentWriter extends DocumentBase
Provides general methods of the system. PdfGeneral is an abstract class inherited from class PdfBase.
Modifier and Type | Field and Description |
---|---|
com.aspose.ms.System.Collections.Hashtable |
clipObjects |
Rectangle |
ClippingArea |
boolean |
HasUnicodeInBookmark |
boolean |
IsUnicodeWithWordSpacing |
JavaScripts |
JavaScripts |
XmpMetadata |
XmpMetadata |
int |
XmpMetadataID |
LastObjIdOfEveryPage
Modifier and Type | Method and Description |
---|---|
static byte[] |
adjustBuffer(byte[] buf) |
static byte[] |
adjustBuffer1(byte[] buf) |
void |
beginContentsSection()
Starts a new content section.
|
void |
beginDict()
Starts a new PDF dictionary.
|
int |
beginObj(int objID)
Starts a object and return its ID.
|
void |
beginPage(float width,
float height)
Creates new page with given width and hight.
|
void |
beginPath()
Starts a new path if current state is not in path.
|
void |
beginStream()
Starts a PDF stream.
|
void |
close(Pdf doc)
Writes all pending tags and contents into the memory stream.
|
void |
closePath()
Puts close path info to PDF stream.
|
void |
compress(DocumentWriter writer) |
void |
endContentSection()
Ends content section description in a Pdf document.
|
void |
endDict()
Ends PDF dictionary description.
|
void |
endObj()
Ends object description in a Pdf document.
|
void |
endPage()
End page description in a Pdf document.
|
void |
endPath()
Closes path state and go back to page state.
|
void |
endStream()
Ends stream description in a Pdf document.
|
void |
endText()
Ends PDF text content.
|
byte[] |
getBuffer() |
boolean |
isIdentityMatrix(Matrix m)
Verifies whether the given matrix is identity.
|
void |
lineTo(float x,
float y)
Draws line to a given position.
|
void |
moveTo(float x,
float y)
Moves the draw pen to a specified position.
|
int |
newXobject(int type,
int objectID)
Creates new xobject according to given xobject type and object ID.
|
void |
open(com.aspose.ms.System.IO.Stream docStream)
Creates a new Pdf document using the supplied stream.
|
void |
open(String fileName)
Creates a new Pdf document using the supplied file name.
|
void |
putToStream(byte[] array)
CPuts bytes array to the file stream associated with the Pdf document
|
void |
putToStream(String strMsg)
Converts a string to bytes array and puts it to the file stream
associated with the Pdf document.
|
void |
restoreState()
Restores graphics,text and color states
|
void |
restoreToState(int saveLevel) |
void |
saveState()
Saves graphics,text and color states.
|
void |
setClippingArea() |
void |
setDash(float b,
float w)
Sets line dash pattern.
|
void |
setFileName(String fileName) |
void |
setLineCap(int cap)
Sets linecap info..
|
void |
setLineWidth(float width)
Sets the line width before draw a line.
|
void |
stroke()
Stroke the path and clear it.
|
void |
writeEnquotedSting(String text)
Puts text contents to stream.
|
allocID, checkScope, getCommon, getCompatibility, getCompressionLevel, getConformance, getCurrentMCID, getDocInfo, getDocObject, getDocResource, getEncryptionInfo, getHyperTextInfo, getLinearized, getPageInfo, getPageLayoutInfo, getState, isBuffered, isBuffered, setCompressionLevel, setConformance, setCurrentMCID, setCurrentStructElement, setLinearized
public boolean IsUnicodeWithWordSpacing
public boolean HasUnicodeInBookmark
public JavaScripts JavaScripts
public XmpMetadata XmpMetadata
public int XmpMetadataID
public Rectangle ClippingArea
public com.aspose.ms.System.Collections.Hashtable clipObjects
public void open(String fileName)
Creates a new Pdf document using the supplied file name.
fileName
- Name of the PDF output file to be generated. If filename
is empty("") the PDF document will be generated in memory instead of on
file.The result must be fetched by the client with the GetBuffer()
method. .public void setFileName(String fileName)
public void open(com.aspose.ms.System.IO.Stream docStream)
Creates a new Pdf document using the supplied stream.
docStream
- The stream to write the document.public void close(Pdf doc)
Writes all pending tags and contents into the memory stream. If user specilized a file name,copy the memory stream to filestream and close PDF file stream and memory stream.
public byte[] getBuffer()
public void beginPage(float width, float height)
Creates new page with given width and hight. System predefined pages width and hight in PageSize can be used. These pages include A0,A1,A2,A3,A4,A5,A6,B5,Letter,Legal,Ledger and P11x17.
width
- the width of page,float type.height
- the hight of page,float type.PageSize
public void putToStream(String strMsg)
Converts a string to bytes array and puts it to the file stream associated with the Pdf document.
strMsg
- the string to be put.public void putToStream(byte[] array)
CPuts bytes array to the file stream associated with the Pdf document
strMsg
- the string to be put.public int newXobject(int type, int objectID)
Creates new xobject according to given xobject type and object ID.
type
- The type of the xobject to be created.objectID
- The object ID of the xobject.public void beginContentsSection()
Starts a new content section.
public int beginObj(int objID)
Starts a object and return its ID.
objID
- The ID of the object to be started. if the value is 0, the
operation will allocate a new ID for it.public void beginDict()
Starts a new PDF dictionary.
public void beginStream()
Starts a PDF stream.
public void beginPath()
Starts a new path if current state is not in path.
public void endDict()
Ends PDF dictionary description.
public boolean isIdentityMatrix(Matrix m)
Verifies whether the given matrix is identity.
m
- the given matrixpublic void endPage()
End page description in a Pdf document. When this method is called, all pending objects about current page will be writen to stream,and the info about current page will be ckeaned up for next use.
public void endStream()
Ends stream description in a Pdf document.
public void endObj()
Ends object description in a Pdf document.
public void endText()
Ends PDF text content.
public void endContentSection()
Ends content section description in a Pdf document.
public void compress(DocumentWriter writer)
public void writeEnquotedSting(String text)
Puts text contents to stream. the stream beginning with '(' and end with ')'.
text
- public static byte[] adjustBuffer1(byte[] buf)
public static byte[] adjustBuffer(byte[] buf)
public void saveState()
Saves graphics,text and color states.
public void restoreState()
Restores graphics,text and color states
public void restoreToState(int saveLevel)
public void setLineWidth(float width)
Sets the line width before draw a line.
width
- the width value.public void setLineCap(int cap)
Sets linecap info.. linecap is used to controls the shape at the end of a line path.
cap
- public void setDash(float b, float w)
Sets line dash pattern.
b
- the number of black line unitsw
- the nubmer of white line units public void moveTo(float x, float y)
Moves the draw pen to a specified position.
x
- The x-coordinate of the position.y
- The y-coordinate of the position.public void lineTo(float x, float y)
Draws line to a given position.
x
- The x-coordinate of the position.y
- The y-coordinate of the position.public void stroke()
Stroke the path and clear it.
public void endPath()
Closes path state and go back to page state.
public void closePath()
Puts close path info to PDF stream.
public void setClippingArea()
Copyright © 2016 Aspose. All Rights Reserved.