ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

搜索
EH技术汇-专业的职场技能充电站 妙哉!函数段子手趣味讲函数 Excel服务器-会Excel,做管理系统 Excel Home精品图文教程库
HR薪酬管理数字化实战 Excel 2021函数公式学习大典 Excel数据透视表实战秘技 打造核心竞争力的职场宝典
300集Office 2010微视频教程 数据工作者的案头书 免费直播课集锦 ExcelHome出品 - VBA代码宝免费下载
用ChatGPT与VBA一键搞定Excel WPS表格从入门到精通 Excel VBA经典代码实践指南
12
返回列表 发新帖
楼主: 范德萨

[求助] PDF文本输出的相关问题

[复制链接]

TA的精华主题

TA的得分主题

 楼主| 发表于 2015-10-30 22:09 | 显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用  · 内置多项VBA编程加强工具       ★ 免费下载 ★      ★使用手册
  1. Private Sub CommandButton1_Click()
  2. Set 工作表 = ThisWorkbook.Sheets("Sheet2")


  3. '    Acrobat 4,5,6 时
  4. '    Dim objAcroPDDoc   As Acrobat.CAcroPDDoc
  5. '    Set objAcroPDDoc = CreateObject(“AcroExch.PDDoc”)
  6. '   Acrobat 7,8,9,10,11  时
  7.     Dim objAcroPDDoc    As New Acrobat.AcroPDDoc
  8.    

  9.     Dim lRet                As Long
  10.    
  11.     Dim strGetFileName      As String
  12.     Dim strGetFlags         As String
  13.     Dim strGetInfo          As String
  14.     Dim strGetNumPages      As String
  15.     Dim strGetPageMode      As String
  16.     Dim strGetPermanentID   As String
  17.     Dim i                   As Long
  18.      
  19.     i = 1
  20.     Const CON_NAME = "C:\222.pdf"


  21.     lRet = objAcroPDDoc.Open(CON_NAME)
  22.     Debug.Print "lRet = " & lRet
  23.      
  24.     'PDF文件名
  25.     strGetFileName = objAcroPDDoc.GetFileName
  26.     工作表.Cells(i, 1).Value = "GetFileName = " & strGetFileName
  27.     i = i + 1
  28.      

  29.     strGetFlags = objAcroPDDoc.GetFlags
  30.     工作表.Cells(i, 1).Value = "GetFlags = " & strGetFlags
  31.     i = i + 1
  32.      
  33.     'PDF文件总页数
  34.     strGetNumPages = objAcroPDDoc.GetNumPages
  35.     工作表.Cells(i, 1).Value = "GetNumPages = " & strGetNumPages
  36.     i = i + 1
  37.      
  38.     'PDF文件显示模式

  39.     strGetPageMode = objAcroPDDoc.GetPageMode
  40.     工作表.Cells(i, 1).Value = "GetPageMode = " & strGetPageMode
  41.     i = i + 1
  42.      
  43.     '参数ID
  44.     strGetPermanentID = objAcroPDDoc.GetPermanentID
  45.     工作表.Cells(i, 1).Value = "GetPermanentID = " & strGetPermanentID
  46.     i = i + 1

  47.     strGetInfo = objAcroPDDoc.GetInfo("Title")
  48.     工作表.Cells(i, 1).Value = "GetInfo(""Title"") = " & strGetInfo
  49.     i = i + 1
  50.      
  51.     '文档属性标题
  52.     strGetInfo = objAcroPDDoc.GetInfo("Subject")
  53.     工作表.Cells(i, 1).Value = "GetInfo(""Subject"") = " & strGetInfo
  54.     i = i + 1
  55.      
  56.     '文档作者
  57.     strGetInfo = objAcroPDDoc.GetInfo("Author")
  58.     工作表.Cells(i, 1).Value = "GetInfo(""Author"") = " & strGetInfo
  59.     i = i + 1
  60.      
  61.     '文档属性标题
  62.     strGetInfo = objAcroPDDoc.GetInfo("Keywords")
  63.     工作表.Cells(i, 1).Value = "GetInfo(""Keywords"") = " & strGetInfo
  64.     i = i + 1
  65.      
  66.     '文档作者
  67.     strGetInfo = objAcroPDDoc.GetInfo("Creator")
  68.     工作表.Cells(i, 1).Value = "GetInfo(""Creator"") = " & strGetInfo
  69.     i = i + 1
  70.      
  71.     '文档创建日期
  72.     strGetInfo = objAcroPDDoc.GetInfo("CreationDate")
  73.     工作表.Cells(i, 1).Value = "GetInfo(""CreationDate"") = " & strGetInfo
  74.     i = i + 1
  75.      
  76.     '文档修改日期
  77.     strGetInfo = objAcroPDDoc.GetInfo("ModDate")
  78.     工作表.Cells(i, 1).Value = "GetInfo(""ModDate"") = " & strGetInfo
  79.     i = i + 1
  80.      
  81.     'PDF制作程序
  82.     strGetInfo = objAcroPDDoc.GetInfo("Producer")
  83.     工作表.Cells(i, 1).Value = "GetInfo(""Producer"") = " & strGetInfo
  84.      
  85.     'PDF释放对象
  86.     objAcroPDDoc.Close
  87.     Set objAcroPDDoc = Nothing
  88.    
  89. End Sub

复制代码

TA的精华主题

TA的得分主题

 楼主| 发表于 2015-10-30 22:13 | 显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用  · 内置多项VBA编程加强工具       ★ 免费下载 ★      ★使用手册
  1.     将PDF文件第一页拷贝到剪贴板(图片形式)
  2.     Dim objAcroPDDoc    As New Acrobat.AcroPDDoc
  3.     Dim objAcroPDPage   As Acrobat.AcroPDPage
  4.     Dim objAcroPoint    As Acrobat.AcroPoint
  5.     Dim objAcroRect     As New Acrobat.AcroRect
  6.     Dim lRet            As Long
  7.    

  8.     lRet = objAcroPDDoc.Open(测试文件1)

  9.     Set objAcroPDPage = objAcroPDDoc.AcquirePage(0)

  10.     Set objAcroPoint = objAcroPDPage.GetSize

  11.     objAcroRect.Top = 0
  12.     objAcroRect.bottom = objAcroPoint.y
  13.     objAcroRect.Left = 0
  14.     objAcroRect.Right = objAcroPoint.x

  15.     lRet = objAcroPDPage.CopyToClipboard(objAcroRect, 0, 0, 100)

  16.     lRet = objAcroPDDoc.Close

  17.     Set objAcroRect = Nothing
  18.     Set objAcroPoint = Nothing
  19.     Set objAcroPDPage = Nothing
  20.     Set objAcroPDDoc = Nothing
复制代码

TA的精华主题

TA的得分主题

 楼主| 发表于 2015-10-30 22:22 | 显示全部楼层
本帖最后由 范德萨 于 2015-10-30 22:27 编辑

请教大神出手 实现对文本 字体 大小 位置 颜色等以及对边框的位置 尺寸等信息的判断,不胜感激

TA的精华主题

TA的得分主题

发表于 2020-2-16 18:58 | 显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用  · 内置多项VBA编程加强工具       ★ 免费下载 ★      ★使用手册
好东西,收藏了,用来做大数据!!!
您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

手机版|关于我们|联系我们|ExcelHome

GMT+8, 2024-6-2 07:11 , Processed in 0.038405 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

沪公网安备 31011702000001号 沪ICP备11019229号-2

本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任!     本站特聘法律顾问:李志群律师

快速回复 返回顶部 返回列表