Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共4 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[求助]全局代码算定义变量时出现如图错误

1楼
2900819580 发表于:2024/12/20 17:21:00

图片点击可在新窗口打开查看此主题相关图片如下:截屏图片2024122001.jpg
图片点击可在新窗口打开查看


Public Enum Definition
 One = 1
 Two = 2
 Three = 3
 Four = 4
 Five = 5
 Six = 6
 Seven = 7
 Eight = 8
 Nine = 9
 Ten = 10
End Enum

''' <summary>
''' 将PDF文档转换为图片的方法
''' </summary>
''' <param name="pdfInputPath">PDF文件路径</param>
''' <param name="imageOutputPath">图片输出路径</param>
''' <param name="imageName">生成图片的名字</param>
''' <param name="startPageNum">从PDF文档的第几页开始转换</param>
''' <param name="endPageNum">从PDF文档的第几页开始停止转换</param>
''' <param name="imageFormat">设置所需图片格式</param>
''' <param name="definition">设置图片的清晰度,数字越大越清晰</param>
Public Sub ConvertPDF2Image(pdfInputPath As String, imageOutputPath As String, imageName As String, startPageNum As Integer, endPageNum As Integer, imageFormat As ImageFormat, _
 definition As Definition)
 Dim pdfFile__1 As O2S.Components.PDFRender4NET.PDFFile = O2S.Components.PDFRender4NET.PDFFile.Open(pdfInputPath)

 If Not IO.Directory.Exists(imageOutputPath) Then
  IO.Directory.CreateDirectory(imageOutputPath)
 End If

 ' validate pageNum
 If startPageNum <= 0 Then
  startPageNum = 1
 End If

 If endPageNum > pdfFile__1.PageCount Then
  endPageNum = pdfFile__1.PageCount
 End If

 If startPageNum > endPageNum Then
  Dim tempPageNum As Integer = startPageNum
  startPageNum = endPageNum
  endPageNum = startPageNum
 End If

 ' start to convert each page
 For i As Integer = startPageNum To endPageNum
  Dim pageImage As Bitmap = pdfFile__1.GetPageImage(i - 1, 56 * CInt(definition))
  pageImage.Save(imageOutputPath & imageName & i.ToString() & "." & imageFormat.ToString(), imageFormat)
  pageImage.Dispose()
 Next

 pdfFile__1.Dispose()
End Sub
[此贴子已经被作者于2024/12/20 17:22:22编辑过]
2楼
有点蓝 发表于:2024/12/20 17:36:00
把使用的第三方dll放到Foxtable安装目录,然后添加引用:http://www.foxtable.com/webhelp/topics/1936.htm
3楼
2900819580 发表于:2024/12/20 17:40:00

图片点击可在新窗口打开查看此主题相关图片如下:aa20241220021.jpg
图片点击可在新窗口打开查看
老师Dll在安装文件夹内。
4楼
有点蓝 发表于:2024/12/21 8:39:00
 添加引用了吗。或者使用vs测试通过后再搬到Foxtable里
共4 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .02344 s, 2 queries.