Package com.aspose.words

Examples of com.aspose.words.Document.save()


    Document doc = new Document("data/docx4j/document.doc");
   
    doc.save("data/docx4j/html/Aspose_DocToHTML.html",SaveFormat.HTML); //Save the document in HTML format.
    doc.save("data/docx4j/Aspose_DocToPDF.pdf",SaveFormat.PDF); //Save the document in PDF format.
    doc.save("data/docx4j/Aspose_DocToTxt.txt",SaveFormat.TEXT); //Save the document in TXT format.
    doc.save("data/docx4j/Aspose_DocToJPG.jpg",SaveFormat.JPEG); //Save the document in JPEG format.
       
        System.out.println("Aspose - Doc file converted in specified formats");
  }
}
View Full Code Here


{
  public static void main(String[] args) throws Exception
  {
    Document doc = new Document("data/document.doc");
    Document clone = doc.deepClone();
    clone.save("data/AsposeClone.doc", SaveFormat.DOC);
  }
}
View Full Code Here

    // By name.
    Bookmark bookmark = doc.getRange().getBookmarks().get("AsposeBookmark");
    bookmark.remove();
   
    doc.save("data/docx4j/Aspose_BookmarkDeleted.doc", SaveFormat.DOC);
    System.out.println("Done.");
  }
}
View Full Code Here

{
  public static void main(String[] args) throws Exception
  {
        Document doc = new Document("data/document.doc");
        insertWatermarkText(doc, "CONFIDENTIAL");
        doc.save("data/AsposeWatermark.doc");
  }
 
  /**
     * Inserts a watermark into a document.
     *
 
View Full Code Here

    //Replace "\r" control character with "\r\n"
    text = text.replace(ControlChar.CR, ControlChar.CR_LF);
    System.out.println("Doc Text: " + text);
   
    doc.save("data/AsposeControlChars.doc", SaveFormat.DOC);
  }
}
View Full Code Here

    pageSetup.setLeftMargin(ConvertUtil.inchToPoint(0.5));
    pageSetup.setRightMargin(ConvertUtil.inchToPoint(0.5));
    pageSetup.setHeaderDistance(ConvertUtil.inchToPoint(0.2));
    pageSetup.setFooterDistance(ConvertUtil.inchToPoint(0.2));
   
    doc.save("data/AsposePageBorders.docx");
  }
}
View Full Code Here

    doc.protect(ProtectionType.READ_ONLY);
//    doc.protect(ProtectionType.ALLOW_ONLY_COMMENTS);
//    doc.protect(ProtectionType.ALLOW_ONLY_FORM_FIELDS);
//    doc.protect(ProtectionType.ALLOW_ONLY_REVISIONS);
   
    doc.save("data/AsposeProtect.doc", SaveFormat.DOC);
  }
}
View Full Code Here

    Comment comment = new Comment(doc, "Aspose", "As", new Date());
    builder.getCurrentParagraph().appendChild(comment);
    comment.getParagraphs().add(new Paragraph(doc));
    comment.getFirstParagraph().getRuns().add(new Run(doc, "Comment text."));

    doc.save("data/AsposeComments.docx");
  }
}
View Full Code Here

    doc.getRange().replace("sad", "bad", false, true);
   
    // Replaces all 'sad' and 'mad' occurrences with 'bad'
    doc.getRange().replace(Pattern.compile("[s|m]ad"), "bad");
   
    doc.save("data/AsposeReplaced.doc", SaveFormat.DOC);
  }
}
View Full Code Here

            shape.getParentNode().insertAfter(image, shape);
            shape.remove();
        }
    }

    doc.save("data/AsposeReplaceTextboxesWithImages.doc");
  }
}
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.