系统地注释PDF [英] Systematically annotate a PDF

查看:38
本文介绍了系统地注释PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个大型的PDF文件,其中包含数百页.PDF的每一页都包含一个图表,还包含一个唯一的标识符(图表编号).

I have a large PDF file with several hundred pages. Each page of the PDF contains a chart and also includes a unique identifier (the chart number).

我对每个图表都有各自的评论,并希望将其插入相应的PDF页面,例如图表注释34进入包含图表34的PDF页面.

I have individual comments for each chart and would like to insert these in the corresponding PDF page, e.g. chart comment 34 goes in PDF page containing chart 34.

我目前的方法是使用Adobe Acrobat Pro中的注释工具,手动地逐一插入这些注释.您需要想象的时间.

My current approach is to insert these comments manually, one by one, using the comment tool in Adobe Acrobat Pro. This takes time as you can imagine.

是否可以加快此过程?理想情况下,我会将所有注释都放在电子表格(不太理想的是Python)中,旁边是图表代码.然后,将注释写入PDF.

Is there a way to speed up this process? Ideally, I would have all my comments in a spreadsheet (and less ideal, Python) with the chart code next to it. Then, comments would be written to the PDF.

有什么想法可以做到吗?

Any ideas how this can be done?

推荐答案

能否将PDF转换为文本文件,保存,导入并搜索注释"?我不确定逻辑将是什么,并且您没有在此处发布任何代码,但是下面的代码将遍历文本文件并查找字符串的所有事件,我们称其为测试"和应用程序"'.

Can you convert the PDF to a text file, save it, import it, and do a search for the 'comments'? I'm not sure what the logic would be, and you didn't post any code here, but my code below will iterate through a text file and find all incidents of a string, let's say it is called 'test' and 'application'.

Sub ReadFile()
Open "C:\Users\rshuell001\Desktop\sample.txt" For Input As #1
lRow = 1

Do While Not EOF(1)
    Line Input #1, Data
    Data = Application.WorksheetFunction.Trim(Data)
sData = Split(Data, " ")

    With Sheet1
        lColumn = 1
        For intCount = LBound(sData) To UBound(sData)
            .Cells(lRow, lColumn) = sData(intCount)
            lColumn = lColumn + 1
        Next intCount
    End With
    lRow = lRow + 1

Loop

Close #1

Call CopyOver

End Sub

Sub CopyOver()

Dim Rng As Range, cell As Range
Dim rw As Long
Set Rng = Worksheets("Sheet1").Range("B1:B20")
rw = 1
For Each cell In Rng

If Left(cell.Value, 4) = "test" Then
    If Left(cell.Value, 4) = "test" And cell.Offset(0, -1) = "application:" Then
    GoTo ExitPoint
    Else
    Worksheets("Sheet2").Cells(rw, "A") = cell.Value
    Worksheets("Sheet2").Cells(rw + 1, "A") = cell.Offset(1, 0)
    Worksheets("Sheet2").Cells(rw + 2, "A") = cell.Offset(3, 0)
    Worksheets("Sheet2").Cells(rw + 2, "B") = cell.Offset(3, 1)
ExitPoint:
    rw = rw + 2
    End If
End If
Next


End Sub

之前:

之后:

这篇关于系统地注释PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆