vb点虐 读取pdf vb读取pdf中的文本内容

C#怎么读取PDF文件

FileStream ReadPdf = new FileStream("d:\\books\\vb点虐 \\OReilly's Visual Basic .NET Language in a Nutshell.pdf", FileMode.Open);

目前累计服务客户千余家,积累了丰富的产品开发及服务经验。以网站设计水平和技术实力,树立企业形象,为客户提供网站设计制作、网站设计、网站策划、网页设计、网络营销、VI设计、网站改版、漏洞修补等服务。成都创新互联始终以务实、诚信为根本,不断创新和提高建站品质,通过对领先技术的掌握、对创意设计的研究、对客户形象的视觉传递、对应用系统的结合,为客户提供更好的一站式互联网解决方案,携手广大客户,共同发展进步。

long FileSize;

FileSize = ReadPdf.Length;

byte[] Buffer = new byte[(int)FileSize];

ReadPdf.Read(Buffer, 0, (int)ReadPdf.Length);

ReadPdf.Close();

FileStream CreatePdf = new FileStream("d:\\books\\vb点虐 \\kotla.pdf", FileMode.Create);

CreatePdf.Write(Buffer,0,Buffer.Length);

CreatePdf.Close();

========================

这段代码不知道对你有没有用处,也是在网上看到的

C# 读取PDF文件

FileStream ReadPdf = new FileStream("d:\\books\\vb点虐 \\OReilly's Visual Basic .NET Language in a Nutshell.pdf", FileMode.Open);

long FileSize;

FileSize = ReadPdf.Length;

byte[] Buffer = new byte[(int)FileSize];

ReadPdf.Read(Buffer, 0, (int)ReadPdf.Length);

ReadPdf.Close();

д

FileStream CreatePdf = new FileStream("d:\\books\\vb点虐 \\kotla.pdf", FileMode.Create);

CreatePdf.Write(Buffer,0,Buffer.Length);

CreatePdf.Close();

vb点虐 导出PDF

利用DataWindow点虐 在 vb点虐 下导出PDF格式文件

利用datawindow点虐 ,导出PDF文件,实现前提:

1.安装Acrobat Distiller虚拟打印机,注意要用datawindow点虐 提供的打印驱动,在c:\program files\sybase\datawindow点虐 2.0\driver中,在文章最后,我会提供一个静态安装虚拟打印机的批处理文件,方便安装。

2.安装Ghostscript 7.05 ,在网上找,免费的。

3.导出PDF文件前,一要指定虚拟打印机名,其次导出格式为PDF(Export.PDF.Method=Distill!),另外还要指定 PDF.Distill.CustomPostScript=Yes。

具体代码如下:

''' summary

''' 导出文件

''' /summary

''' param name="sender"/param

''' param name="e"/param

''' remarks/remarks

Private Sub btnExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExport.Click

Try

Dim strFilename, strPrinter As String

Dim saveDg As New SaveFileDialog

strPrinter = Me.dwPrint.Describe("DataWindow.Print.PrinterName")

saveDg.FileName = Me.dwPrint.Tag.ToString

saveDg.Filter = "Pdf文件|*.pdf|Excel文件|*.xls|所有文件|*.*"

If saveDg.ShowDialog = Windows.Forms.DialogResult.OK Then

strFilename = saveDg.FileName

If strFilename.IndexOf(".pdf") 0 Then

Me.dwPrint.Modify("DataWindow.Print.PrinterName='Acrobat Distiller'")

Me.dwPrint.Modify("DataWindow.Export.PDF.Method=Distill!")

Me.dwPrint.Modify("DataWindow.Export.PDF.Distill.CustomPostScript=Yes")

Me.dwPrint.SaveAs(strFilename, Sybase.DataWindow.FileSaveAsType.Pdf, True)

ElseIf strFilename.IndexOf(".xls") 0 Then

Me.dwPrint.SaveAs(strFilename, Sybase.DataWindow.FileSaveAsType.Excel, True)

End If

Me.dwPrint.Modify("DataWindow.Print.PrinterName='" + strPrinter + "'")

MessageBox.Show("导出成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)

End If

Catch ex As Exception

MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error)

End Try

End Sub

4 批处理文件(实现静默安装)


网页名称:vb点虐 读取pdf vb读取pdf中的文本内容
浏览路径:http://lszwz.com/article/ddcjdso.html

其他资讯

售后响应及时

7×24小时客服热线

数据备份

更安全、更高效、更稳定

价格公道精准

项目经理精准报价不弄虚作假

合作无风险

重合同讲信誉,无效全额退款