Nalika pangembang ngowahi MD dokumen nganggo perpustakaan PHP iki, sing lagi diowahi yaiku Model Obyek Dokumen (DOM). Dadi, meh kabeh owah-owahan bisa ditindakake kanggo MD dokumen sing diwakili minangka DOM. Kanthi PHP SDK sing disedhiyakake, pangembang bisa kanthi gampang nyunting dokumen: ngowahi teks, nganyari tabel, nambah gambar lan liya-liyane. Cukup mbukak MD, gawe owah-owahan sing dibutuhake kanthi program lan ekspor asil menyang format nyimpen sing padha utawa sing didhukung.
Pustaka PHP kita menehi pangembang kemampuan kanggo ngowahi MD dokumen kanthi langsung kanthi nyunting Document Object Model (DOM), tegese ora ana piranti lunak tambahan sing kudu diinstal.
Kasus sing paling populer kanggo nyunting MD file yaiku nyunting teks. Kanthi solusi piranti lunak sing diwenehake, sampeyan bisa nambah, ngowahi utawa mbusak teks nggunakake PHP ing dokumen kasebut.
Pilihan editing MD liyane sing populer yaiku nyunting tabel. PHP SDK kita ngidini sampeyan nggarap tabel lan teks ing sel tabel.
Pangembang PHP bisa nambah utawa mbusak sel tabel lan tabel, uga nambah, ngowahi lan mbusak teks ing njero.
Saliyane nyunting teks lan tabel ing MD, ana pilihan umum liyane: nambahake gambar menyang dokumen ing PHP. Pangembang PHP uga bisa nambah gambar menyang MD file nggunakake DOM.
Coba PHP SDK sing kuat iki lan evaluasi sawetara opsi ing panyuntingan MD dokumen. Nggunakake conto ing ngisor iki, muat MD dokumen lan gawe sawetara owah-owahan: nambah teks, nambah tabel lan sel tabel kanthi teks utawa lebokake gambar menyang MD dokumen:
use Aspose\Words\WordsApi;
$wordsApi = new WordsApi('####-####-####-####-####', '##################');
$requestDocument = "Input.md";
$requestParagraph = new ParagraphInsert(array(
"text" => "Morbi enim nunc faucibus a.",
));
$insertParagraphRequest = new InsertParagraphOnlineRequest(
$requestDocument, $requestParagraph, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
);
$insertParagraph = $wordsApi->insertParagraphOnline($insertParagraphRequest);
$convertRequest = new ConvertDocumentRequest(
array_key_first($insertParagraph->document()->values()), "md", NULL, NULL, NULL, NULL
);
$convert = $wordsApi->convertDocument($convertRequest);
use Aspose\Words\WordsApi;
$wordsApi = new WordsApi('####-####-####-####-####', '##################');
$requestDocument = "Input.md";
$requestTable = new TableInsert(array(
"columns_count" => 1,
"rows_count" => 2,
));
$insertTableRequest = new InsertTableOnlineRequest(
$requestDocument, $requestTable, "", NULL, NULL, NULL, NULL, NULL, NULL
);
$insertTable = $wordsApi->insertTableOnline($insertTableRequest);
$convertRequest = new ConvertDocumentRequest(
array_key_first($insertTable->document()->values()), "md", NULL, NULL, NULL, NULL
);
$convert = $wordsApi->convertDocument($convertRequest);
use Aspose\Words\WordsApi;
$wordsApi = new WordsApi('####-####-####-####-####', '##################');
$requestDocument = "Input1.md";
$requestDrawingObject = new DrawingObjectInsert(array(
"height" => 0,
"left" => 0,
"top" => 0,
"width" => 0,
"relative_horizontal_position" => "Margin",
"relative_vertical_position" => "Margin",
"wrap_type" => "Inline",
));
$requestImageFile = "Input2.md";
$insertDrawingObjectRequest = new InsertDrawingObjectOnlineRequest(
$requestDocument, $requestDrawingObject, $requestImageFile, "sections/0", NULL,
NULL, NULL, NULL, NULL, NULL
);
$insertDrawingObject = $wordsApi->insertDrawingObjectOnline($insertDrawingObjectRequest);
$convertRequest = new ConvertDocumentRequest(
array_key_first($insertDrawingObject->document()->values()), "md", NULL, NULL, NULL, NULL
);
$convert = $wordsApi->convertDocument($convertRequest);
Instal 'Aspose.Words Cloud SDK for PHP' saka gudang Packagist. Mung mbukak composer require aspose-cloud/aspose-words-cloud kanggo nginstal SDK, banjur gunakake require_once('vendor/autoload.php'); kanggo ngimpor menyang proyek sampeyan.
Minangka alternatif, sampeyan bisa kanthi manual kloning Aspose.Words Cloud SDK for PHP saka GitHub. Tututi Instructions iki supaya cepet entuk kredensial keamanan sing dibutuhake lan ngakses REST API kita.
PHP 7.1 utawa luwih anyar
Deleng Repository Documentation kanggo ndeleng rincian liyane.
Sampeyan bisa nindakake operasi suntingan kanggo format file liyane: