Class MetafileWmfPart
java.lang.Object
org.docx4j.openpackaging.Base
org.docx4j.openpackaging.parts.Part
org.docx4j.openpackaging.parts.WordprocessingML.BinaryPart
org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractImage
org.docx4j.openpackaging.parts.WordprocessingML.MetafilePart
org.docx4j.openpackaging.parts.WordprocessingML.MetafileWmfPart
public class MetafileWmfPart extends MetafilePart
Summary: docx4j can convert WMF files to SVG using pure Java approach.
Note regarding options for converting WMF files to SVG and/or PNG
(as at Feb 2010):
- com.adobe.dp.office
- wmf2svg
- batik
- freehep
- imagemagick
- openoffice
wmf2tosvg is a good solution for WMF (although it has no EMF support).
For WMF, we'll use it. This can be revisited if/when com.adobe.dp.office
improves.
(EMF is the real problem - see note in MetafileEmfPart)
Batik has WMFTranscoder, but not EMFTranscoder! Even if it did,
Batik is best avoided as it is no good on appengine since it uses
awt, and spawns threads.
imagemagick does a nice job with WMF, but has no support for EMF at all
(other than on Windows). So given that we are stuck with a partial
solution, its best to use pure Java.
For completeness, a note that openoffice can be used to convert EMF
and WMF; I found it worked well.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMetafileWmfPart.SvgDocumentNested classes/interfaces inherited from class org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractImage
BinaryPartAbstractImage.CxCy -
Field Summary
Fields inherited from class org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractImage
log -
Constructor Summary
Constructors Constructor Description MetafileWmfPart(ExternalTarget externalTarget)MetafileWmfPart(PartName partName) -
Method Summary
Modifier and Type Method Description voidinit()MetafileWmfPart.SvgDocumenttoSVG()Methods inherited from class org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractImage
convertToPNG, copy2, createImageInline, createImageInline, createImageInline, createImageInline, createImageInline, createImageInline, createImageName, createImageName, createImagePart, createImagePart, createImagePart, createImagePart, createImagePart, createImagePart, createLinkedImagePart, createLinkedImagePart, displayImageInfo, getImage, getImageInfo, getImageInfo, getImageManager, getRelLast, getRels, main, setDensity, setImageInfoMethods inherited from class org.docx4j.openpackaging.parts.WordprocessingML.BinaryPart
getBuffer, getBytes, getExternalTarget, isContentEqual, isLoaded, setBinaryData, setBinaryData, setBinaryData, writeDataToOutputStreamMethods inherited from class org.docx4j.openpackaging.parts.Part
getContentLengthAsLoaded, getOwningRelationshipPart, getPackage, getRelationshipType, getSourceRelationship, getSourceRelationships, getVersion, remove, rename, setContentLengthAsLoaded, setOwningRelationshipPart, setPackage, setPartShortcut, setRelationshipType, setSourceRelationship, setVersionMethods inherited from class org.docx4j.openpackaging.Base
addTargetPart, addTargetPart, addTargetPart, addTargetPart, getContentType, getPartName, getRelationshipsPart, getRelationshipsPart, getUserData, reset, setContentType, setPartName, setRelationships, setUserData