pdf转为word后去除多余的换行
1.在中国知网中将文献来源设置为遥感学报,年限为2010年以后的;
2.使用pdf editor 将中文部分删除掉;
3.复制中文,使用word中宏来删除掉换行和空格,打开宏快捷键Alt +F8,打开的界面为:
给其命名,然后选择创建,将以下代码复制进去sub ..end sub 语句块中。
宏中代码为:
Dim iAs Integer
Dim j As Integer
i = Selection.Paragraphs.Count - 1
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^p"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
For j = 1 Toi
With Selection
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseStart
Else
.Collapse Direction:=wdCollapseEnd
End If
.Find.Execute Replace:=wdReplaceOne
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseEnd
Else
.Collapse Direction:=wdCollapseStart
End If
.Find.Execute
End With
Next j
4.在word中如何使用自己创建的宏;操作如下:
完成后是如图:
6.最后就将pdf中的中文按照段落复制到word中,复制后点击便可去掉多余的换行符。