Package org.odftoolkit.simple

Examples of org.odftoolkit.simple.TextDocument.save()


          fieldRtg, "CurrencyField", "135.467");
      ((CurrencyField) currencyField).setCurrencySymbol("CNY");
      ((CurrencyField) currencyField).setDecimalAccuracy(4);
      ((CurrencyField) currencyField).setSpinButonVisible(true);

      doc
          .save(ResourceUtilities
              .newTestOutputFile("TestCreateField.odt"));

    } catch (Exception e) {
      Logger.getLogger(FieldTest.class.getName()).log(Level.SEVERE, null,
View Full Code Here


          find = field;
          break;
        }
      }
      Assert.assertNull(find);
      textDoc.save(ResourceUtilities
          .newTestOutputFile("TestRemoveField.odt"));
    } catch (Exception e) {
      Logger.getLogger(FieldTest.class.getName()).log(Level.SEVERE, null,
          e);
    }
View Full Code Here

          SupportedLinearMeasure.IN));
      Assert.assertEquals(6.0, find.getRectangle().getWidth());
      Assert.assertEquals(2.5, find.getRectangle().getHeight());
      Assert.assertEquals(0.2, find.getRectangle().getY());
      Assert.assertEquals(2.2546, find.getRectangle().getX());
      textDoc.save(ResourceUtilities
          .newTestOutputFile("TestSetFieldRectangle.odt"));
    } catch (Exception e) {
      Logger.getLogger(FieldTest.class.getName()).log(Level.SEVERE, null,
          e);
    }
View Full Code Here

      Assert.assertEquals(VerticalRelative.BASELINE,
          graphicPropertiesForWrite.getVerticalRelative());
      Assert.assertEquals(FrameVerticalPosition.TOP,
          graphicPropertiesForWrite.getVerticalPosition());

      textDoc.save(ResourceUtilities
          .newTestOutputFile("TestSetFieldAnchorType.odt"));
    } catch (Exception e) {
      Logger.getLogger(FieldTest.class.getName()).log(Level.SEVERE, null,
          e);
    }
View Full Code Here

          find = field;
          break;
        }
      }
     
      textDoc.save(ResourceUtilities
          .newTestOutputFile("TestSetFormatValue.odt"));
    } catch (Exception e) {
      Logger.getLogger(FieldTest.class.getName()).log(Level.SEVERE, null,
          e);
    }
View Full Code Here

      TextDocument doc = TextDocument.newTextDocument();
      Paragraph para = doc.addParagraph("");
      Image image = Image.newImage(para, ResourceUtilities.getURI("image_list_item.png"));
      image.setName("this image");
      image.setHyperlink(new URI("http://odftoolkit.org"));
      doc.save(ResourceUtilities.newTestOutputFile("imagetest.odt"));
      Iterator<Image> iter = Image.imageIterator(para);
      if (iter.hasNext()) {
        Image aImage = iter.next();
        Assert.assertEquals(image, aImage);
      }
View Full Code Here

      Cell cell1 = table1.getCellByPosition(0, 0);
      Image image3 = cell1.setImage(ResourceUtilities.getURI("image_list_item.png"));
      image3.setHorizontalPosition(FrameHorizontalPosition.LEFT);
      image3.setHyperlink(new URI("http://odftoolkit.org"));
      Assert.assertEquals("http://odftoolkit.org", image3.getHyperlink().toString());
      sDoc.save(ResourceUtilities.newTestOutputFile("imges.odt"));

      SpreadsheetDocument sheet = SpreadsheetDocument.newSpreadsheetDocument();
      Table table2 = sheet.getTableList().get(0);
      Cell cell2 = table2.getCellByPosition(1, 1);
      Image image4 = cell2.setImage(ResourceUtilities.getURI("image_list_item.png"));
View Full Code Here

      para = cell.addParagraph("Insert a text box here.");
      form3.createTextBox(para, btnRtg, "Text Box", "TextBox", true);

      Assert.assertNotNull(doc.getFormByName("Form1"));

      doc.save(ResourceUtilities.newTestOutputFile("TestCreateForm.odt"));
    } catch (Exception e) {
      Logger.getLogger(AbstractFormContainerTest.class.getName()).log(
          Level.SEVERE, null, e);
    }
  }
View Full Code Here

      image.setName("this test image");
      image.setHyperlink(new URI("http://odftoolkit.org"));
      //image.remove();
     
      //save
      doc.save(ResourceUtilities.newTestOutputFile("imageFretest.odt"));
     
      TextDocument doc1 = TextDocument.loadDocument(ResourceUtilities.getAbsolutePath("imageFretest.odt"));
      Iterator parasIter = doc1.getParagraphIterator();
     
      while(parasIter.hasNext()){
View Full Code Here

            Assert.fail("remove() method was executed failed.");
        }
      }
     
      //save
      doc1.save(ResourceUtilities.newTestOutputFile("imageEndtest.odt"));
     
      //validate
      TextDocument doc2 = TextDocument.loadDocument(ResourceUtilities.getAbsolutePath("imageEndtest.odt"));
      Iterator parasIter2 = doc2.getParagraphIterator();
     
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.