Package org.odftoolkit.odfdom.dom

Examples of org.odftoolkit.odfdom.dom.OdfSchemaDocument


      // Insert Image resource to package
      DrawImageElement imageElement = imageContainer.newDrawImageElement();
      InputStream is = image.getImageInputStream();
      String internalPath = image.getInternalPath();
      String mediaType = OdfFileEntry.getMediaTypeString(internalPath);
      OdfSchemaDocument mOdfSchemaDoc = (OdfSchemaDocument) ownerDom.getDocument();
      String packagePath = Image.getPackagePath(mOdfSchemaDoc,internalPath);
      mOdfSchemaDoc.getPackage().insert(is, packagePath, mediaType);
      packagePath = packagePath.replaceFirst(ownerDom.getDocument().getDocumentPath(), "");
      Image.configureInsertedImage((OdfSchemaDocument) ownerDom.getDocument(), imageElement,packagePath, false);
      // get image object
      mImage = Image.getInstanceof(imageElement);
      mImage.getStyleHandler().setAchorType(AnchorType.AS_CHARACTER);
View Full Code Here


      }
      // Insert Image resource to package
      DrawImageElement imageElement = imageContainer.newDrawImageElement();
      String imageRef = imageUri.toString();
      String mediaType = OdfFileEntry.getMediaTypeString(imageRef);
      OdfSchemaDocument mOdfSchemaDoc = (OdfSchemaDocument) ownerDom.getDocument();
      String packagePath = Image.getPackagePath(mOdfSchemaDoc, imageRef);
      mOdfSchemaDoc.getPackage().insert(imageUri, packagePath, mediaType);
      packagePath = packagePath.replaceFirst(ownerDom.getDocument().getDocumentPath(), "");
      Image.configureInsertedImage((OdfSchemaDocument) ownerDom.getDocument(), imageElement,packagePath, false);
      // get image object
      mImage = Image.getInstanceof(imageElement);
      mImage.getStyleHandler().setAchorType(AnchorType.AS_CHARACTER);
View Full Code Here

TOP

Related Classes of org.odftoolkit.odfdom.dom.OdfSchemaDocument

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.