@Override public AlternativeFormatInputPart addAltChunk(AltChunkType type, byte[] bytes) throws Docx4JException { AlternativeFormatInputPart afiPart = new AlternativeFormatInputPart(type); Relationship altChunkRel = this.addTargetPart(afiPart, AddPartBehaviour.RENAME_IF_NAME_EXISTS); // now that its attached to the package .. afiPart.registerInContentTypeManager(); afiPart.setBinaryData(bytes); // .. the bit in document body CTAltChunk ac = Context.getWmlObjectFactory().createCTAltChunk(); ac.setId(altChunkRel.getId() ); if (this instanceof ContentAccessor) { ((ContentAccessor)this).getContent().add(ac); } else { throw new Docx4JException(this.getClass().getName() + " doesn't implement ContentAccessor"); } return afiPart; }
@Override public AlternativeFormatInputPart addAltChunk(AltChunkType type, InputStream is) throws Docx4JException { AlternativeFormatInputPart afiPart = new AlternativeFormatInputPart(type); Relationship altChunkRel = this.addTargetPart(afiPart, AddPartBehaviour.RENAME_IF_NAME_EXISTS); // now that its attached to the package .. afiPart.registerInContentTypeManager(); afiPart.setBinaryData(is); // .. the bit in document body CTAltChunk ac = Context.getWmlObjectFactory().createCTAltChunk(); ac.setId(altChunkRel.getId() ); if (this instanceof ContentAccessor) { ((ContentAccessor)this).getContent().add(ac); } else { throw new Docx4JException(this.getClass().getName() + " doesn't implement ContentAccessor"); } return afiPart; }
@Override public AlternativeFormatInputPart addAltChunk(AltChunkType type, byte[] bytes, ContentAccessor attachmentPoint) throws Docx4JException { AlternativeFormatInputPart afiPart = new AlternativeFormatInputPart(type); Relationship altChunkRel = this.addTargetPart(afiPart, AddPartBehaviour.RENAME_IF_NAME_EXISTS); // now that its attached to the package .. afiPart.registerInContentTypeManager(); afiPart.setBinaryData(bytes); // .. the bit in document body CTAltChunk ac = Context.getWmlObjectFactory().createCTAltChunk(); ac.setId(altChunkRel.getId() ); attachmentPoint.getContent().add(ac); return afiPart; }
@Override public AlternativeFormatInputPart addAltChunk(AltChunkType type, InputStream is, ContentAccessor attachmentPoint) throws Docx4JException { AlternativeFormatInputPart afiPart = new AlternativeFormatInputPart(type); Relationship altChunkRel = this.addTargetPart(afiPart, AddPartBehaviour.RENAME_IF_NAME_EXISTS); // now that its attached to the package .. afiPart.registerInContentTypeManager(); afiPart.setBinaryData(is); // .. the bit in document body CTAltChunk ac = Context.getWmlObjectFactory().createCTAltChunk(); ac.setId(altChunkRel.getId() ); attachmentPoint.getContent().add(ac); return afiPart; }
@Override public AlternativeFormatInputPart addAltChunk(AltChunkType type, InputStream is) throws Docx4JException { AlternativeFormatInputPart afiPart = new AlternativeFormatInputPart(type); Relationship altChunkRel = this.addTargetPart(afiPart, AddPartBehaviour.RENAME_IF_NAME_EXISTS); // now that its attached to the package .. afiPart.registerInContentTypeManager(); afiPart.setBinaryData(is); // .. the bit in document body CTAltChunk ac = Context.getWmlObjectFactory().createCTAltChunk(); ac.setId(altChunkRel.getId() ); if (this instanceof ContentAccessor) { ((ContentAccessor)this).getContent().add(ac); } else { throw new Docx4JException(this.getClass().getName() + " doesn't implement ContentAccessor"); } return afiPart; }
@Override public AlternativeFormatInputPart addAltChunk(AltChunkType type, byte[] bytes) throws Docx4JException { AlternativeFormatInputPart afiPart = new AlternativeFormatInputPart(type); Relationship altChunkRel = this.addTargetPart(afiPart, AddPartBehaviour.RENAME_IF_NAME_EXISTS); // now that its attached to the package .. afiPart.registerInContentTypeManager(); afiPart.setBinaryData(bytes); // .. the bit in document body CTAltChunk ac = Context.getWmlObjectFactory().createCTAltChunk(); ac.setId(altChunkRel.getId() ); if (this instanceof ContentAccessor) { ((ContentAccessor)this).getContent().add(ac); } else { throw new Docx4JException(this.getClass().getName() + " doesn't implement ContentAccessor"); } return afiPart; }
@Override public AlternativeFormatInputPart addAltChunk(AltChunkType type, InputStream is, ContentAccessor attachmentPoint) throws Docx4JException { AlternativeFormatInputPart afiPart = new AlternativeFormatInputPart(type); Relationship altChunkRel = this.addTargetPart(afiPart, AddPartBehaviour.RENAME_IF_NAME_EXISTS); // now that its attached to the package .. afiPart.registerInContentTypeManager(); afiPart.setBinaryData(is); // .. the bit in document body CTAltChunk ac = Context.getWmlObjectFactory().createCTAltChunk(); ac.setId(altChunkRel.getId() ); attachmentPoint.getContent().add(ac); return afiPart; }
@Override public AlternativeFormatInputPart addAltChunk(AltChunkType type, byte[] bytes, ContentAccessor attachmentPoint) throws Docx4JException { AlternativeFormatInputPart afiPart = new AlternativeFormatInputPart(type); Relationship altChunkRel = this.addTargetPart(afiPart, AddPartBehaviour.RENAME_IF_NAME_EXISTS); // now that its attached to the package .. afiPart.registerInContentTypeManager(); afiPart.setBinaryData(bytes); // .. the bit in document body CTAltChunk ac = Context.getWmlObjectFactory().createCTAltChunk(); ac.setId(altChunkRel.getId() ); attachmentPoint.getContent().add(ac); return afiPart; }