public void init() { // Used if this Part is added to [Content_Types].xml // setContentType(new org.docx4j.openpackaging.contenttype.ContentType( // org.docx4j.openpackaging.contenttype.ContentTypes.PRESENTATION)); // Used when this Part is added to a rels setRelationshipType(Namespaces.EMBEDDED_PKG); }
/** * Returns a map of styles defined in docx4j's KnownStyles.xml * (not styles defined in your pkg) * @return */ public static java.util.Map<String, org.docx4j.wml.Style> getKnownStyles() { if (knownStyles==null) { initKnownStyles(); } return knownStyles; }
/** Get the image data of the buffer * * @param binaryPart * @return */ protected byte[] getImageData(BinaryPart binaryPart) { return binaryPart.getBytes(); }
protected void resolveLinkedAbstractNum(WordprocessingMLPackage wmlPkg) { if (wmlPkg.getMainDocumentPart().getStyleDefinitionsPart(false)!=null && wmlPkg.getMainDocumentPart().getNumberingDefinitionsPart()!=null) { wmlPkg.getMainDocumentPart().getNumberingDefinitionsPart().resolveLinkedAbstractNum( wmlPkg.getMainDocumentPart().getStyleDefinitionsPart(false)); } }
private Style getDefaultPStyle() { if (defaultParagraphStyle==null) { defaultParagraphStyle = (wordMLPackage.getMainDocumentPart().getStyleDefinitionsPart(false) != null ? wordMLPackage.getMainDocumentPart().getStyleDefinitionsPart(false).getDefaultParagraphStyle() : null); } return defaultParagraphStyle; }
protected boolean isInternalImage(AbstractWordXmlPicture picture, Relationship relationship, BinaryPart part) throws Docx4JException { //treat external images, that are loaded, as internal images return (part != null) && ((part.getExternalTarget() == null) || (part.getBuffer() != null)); }
public SvgDocument toSVG() throws Exception { InputStream is = BufferUtil.newInputStream(this.getBuffer() ); return new SvgDocument(is); // net.arnx.wmf2svg.Main.output(doc, out); }
public void setAltChunkType(AltChunkType altChunkType) { this.altChunkType = altChunkType; // ContentType will vary - see spec 11.3.1 this.setContentType(new ContentType(altChunkType.getContentType())); } public AltChunkType getAltChunkType() {
public ImageEpsPart(PartName partName) throws InvalidFormatException { super(partName); init(); }
public void setOverrideTableStyleFontSizeAndJustification(boolean val) { if (val) { setWordCompatSetting("overrideTableStyleFontSizeAndJustification", "1"); } else { setWordCompatSetting("overrideTableStyleFontSizeAndJustification", "0"); } }
/** * @since 3.0 */ public Style getDefaultTableStyle() { if (defaultTableStyle==null) { defaultTableStyle = getDefaultStyle("table"); } return defaultTableStyle; }
public boolean hasFootnotesPart() { if (getFootnotesPart()==null) { return false; } else { return true; } }
public MainDocumentPart(PartName partName) throws InvalidFormatException { super(partName); init(); } public MainDocumentPart() throws InvalidFormatException {
public BinaryPartAbstractImage(PartName partName) throws InvalidFormatException { super(partName); // Can't setContentType or setRelationshipType, since // these will differ depending on the nature of the data. // Common binary parts should extend this class to // provide that information. this.getOwningRelationshipPart(); }
public POIFSFileSystem getFs() throws IOException { if (fs==null) { initPOIFSFileSystem(); } return fs; }
public FootnotesPart(PartName partName) throws InvalidFormatException { super(partName); init(); }
public DocumentSettingsPart(PartName partName) throws InvalidFormatException { super(partName); init(); }
public BibliographyPart(PartName partName) throws InvalidFormatException { super(partName); init(); }
public GlossaryDocumentPart(PartName partName) throws InvalidFormatException { super(partName); init(); }
public ImageEpsPart(ExternalTarget externalTarget) { super(externalTarget); init(); }