日期:2014-05-18 浏览次数:20858 次
private void ReadPdf() { PDDocument pdoc = new PDDocument(); pdoc = PDDocument.load("d:\\Test01.pdf"); pdoc.decrypt("1008"); PDFTextStripper pdfs = new PDFTextStripper(); string temp = pdfs.getText(pdoc); pdoc.close(); Stream mystream = File.Open("d:\\1.doc", FileMode.Create); StreamWriter sw = new StreamWriter(mystream, Encoding.GetEncoding("gb2312")); sw.Write(temp); sw.Close(); mystream.Close(); }