求解解码错误!
现在我把一个pdf的文件转化成txt格式了private void btnget_Click(object sender, EventArgs e)
{
OpenFileDialog op = new OpenFileDialog();
if (op.ShowDialog() == DialogResult.OK)
{
txtpath.Text = op.FileName;
}
}
private void button1_Click(object sender, EventArgs e)
{
PDDocument doc = PDDocument.load(txtpath.Text.Trim());
PDFTextStripper str = new PDFTextStripper();
string text = str.getText(doc);
FileInfo textfile = new FileInfo(txtpath.Text.Trim() + ".txt");
StreamWriter st = new StreamWriter(textfile.FullName, false, Encoding.GetEncoding("gb2312"));
st.Write(text);
st.Close();
}
但是现在我把txt转化回pdf格式显示时说解码错误,求大神用代码帮我解决下!