Skip to content

Commit 0c9eba6

Browse files
committed
pdf打印后端切换
1 parent ce60da8 commit 0c9eba6

File tree

6 files changed

+52
-6
lines changed

6 files changed

+52
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ pending
44
logs
55
showurl/ip.js
66
printmodule/ps/acrodist.location
7+
printmodule/pdf/acrobat.location
78
测试文件白银癌症晚期.txt

ConfigureTool.bat

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,14 @@ goto format
137137

138138
:formatengine
139139
cls
140-
echo 当前版本尚未支持,请等待新版本支持
141-
ping 127.1 >nul -n 3
140+
set /p name=输入需要配置的格式
141+
if not exist printmodule\%name%\config.bat goto formaterror
142+
call printmodule\%name%\config.bat
143+
cls
142144
goto format
143145

144146
:formaterror
145-
echo 该格式不存在或当前状态无法进行该操作
147+
echo 该格式不存在或该操作当前不被该格式支持
146148
ping 127.1 >nul -n 3
147149
goto format
148150

Launch.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@echo off
2-
set VERSION=Release1.0.0
2+
set VERSION=Release1.1.2
33
title [启动中...]Reine Print [%VERSION%]
44
echo Reine Print
55
echo 开发:琴梨梨

config/pdf-backend

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PDFtoPrinter

printmodule/pdf/config.bat

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
cls
2+
echo PDF格式打印配置工具
3+
if exist config\pdf-backend (
4+
set /p backend=< config\pdf-backend
5+
) else (
6+
set backend=PDFtoPrinter
7+
echo PDFtoPrinter > config\pdf-backend
8+
)
9+
echo 当前PDF打印后端为%backend%
10+
echo [1]PDFtoPrinter(内置)
11+
echo [2]Acrobat DC Pro(需安装)
12+
set /p value=请输入你想切换的打印后端,输入无效值则保持不更改
13+
if %value%==1 echo PDFtoPrinter > config\pdf-backend
14+
if %value%==2 echo Acrobat > config\pdf-backend
15+
echo 切换后端完成,按任意键返回
16+
pause >nul
17+
exit /b

printmodule/pdf/print.bat

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,33 @@
11
@echo on
2-
echo PDF Print Module 1.0.0
2+
echo PDF Print Module 1.1.0
33
echo Author:Qinlili
44
echo Preparing file: %*
55
cd %~dp0
6+
set /p backend=< ..\..\config\pdf-backend
7+
if %backend%==Acrobat goto Acroprint
68
echo Printing file: %*
79
PDFtoPrinter.exe ..\..\pending\%*
8-
exit %ERRORLEVEL%
10+
exit %ERRORLEVEL%
11+
12+
13+
:Acroprint
14+
echo Enable Acrobat Print.
15+
if not exist acrobat.location goto find
16+
:return
17+
for /f "delims=" %%a in ('type acrobat.location') do set acrobat=%%a
18+
echo Printing file: %*
19+
%acrobat% /n /t ..\..\pending\%*
20+
exit %ERRORLEVEL%
21+
22+
:find
23+
24+
echo Finding Acrobat...
25+
if exist "C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\Acrobat.exe" set acrobat="C:\Program Files\Adobe\Acrobat DC\Acrobat\Acrobat.exe"
26+
if exist "C:\Program Files\Adobe\Acrobat DC\Acrobat\Acrobat.exe" set acrobat="C:\Program Files\Adobe\Acrobat DC\Acrobat\Acrobat.exe"
27+
if not defined acrobat (
28+
echo Cannot find Acrobat Distiller, did you installed Acrobat Pro DC?
29+
exit 404
30+
)
31+
echo Found %acrobat%
32+
echo %acrobat% >acrobat.location
33+
goto return

0 commit comments

Comments
 (0)