首页 新闻 赞助 找找看

我再次提问,PDFbox!

0
悬赏园豆:80 [已关闭问题]

各位coder,

最近几日,我一直忙于使用一款PDF类库进行PDF的API编程,当我最终把目标锁定在了PDFBox上的时候,(原因是其它几个iTextSharp,ShartPDF都不具有相应的或足够全的方法)终于发现它有我需要的东西.可是当代码测试过程发现,它对PDF的操作也只是样子货,难道是空方法?完全不起任何作用,到底是代码有问题还是PDF设置有问题抑或是我对PDF不了解?代码如下,望各位指点:


public PDDocumentInformation  SetProper(string Author, string Title, string Keyword)
        {
            Author = "";
            Title = "";
            Keyword = "";
            PDDocumentInformation Info = new PDDocumentInformation();


            Info.setAuthor(Author);
            Info.setTitle(Title);
            Info.setKeywords(Keyword);
   
            return Info;
         
         
        }

public void OpenPDF(string pdfFile)
        {
         
          PDDocument myPdf = PDDocument.load(pdfFile);
          myPdf.setDocumentInformation(SetProper("wr","df","fsd"));
          myPdf.close();
                 
        }
string[] filename;
private void button1_Click(object sender, EventArgs e)
        {
if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {   
                       
                filename = openFileDialog1.FileNames;
                for (int i = 0; i < filename.Length ; i++)
                {
                    filename[i] = openFileDialog1.FileNames[i];

                    method.OpenPDF(filename[i]);

                 
               
                }
               
            }
           
        }

稻草人的主页 稻草人 | 初学一级 | 园豆:83
提问于:2008-12-16 09:55
< >
分享
其他回答(1)
0

PDF的操作最灵活的是利用adobe的pdf内核进行编程。

你想要如此之大的灵活性,可能在网上是找不到的。

West | 园豆:1095 (小虾三级) | 2008-12-16 11:53
0

同意楼上的,pdf处理起来不容易

这些第三方控件用的人不多,iTextSharp用的人稍多一点

LanceZhang | 园豆:857 (小虾三级) | 2008-12-16 12:49
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册