Nalika pangembang ngowahi Markdown dokumen nganggo perpustakaan Java iki, sing lagi diowahi yaiku Model Obyek Dokumen (DOM). Dadi, meh kabeh owah-owahan bisa ditindakake kanggo Markdown dokumen sing diwakili minangka DOM. Kanthi Java SDK sing disedhiyakake, pangembang bisa kanthi gampang nyunting dokumen: ngowahi teks, nganyari tabel, nambah gambar lan liya-liyane. Cukup mbukak Markdown, gawe owah-owahan sing dibutuhake kanthi program lan ekspor asil menyang format nyimpen sing padha utawa sing didhukung.
Pustaka Java kita menehi pangembang kemampuan kanggo ngowahi Markdown dokumen kanthi langsung kanthi nyunting Document Object Model (DOM), tegese ora ana piranti lunak tambahan sing kudu diinstal.
Kasus sing paling populer kanggo nyunting Markdown file yaiku nyunting teks. Kanthi solusi piranti lunak sing diwenehake, sampeyan bisa nambah, ngowahi utawa mbusak teks nggunakake Java ing dokumen kasebut.
Pilihan editing Markdown liyane sing populer yaiku nyunting tabel. Java SDK kita ngidini sampeyan nggarap tabel lan teks ing sel tabel.
Pangembang Java bisa nambah utawa mbusak sel tabel lan tabel, uga nambah, ngowahi lan mbusak teks ing njero.
Saliyane nyunting teks lan tabel ing Markdown, ana pilihan umum liyane: nambahake gambar menyang dokumen ing Java. Pangembang Java uga bisa nambah gambar menyang Markdown file nggunakake DOM.
Coba Java SDK sing kuat iki lan evaluasi sawetara opsi ing panyuntingan Markdown dokumen. Nggunakake conto ing ngisor iki, muat Markdown dokumen lan gawe sawetara owah-owahan: nambah teks, nambah tabel lan sel tabel kanthi teks utawa lebokake gambar menyang Markdown dokumen:
import com.aspose.words.cloud.*;
ApiClient apiClient = new ApiClient("####-####-####-####-####", "##################", null);
WordsApi wordsApi = new WordsApi(apiClient);
byte[] requestDocument = Files.readAllBytes(Paths.get(
"Input.md").toAbsolutePath());
ParagraphInsert requestParagraph = new ParagraphInsert();
requestParagraph.setText("Morbi enim nunc faucibus a.");
InsertParagraphOnlineRequest insertParagraphRequest = new InsertParagraphOnlineRequest(
requestDocument, requestParagraph, null, null, null, null, null, null, null, null);
InsertParagraphOnline insertParagraph = wordsApi.insertParagraphOnline(insertParagraphRequest);
ConvertDocumentRequest convertRequest = new ConvertDocumentRequest(
insertParagraph.getDocument().iterator().next(), "md", null, null, null, null);
ConvertDocument convert = wordsApi.convertDocument(convertRequest);
import com.aspose.words.cloud.*;
ApiClient apiClient = new ApiClient("####-####-####-####-####", "##################", null);
WordsApi wordsApi = new WordsApi(apiClient);
byte[] requestDocument = Files.readAllBytes(Paths.get(
"Input.md").toAbsolutePath());
TableInsert requestTable = new TableInsert();
requestTable.setColumnsCount(1);
requestTable.setRowsCount(2);
InsertTableOnlineRequest insertTableRequest = new InsertTableOnlineRequest(requestDocument,
requestTable, "", null, null, null, null, null, null);
InsertTableOnline insertTable = wordsApi.insertTableOnline(insertTableRequest);
ConvertDocumentRequest convertRequest = new ConvertDocumentRequest(
insertTable.getDocument().iterator().next(), "md", null, null, null, null);
ConvertDocument convert = wordsApi.convertDocument(convertRequest);
import com.aspose.words.cloud.*;
ApiClient apiClient = new ApiClient("####-####-####-####-####", "##################", null);
WordsApi wordsApi = new WordsApi(apiClient);
byte[] requestDocument = Files.readAllBytes(Paths.get(
"Input1.md").toAbsolutePath());
DrawingObjectInsert requestDrawingObject = new DrawingObjectInsert();
requestDrawingObject.setHeight((double)0);
requestDrawingObject.setLeft((double)0);
requestDrawingObject.setTop((double)0);
requestDrawingObject.setWidth((double)0);
requestDrawingObject.setRelativeHorizontalPosition(
DrawingObjectInsert.RelativeHorizontalPositionEnum.MARGIN);
requestDrawingObject.setRelativeVerticalPosition(
DrawingObjectInsert.RelativeVerticalPositionEnum.MARGIN);
requestDrawingObject.setWrapType(DrawingObjectInsert.WrapTypeEnum.INLINE);
byte[] requestImageFile = Files.readAllBytes(Paths.get(
"Input2.md").toAbsolutePath());
InsertDrawingObjectOnlineRequest insertDrawingObjectRequest =
new InsertDrawingObjectOnlineRequest(requestDocument, requestDrawingObject,
requestImageFile, "sections/0", null, null, null, null, null, null);
InsertDrawingObjectOnline insertDrawingObject =
wordsApi.insertDrawingObjectOnline(insertDrawingObjectRequest);
ConvertDocumentRequest convertRequest = new ConvertDocumentRequest(
insertDrawingObject.getDocument().iterator().next(), "md", null, null, null, null);
ConvertDocument convert = wordsApi.convertDocument(convertRequest);
Instal 'Aspose.Words Cloud SDK for Java' nggunakake alat otomatisasi mbangun Maven.
Tambah ketergantungan iki menyang POM proyek sampeyan:
Minangka alternatif, sampeyan bisa clone Aspose.Words Cloud SDK for Java saka GitHub lan nggunakake ing project. Tututi Instructions iki supaya cepet entuk kredensial keamanan sing dibutuhake lan ngakses REST API kita.
Deleng Repository Documentation kanggo ndeleng rincian.
Sampeyan bisa nindakake operasi suntingan kanggo format file liyane: