GroupDocs.Editor for Java API를 사용하면 HTML 형식의 문서 편집이 가능합니다. API는 여러 문서 형식을 지원하며 모든 외부, 오픈 소스 또는 유료 HTML 편집기와 통합할 수 있습니다. Editor API는 문서를 불러와서 HTML로 변환하고 HTML을 외부 UI에 제공하고 조작 후 HTML을 원본 문서에 저장하는 처리를 합니다. 또한 다양한 Microsoft Word, Excel 스프레드시트, PowerPoint 파일, OpenDocument 형식, XML 및 TXT 문서를 생성하는 데 사용할 수도 있습니다.
Java용 GroupDocs.Editor를 사용하면 지원되는 파일 형식의 문서를 로드하여 관련 요소(예: CSS)와 함께 HTML DOM(문서 개체 모델)으로 변환하는 Java 응용 프로그램을 빌드할 수 있습니다. 또한 Editor Java API를 사용하면 인기 있는 HTML 편집기에서 HTML을 편집할 수 있습니다. 필요한 수정이 완료되면 Java용 GroupDocs.Editor를 사용하여 이 결과 HTML을 원래 파일 형식으로 다시 변환할 수 있습니다.
// Create Editor class by loading an input document
Editor editor = new Editor("Sample.docx");
// Open document for edit and obtain EditableDocument
EditableDocument original = editor.edit();
// Obtain all-embedded HTML from it
String allEmbeddedInside = original.getEmbeddedHtml();
// If necessary, obtain pure HTML-markup, CSS, images and other resources in separate form
// Whole HTML-markup, without any resources
String completeHtmlMarkup = original.getContent();
// Only HTML->BODY content, useful for most of WYSIWYG-editors
String onlyInnerBody = original.getBodyContent();
// All CSS stylesheets
List<CssText> stylesheets = original.getCss();
// All images, including raster and vector, but without CSS gradients
List<IImageResource> images = original.getImages();
// All font resources
List<FontResourceBase> fonts = original.getFonts();
// finally, send this content to your WYSIWYG HTML-editor
Java API용 GroupDocs.Editor를 사용하면 이미지, CSS, 글꼴 등과 같이 지원되는 형식의 문서에서 관련 요소를 가져올 수 있습니다. 그런 다음 가져온 연결된 요소를 로드하고 탐색하고 최종 HTML 파일과 별도로 저장하고 잘 관리된 출력을 가질 수 있습니다.