Package org.docx4j.openpackaging.packages

Examples of org.docx4j.openpackaging.packages.SpreadsheetMLPackage


        || pkgContentType.equals(ContentTypes.SPREADSHEETML_WORKBOOK_MACROENABLED)
        || pkgContentType.equals(ContentTypes.SPREADSHEETML_TEMPLATE)
        || pkgContentType.equals(ContentTypes.SPREADSHEETML_TEMPLATE_MACROENABLED) ) {
      //  "xlam", "xlsb" ?
      log.info("Detected SpreadhseetMLPackage package ");
      p = new SpreadsheetMLPackage(this);
      return p;     
    } else if (pkgContentType.equals(ContentTypes.DRAWINGML_DIAGRAM_LAYOUT) ) {
      log.info("Detected Glox file ");
      p = new GloxPackage(this);
      return p;           
View Full Code Here


      throw new Docx4JException("Could find EmbeddedPackagePart: " + xlsPartName);
    }
   
    InputStream is = BufferUtil.newInputStream(epp.getBuffer());
   
    SpreadsheetMLPackage spreadSheet = (SpreadsheetMLPackage) SpreadsheetMLPackage.load(is);

    Map<PartName,Part> partsMap = spreadSheet.getParts().getParts();    
    Iterator<Entry<PartName, Part>> it = partsMap.entrySet().iterator();

    while(it.hasNext()) {
      Map.Entry<PartName, Part> pairs = it.next();
     
View Full Code Here

  public static void main(String[] args) throws Exception {
 
    String outputfilepath = System.getProperty("user.dir") + "/OUT_Xlsx4JAddImage.xlsx";
    String imagefilePath = System.getProperty("user.dir")+"/src/test/resources/images/greentick.png" ;
   
    SpreadsheetMLPackage pkg = SpreadsheetMLPackage.createPackage();
    WorksheetPart worksheet = pkg.createWorksheetPart(new PartName("/xl/worksheets/sheet1.xml"), "Sheet1", 1);

    // Create Drawing part and add to sheet
    Drawing drawingPart = new Drawing();
    Relationship drawingRel = worksheet.addTargetPart(drawingPart);
View Full Code Here

          try {

              String outputfilepath = System.getProperty("user.dir") + "/OUT_XlsxAddComment.xlsx";

              SpreadsheetMLPackage pkg = SpreadsheetMLPackage.createPackage();

              WorksheetPart sheet = pkg.createWorksheetPart(new PartName("/xl/worksheets/sheet1.xml"), "Sheet1", 1);
              addContent(sheet);

              pkg.save(new File(outputfilepath));

              System.out.println("\n\n done .. " + outputfilepath);  

          } catch (Exception e) {
              e.printStackTrace();
View Full Code Here

   * @throws JAXBException
   * @throws Docx4JException
   */
  public static void main(String[] args) throws JAXBException, Docx4JException {
    // TODO Auto-generated method stub
    SpreadsheetMLPackage pkg = SpreadsheetMLPackage.createPackage();
       
    WorksheetPart sheet = pkg.createWorksheetPart(new PartName("/sheet1.xml"), "Sheet1", 1);
         
    CTSheetFormatPr format = Context.getsmlObjectFactory().createCTSheetFormatPr();
    format.setDefaultRowHeight(5);
    format.setCustomHeight(Boolean.TRUE);
    sheet.getJaxbElement().setSheetFormatPr(format);
View Full Code Here

 
  public static void main(String[] args) throws Exception {
 
    String outputfilepath = System.getProperty("user.dir") + "/OUT_CreateSimpleSpreadsheet.xlsx";
   
    SpreadsheetMLPackage pkg = SpreadsheetMLPackage.createPackage();
   
    WorksheetPart sheet = pkg.createWorksheetPart(new PartName("/xl/worksheets/sheet1.xml"), "Sheet1", 1);
   
    addContent(sheet);
   
    SaveToZipFile saver = new SaveToZipFile(pkg);
    saver.save(outputfilepath);
View Full Code Here

{
  public static void main(String[] args) throws Exception {
   
    String outputfilepath = "data/xlsx4j/newWorksheet_Xlsx4j.xlsx";
   
    SpreadsheetMLPackage pkg = SpreadsheetMLPackage.createPackage();
   
    WorksheetPart sheet = pkg.createWorksheetPart(new PartName("/xl/worksheets/sheet1.xml"), "Sheet1", 1);
   
    addContent(sheet);
   
    SaveToZipFile saver = new SaveToZipFile(pkg);
    saver.save(outputfilepath);
View Full Code Here

      throw new Docx4JException("Could find EmbeddedPackagePart: " + xlsPartName);
    }
   
    InputStream is = BufferUtil.newInputStream(epp.getBuffer());
   
    SpreadsheetMLPackage spreadSheet = (SpreadsheetMLPackage) SpreadsheetMLPackage.load(is);

    Map<PartName,Part> partsMap = spreadSheet.getParts().getParts();    
    Iterator<Entry<PartName, Part>> it = partsMap.entrySet().iterator();

    while(it.hasNext()) {
      Map.Entry<PartName, Part> pairs = it.next();
     
View Full Code Here

  public static void main(String[] args) throws Exception {
   
    String outputfilepath = System.getProperty("user.dir") + "/data/xlsx4j/AddImage-Xlsx4j.xlsx";
    String imagefilePath  = System.getProperty("user.dir") + "/data/xlsx4j/greentick.png" ;
   
    SpreadsheetMLPackage pkg = SpreadsheetMLPackage.createPackage();
    WorksheetPart worksheet = pkg.createWorksheetPart(new PartName("/xl/worksheets/sheet1.xml"), "Sheet1", 1);

    // Create Drawing part and add to sheet
    Drawing drawingPart = new Drawing();
    Relationship drawingRel = worksheet.addTargetPart(drawingPart);
View Full Code Here

   * @throws JAXBException
   * @throws Docx4JException
   */
  public static void main(String[] args) throws JAXBException, Docx4JException {
    // TODO Auto-generated method stub
    SpreadsheetMLPackage pkg = SpreadsheetMLPackage.createPackage();
       
    WorksheetPart sheet = pkg.createWorksheetPart(new PartName("/sheet1.xml"), "Sheet1", 1);
         
    CTSheetFormatPr format = Context.getsmlObjectFactory().createCTSheetFormatPr();
    format.setDefaultRowHeight(5);
    format.setCustomHeight(Boolean.TRUE);
    sheet.getJaxbElement().setSheetFormatPr(format);
View Full Code Here

TOP

Related Classes of org.docx4j.openpackaging.packages.SpreadsheetMLPackage

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.