原創|其它|編輯:郝浩|2012-08-31 16:20:49.000|閱讀 364 次
概述:本文主要介紹怎樣使用Aspose.PDF for .NET通過XML創建PDF文檔。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
請按照以下的步驟來將一個XML文件轉換為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")
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自:網絡轉載