悬赏园豆:30
[已关闭问题]
<table style="height: 100%;" border="0" cellspacing="0">
<tbody>
<tr>
<td id="Topic_Body" class="content">各位coder, <br /><br />最近几日,我一直忙于使用一款PDF类库进行PDF的API编程,当我最终把目标锁定在了PDFBox上的时候,(原因是其它几个iTextSharp,ShartPDF都不具有相应的或足够全的方法)终于发现它有我需要的东西.可是当代码测试过程发现,它对PDF的操作也只是样子货,难道是空方法?完全不起任何作用,到底是代码有问题还是PDF设置有问题抑或是我对PDF不了解?代码如下,望各位指点: <br /><br /><br />public PDDocumentInformation SetProper(string Author, string Title, string Keyword) <br /> { <br /> Author = ""; <br /> Title = ""; <br /> Keyword = ""; <br /> PDDocumentInformation Info = new PDDocumentInformation(); <br /><br /><br /> Info.setAuthor(Author); <br /> Info.setTitle(Title); <br /> Info.setKeywords(Keyword); <br /> <br /> return Info; <br /> <br /> <br /> } <br /><br />public void OpenPDF(string pdfFile) <br /> { <br /> <br /> PDDocument myPdf = PDDocument.load(pdfFile); <br /> myPdf.setDocumentInformation(SetProper("wr","df","fsd")); <br /> myPdf.close(); <br /> <br /> } <br />string[] filename; <br />private void button1_Click(object sender, EventArgs e) <br /> { <br />if (openFileDialog1.ShowDialog() == DialogResult.OK) <br /> { <br /> <br /> filename = openFileDialog1.FileNames; <br /> for (int i = 0; i < filename.Length ; i++) <br /> { <br /> filename[i] = openFileDialog1.FileNames[i]; <br /><br /> method.OpenPDF(filename[i]); <br /><br /> <br /> <br /> } <br /> <br /> } <br /> <br /> } <br /></td>
</tr>
<tr>
<td class="modify"> </td>
</tr>
<tr>
<td class="file"> </td>
</tr>
</tbody>
</table>
问题补充:
PDFBox或是iTextSharp也类库也行,主要是考虑PDFBox对中文的支持可能好一些.
稻草人
|
初学一级
|
园豆:
83
提问于:2008-12-09 17:56