文檔半島外圍網上直營>>Aspose中文文檔>>在PHP中快速開始
                在PHP中快速開始
Aspose.Words是一種高級Word文檔處理API,用于執行各種文檔管理和操作任務。API支持生成,修改,轉換,呈現和打印文檔,而無需在跨平臺應用程序中直接使用Microsoft Word。
附加文檔
PHP代碼示例:
$dataDir = '.';
$comHelper = new \COM("Aspose.Words.ComHelper");
// Load the destination and source documents from disk.
$dstDoc = $comHelper->Open($dataDir."/TestFile.Destination.doc");
$srcDoc = $comHelper->Open($dataDir."/TestFile.Source.doc");
// Append the source document to the destination document while keeping the original formatting of the source document.
$dstDoc->AppendDocument($srcDoc,1);
$dstDoc->Save($dataDir . "/TestFile Out.docx");
echo "Document appended successfully.\nFile saved at " . $dataDir . "TestFile Out.docx" . PHP_EOL;
下載運行代碼
從以下任何一個社交編碼網站下載附加文檔示例 (Aspose.Words) :
Document到PDF的轉換
PHP代碼示例:
$dataDir = '.';
$comHelper = new \COM("Aspose.Words.ComHelper");
$doc = $comHelper->Open($dataDir."/Template.doc");
// Save the document in PDF format.
$doc->Save($dataDir . "/Doc2PdfSave Out.pdf");
print "Document converted to PDF successfully.\nFile saved at " . $dataDir . "Doc2PdfSave Out.pdf" . PHP_EOL; 
下載運行代碼
從以下任何一個社交編碼網站下載附加文檔示例 (Aspose.Words) :查找和替換
PHP代碼示例:
$dataDir = '.';
$comHelper = new \COM("Aspose.Words.ComHelper");
$doc = $comHelper->Open($dataDir."/ReplaceSimple.doc");
// Check the text of the document
print "Original document text: " . $doc->Range->Text . PHP_EOL;
// Replace the text in the document.
$doc->Range->Replace("_CustomerName_", "James Bond", false, false);
// Check the replacement was made.
print "Original document text: " . $doc->Range->Text . PHP_EOL;
// Save the modified document.
$doc->Save($dataDir . "/ReplaceSimple Out.doc");
print "Text found and replaced successfully.\nFile saved at " . $dataDir . "ReplaceSimple Out.doc" . PHP_EOL;
下載運行代碼
從以下任何一個社交編碼網站下載附加文檔示例 (Aspose.Words) :HelloWorld 示例
PHP代碼:
<p>
	<a  target="_blank"><strong>Aspose.Words</strong></a>是一種高級Word文檔處理API,用于執行各種文檔管理和操作任務。API支持生成,修改,轉換,呈現和打印文檔,而無需在跨平臺應用程序中直接使用Microsoft Word。
</p>
<p align="center">
	<a  target="_blank" class="linkbutton"><strong>Aspose.Words for .NET 最新下載</strong></a> 
</p>
<p>
  <strong>PHP代碼</strong>:
</p>
<p>$dataDir = '.';<br>
  $doc = new \COM("Aspose.Words.Document");<br>
  $builder = new \COM("Aspose.Words.DocumentBuilder");<br>
  $builder->Document = $doc;<br>
  $builder->Write("Hello world!");<br>
$doc->Save($dataDir . "/HelloWorld Out.docx");
</p>
<p>
	<strong> 下載運行代碼</strong><br />
從以下任何一個社交編碼網站下載附加文檔示例 (Aspose.Words) :<br />
<ul>
		<li>
			<a  target="_blank">GitHub</a>
		</li>
</ul>
</p>
下載運行代碼
從以下任何一個社交編碼網站下載附加文檔示例 (Aspose.Words) :了解更多aspose旗下產品、及相關授權,歡迎聯系或加入技術交流Q群:761297826
Spire.Doc for .NET,Spire.doc,Spire.doc入門教程,Spire.doc授權,Spire.doc下載,word文檔轉換,分頁符

 QQ交談
QQ交談 在線咨詢
在線咨詢 
                 
                
 渝公網安備
            50010702500608號
渝公網安備
            50010702500608號
             
            
 客服熱線
客服熱線