Package org.odftoolkit.odfdom.pkg

Examples of org.odftoolkit.odfdom.pkg.OdfPackage.save()


        }
      }
    };
    removeImages.performAction(doc.getContentDom().getDocumentElement(),
        null);
    pkg.save(ResourceUtilities.getTestOutput("remove-images.odt"));

  }

  @Test
  public void testImageInTextDocument() {
View Full Code Here


      // loads the images from the URLs and inserts the image in the package, adapting the manifest
      pkg.insert(ResourceUtilities.getURI(TEST_PIC), "Pictures/" + TEST_PIC, null);
      //Deactivated as test fail, when test machine is not online (painful for offline work)
      //pkg.insert(new URI("http://odftoolkit.org/attachments/wiki_images/odftoolkit/Table_fruits_diagramm.jpg"), "someweiredname/tableandfruits.jpg", null);
      pkg.save(ResourceUtilities.newTestOutputFile("odfdom-wiki-package.odt"));


      /////////////////////////////////////
      // ODFDOM XML LAYER - WIKI EXAMPLE //
      /////////////////////////////////////
View Full Code Here

    // Deactivated as test fail, when test machine is not online
    // (painful for offline work)
    // pkg.insert(new
    // URI("http://odftoolkit.org/attachments/wiki_images/odftoolkit/Table_fruits_diagramm.jpg"),
    // "someweiredname/tableandfruits.jpg", null);
    pkg.save(ResourceUtilities.newTestOutputFile("simple-wiki-package.odt"));

    // loads the ODF document from the path
    Document odfDoc = Document.loadDocument(ResourceUtilities
        .getTestResourceAsStream("TestEmpty_OdfTextDocument.odt"));
View Full Code Here

        {
            aLogger.logInfo( "Storing transformation result to '" + aOutputName + "'");
            if( !bError && aOutputStream != null )
                aOutputStream.close();
            if( !bError && aOutputPkg != null )
                aOutputPkg.save(aOutputFile);
            if( aOutputMode == OUTPUT_MODE_FILE && aExtractFileNames != null && aInputPkg != null )
            {
                File aTargetDir = aOutputFile.getParentFile();
                extractFiles( aInputPkg, aTargetDir, aExtractFileNames, aLogger );
            }
View Full Code Here

      // Deactivated as test fail, when test machine is not online
      // (painful for offline work)
      // pkg.insert(new
      // URI("http://odftoolkit.org/attachments/wiki_images/odftoolkit/Table_fruits_diagramm.jpg"),
      // "someweiredname/tableandfruits.jpg", null);
      pkg.save(ResourceUtilities.newTestOutputFile("simple-wiki-package.odt"));

      // loads the ODF document from the path
      Document odfDoc = Document.loadDocument(ResourceUtilities
          .getTestResourceAsStream("TestEmpty_OdfTextDocument.odt"));
View Full Code Here

    OdfPackage pkg = OdfPackage.loadPackage("/home/myDocuments/myVacation.odt");

    // loads the image from the URL and inserts the image in the package,
    // adapting the manifest
    pkg.insert(new URI("./myHoliday.png"), "Pictures/myHoliday.png", "image/png");
    pkg.save("/home/myDocuments/myVacation.odt");



    //********************************************************************
    // WIKI EXAMPLE II from http://odftoolkit.org/projects/odfdom/pages/Layers
View Full Code Here

        }
      }
    };
    removeImages.performAction(doc.getContentDom().getDocumentElement(),
        null);
    pkg.save(ResourceUtilities.getTestOutput("remove-images.odt"));

  }

  @Test
  public void testImageInTextDocument() {
View Full Code Here

      // loads the images from the URLs and inserts the image in the package, adapting the manifest
      pkg.insert(ResourceUtilities.getURI(TEST_PIC), "Pictures/" + TEST_PIC, null);
      //Deactivated as test fail, when test machine is not online (painful for offline work)
      //pkg.insert(new URI("http://odftoolkit.org/attachments/wiki_images/odftoolkit/Table_fruits_diagramm.jpg"), "someweiredname/tableandfruits.jpg", null);
      pkg.save(ResourceUtilities.newTestOutputFile("odfdom-wiki-package.odt"));


      /////////////////////////////////////
      // ODFDOM XML LAYER - WIKI EXAMPLE //
      /////////////////////////////////////
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.