原創(chuàng)|其它|編輯:郝浩|2012-08-31 16:20:49.000|閱讀 369 次
概述:本文主要介紹怎樣使用Aspose.PDF for .NET通過XML創(chuàng)建PDF文檔。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
請(qǐng)按照以下的步驟來將一個(gè)XML文件轉(zhuǎn)換為PDF文件:
XML
<?xml version="1.0" encoding="utf-8" ?>
<Pdf xmlns="Aspose.Pdf">
<Section>
<Text>
<Segment>Hello World</Segment>
</Text>
</Section>
</Pdf>
C#
//Create pdf document
Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf();
//Instantiate License class and call its SetLicense method to use the license
Aspose.Pdf.License license = new Aspose.Pdf.License();
license.SetLicense("Aspose.Pdf.lic");
//Bind XML into the document
pdf1.BindXML("../../../Example-XML/HelloWorld.XML", null);
//Save the document
pdf1.Save("HelloWorld.pdf");
VB.NET
'Create pdf document
Dim pdf1 As Aspose.Pdf.Generator.Pdf = New Aspose.Pdf.Generator.Pdf()
'Instantiate License class and call its SetLicense method to use the license
Dim license As license = New license
License.SetLicense("Aspose.Pdf.lic")
'Bind XML into the document
pdf1.BindXML("../../Example-XML/HelloWorld.XML", Nothing)
'Save the document
pdf1.Save("HelloWorld.pdf")
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@ke049m.cn
文章轉(zhuǎn)載自:網(wǎng)絡(luò)轉(zhuǎn)載