Class MetaDo
- java.lang.Object
-
- com.itextpdf.kernel.pdf.canvas.wmf.MetaDo
-
public class MetaDo extends java.lang.Object
A class to process WMF files. Used internally byWmfImageHelper
.
-
-
Field Summary
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static float
getArc(float xCenter, float yCenter, float xDot, float yDot)
boolean
isNullStrokeFill(boolean isRectangle)
Return true if the pen style is null and if it isn't a brush.void
outputText(int x, int y, int flag, int x1, int y1, int x2, int y2, java.lang.String text)
Output Text at a certain x and y coordinate.void
readAll()
Reads and processes all the data of the InputMeta.void
strokeAndFill()
Stroke and fill the MetaPen and MetaBrush paths.static byte[]
wrapBMP(ImageData image)
Wrap a BMP image in an WMF.static void
writeDWord(java.io.OutputStream os, int v)
Writes the specified value to the specified outputstream as a dword.static void
writeWord(java.io.OutputStream os, int v)
Writes the specified value to the specified outputstream as a word.
-
-
-
Field Detail
-
META_SETBKCOLOR
public static final int META_SETBKCOLOR
- See Also:
- Constant Field Values
-
META_SETBKMODE
public static final int META_SETBKMODE
- See Also:
- Constant Field Values
-
META_SETMAPMODE
public static final int META_SETMAPMODE
- See Also:
- Constant Field Values
-
META_SETROP2
public static final int META_SETROP2
- See Also:
- Constant Field Values
-
META_SETRELABS
public static final int META_SETRELABS
- See Also:
- Constant Field Values
-
META_SETPOLYFILLMODE
public static final int META_SETPOLYFILLMODE
- See Also:
- Constant Field Values
-
META_SETSTRETCHBLTMODE
public static final int META_SETSTRETCHBLTMODE
- See Also:
- Constant Field Values
-
META_SETTEXTCHAREXTRA
public static final int META_SETTEXTCHAREXTRA
- See Also:
- Constant Field Values
-
META_SETTEXTCOLOR
public static final int META_SETTEXTCOLOR
- See Also:
- Constant Field Values
-
META_SETTEXTJUSTIFICATION
public static final int META_SETTEXTJUSTIFICATION
- See Also:
- Constant Field Values
-
META_SETWINDOWORG
public static final int META_SETWINDOWORG
- See Also:
- Constant Field Values
-
META_SETWINDOWEXT
public static final int META_SETWINDOWEXT
- See Also:
- Constant Field Values
-
META_SETVIEWPORTORG
public static final int META_SETVIEWPORTORG
- See Also:
- Constant Field Values
-
META_SETVIEWPORTEXT
public static final int META_SETVIEWPORTEXT
- See Also:
- Constant Field Values
-
META_OFFSETWINDOWORG
public static final int META_OFFSETWINDOWORG
- See Also:
- Constant Field Values
-
META_SCALEWINDOWEXT
public static final int META_SCALEWINDOWEXT
- See Also:
- Constant Field Values
-
META_OFFSETVIEWPORTORG
public static final int META_OFFSETVIEWPORTORG
- See Also:
- Constant Field Values
-
META_SCALEVIEWPORTEXT
public static final int META_SCALEVIEWPORTEXT
- See Also:
- Constant Field Values
-
META_LINETO
public static final int META_LINETO
- See Also:
- Constant Field Values
-
META_MOVETO
public static final int META_MOVETO
- See Also:
- Constant Field Values
-
META_EXCLUDECLIPRECT
public static final int META_EXCLUDECLIPRECT
- See Also:
- Constant Field Values
-
META_INTERSECTCLIPRECT
public static final int META_INTERSECTCLIPRECT
- See Also:
- Constant Field Values
-
META_ARC
public static final int META_ARC
- See Also:
- Constant Field Values
-
META_ELLIPSE
public static final int META_ELLIPSE
- See Also:
- Constant Field Values
-
META_FLOODFILL
public static final int META_FLOODFILL
- See Also:
- Constant Field Values
-
META_PIE
public static final int META_PIE
- See Also:
- Constant Field Values
-
META_RECTANGLE
public static final int META_RECTANGLE
- See Also:
- Constant Field Values
-
META_ROUNDRECT
public static final int META_ROUNDRECT
- See Also:
- Constant Field Values
-
META_PATBLT
public static final int META_PATBLT
- See Also:
- Constant Field Values
-
META_SAVEDC
public static final int META_SAVEDC
- See Also:
- Constant Field Values
-
META_SETPIXEL
public static final int META_SETPIXEL
- See Also:
- Constant Field Values
-
META_OFFSETCLIPRGN
public static final int META_OFFSETCLIPRGN
- See Also:
- Constant Field Values
-
META_TEXTOUT
public static final int META_TEXTOUT
- See Also:
- Constant Field Values
-
META_BITBLT
public static final int META_BITBLT
- See Also:
- Constant Field Values
-
META_STRETCHBLT
public static final int META_STRETCHBLT
- See Also:
- Constant Field Values
-
META_POLYGON
public static final int META_POLYGON
- See Also:
- Constant Field Values
-
META_POLYLINE
public static final int META_POLYLINE
- See Also:
- Constant Field Values
-
META_ESCAPE
public static final int META_ESCAPE
- See Also:
- Constant Field Values
-
META_RESTOREDC
public static final int META_RESTOREDC
- See Also:
- Constant Field Values
-
META_FILLREGION
public static final int META_FILLREGION
- See Also:
- Constant Field Values
-
META_FRAMEREGION
public static final int META_FRAMEREGION
- See Also:
- Constant Field Values
-
META_INVERTREGION
public static final int META_INVERTREGION
- See Also:
- Constant Field Values
-
META_PAINTREGION
public static final int META_PAINTREGION
- See Also:
- Constant Field Values
-
META_SELECTCLIPREGION
public static final int META_SELECTCLIPREGION
- See Also:
- Constant Field Values
-
META_SELECTOBJECT
public static final int META_SELECTOBJECT
- See Also:
- Constant Field Values
-
META_SETTEXTALIGN
public static final int META_SETTEXTALIGN
- See Also:
- Constant Field Values
-
META_CHORD
public static final int META_CHORD
- See Also:
- Constant Field Values
-
META_SETMAPPERFLAGS
public static final int META_SETMAPPERFLAGS
- See Also:
- Constant Field Values
-
META_EXTTEXTOUT
public static final int META_EXTTEXTOUT
- See Also:
- Constant Field Values
-
META_SETDIBTODEV
public static final int META_SETDIBTODEV
- See Also:
- Constant Field Values
-
META_SELECTPALETTE
public static final int META_SELECTPALETTE
- See Also:
- Constant Field Values
-
META_REALIZEPALETTE
public static final int META_REALIZEPALETTE
- See Also:
- Constant Field Values
-
META_ANIMATEPALETTE
public static final int META_ANIMATEPALETTE
- See Also:
- Constant Field Values
-
META_SETPALENTRIES
public static final int META_SETPALENTRIES
- See Also:
- Constant Field Values
-
META_POLYPOLYGON
public static final int META_POLYPOLYGON
- See Also:
- Constant Field Values
-
META_RESIZEPALETTE
public static final int META_RESIZEPALETTE
- See Also:
- Constant Field Values
-
META_DIBBITBLT
public static final int META_DIBBITBLT
- See Also:
- Constant Field Values
-
META_DIBSTRETCHBLT
public static final int META_DIBSTRETCHBLT
- See Also:
- Constant Field Values
-
META_DIBCREATEPATTERNBRUSH
public static final int META_DIBCREATEPATTERNBRUSH
- See Also:
- Constant Field Values
-
META_STRETCHDIB
public static final int META_STRETCHDIB
- See Also:
- Constant Field Values
-
META_EXTFLOODFILL
public static final int META_EXTFLOODFILL
- See Also:
- Constant Field Values
-
META_DELETEOBJECT
public static final int META_DELETEOBJECT
- See Also:
- Constant Field Values
-
META_CREATEPALETTE
public static final int META_CREATEPALETTE
- See Also:
- Constant Field Values
-
META_CREATEPATTERNBRUSH
public static final int META_CREATEPATTERNBRUSH
- See Also:
- Constant Field Values
-
META_CREATEPENINDIRECT
public static final int META_CREATEPENINDIRECT
- See Also:
- Constant Field Values
-
META_CREATEFONTINDIRECT
public static final int META_CREATEFONTINDIRECT
- See Also:
- Constant Field Values
-
META_CREATEBRUSHINDIRECT
public static final int META_CREATEBRUSHINDIRECT
- See Also:
- Constant Field Values
-
META_CREATEREGION
public static final int META_CREATEREGION
- See Also:
- Constant Field Values
-
cb
public PdfCanvas cb
PdfCanvas of the MetaDo object.
-
in
public InputMeta in
The InputMeta instance containing the data.
-
left
int left
-
top
int top
-
right
int right
-
bottom
int bottom
-
inch
int inch
-
state
MetaState state
-
-
Constructor Detail
-
MetaDo
public MetaDo(java.io.InputStream in, PdfCanvas cb)
Creates a MetaDo instance.- Parameters:
in
- inputstream containing the datacb
- PdfCanvas
-
-
Method Detail
-
readAll
public void readAll() throws java.io.IOException
Reads and processes all the data of the InputMeta.- Throws:
java.io.IOException
- anIOException
-
outputText
public void outputText(int x, int y, int flag, int x1, int y1, int x2, int y2, java.lang.String text) throws java.io.IOException
Output Text at a certain x and y coordinate. Clipped or opaque text isn't supported as of yet.- Parameters:
x
- x-coordinatey
- y-coordinateflag
- flag indicating clipped or opaquex1
- x1-coordinate of the rectangle if clipped or opaquey1
- y1-coordinate of the rectangle if clipped or opaquex2
- x2-coordinate of the rectangle if clipped or opaquey2
- y1-coordinate of the rectangle if clipped or opaquetext
- text to output- Throws:
java.io.IOException
- anIOException
-
isNullStrokeFill
public boolean isNullStrokeFill(boolean isRectangle)
Return true if the pen style is null and if it isn't a brush.- Parameters:
isRectangle
- value to decide how to change the state. If true state.setLineJoinRectangle(cb) is called, if false state.setLineJoinPolygon(cb) is called.- Returns:
- true if the pen style is null and if it isn't a brush
-
strokeAndFill
public void strokeAndFill()
Stroke and fill the MetaPen and MetaBrush paths.
-
getArc
static float getArc(float xCenter, float yCenter, float xDot, float yDot)
-
wrapBMP
public static byte[] wrapBMP(ImageData image) throws java.io.IOException
Wrap a BMP image in an WMF.- Parameters:
image
- the BMP image to be wrapped- Returns:
- the wrapped BMP
- Throws:
java.io.IOException
- anIOException
-
writeWord
public static void writeWord(java.io.OutputStream os, int v) throws java.io.IOException
Writes the specified value to the specified outputstream as a word.- Parameters:
os
- outputstream to write the word tov
- value to be written- Throws:
java.io.IOException
- anIOException
-
writeDWord
public static void writeDWord(java.io.OutputStream os, int v) throws java.io.IOException
Writes the specified value to the specified outputstream as a dword.- Parameters:
os
- outputstream to write the dword tov
- value to be written- Throws:
java.io.IOException
- anIOException
-
-