Skip to content

Commit

Permalink
pdf打印后端切换
Browse files Browse the repository at this point in the history
  • Loading branch information
qinlili23333 committed Dec 26, 2022
1 parent ce60da8 commit 0c9eba6
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ pending
logs
showurl/ip.js
printmodule/ps/acrodist.location
printmodule/pdf/acrobat.location
测试文件白银癌症晚期.txt
8 changes: 5 additions & 3 deletions ConfigureTool.bat
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,14 @@ goto format

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

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

Expand Down
2 changes: 1 addition & 1 deletion Launch.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@echo off
set VERSION=Release1.0.0
set VERSION=Release1.1.2
title [启动中...]Reine Print [%VERSION%]
echo Reine Print
echo 开发:琴梨梨
Expand Down
1 change: 1 addition & 0 deletions config/pdf-backend
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PDFtoPrinter
17 changes: 17 additions & 0 deletions printmodule/pdf/config.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
cls
echo PDF格式打印配置工具
if exist config\pdf-backend (
set /p backend=< config\pdf-backend
) else (
set backend=PDFtoPrinter
echo PDFtoPrinter > config\pdf-backend
)
echo 当前PDF打印后端为%backend%
echo [1]PDFtoPrinter(内置)
echo [2]Acrobat DC Pro(需安装)
set /p value=请输入你想切换的打印后端,输入无效值则保持不更改
if %value%==1 echo PDFtoPrinter > config\pdf-backend
if %value%==2 echo Acrobat > config\pdf-backend
echo 切换后端完成,按任意键返回
pause >nul
exit /b
29 changes: 27 additions & 2 deletions printmodule/pdf/print.bat
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
@echo on
echo PDF Print Module 1.0.0
echo PDF Print Module 1.1.0
echo Author:Qinlili
echo Preparing file: %*
cd %~dp0
set /p backend=< ..\..\config\pdf-backend
if %backend%==Acrobat goto Acroprint
echo Printing file: %*
PDFtoPrinter.exe ..\..\pending\%*
exit %ERRORLEVEL%
exit %ERRORLEVEL%


:Acroprint
echo Enable Acrobat Print.
if not exist acrobat.location goto find
:return
for /f "delims=" %%a in ('type acrobat.location') do set acrobat=%%a
echo Printing file: %*
%acrobat% /n /t ..\..\pending\%*
exit %ERRORLEVEL%

:find

echo Finding Acrobat...
if exist "C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\Acrobat.exe" set acrobat="C:\Program Files\Adobe\Acrobat DC\Acrobat\Acrobat.exe"
if exist "C:\Program Files\Adobe\Acrobat DC\Acrobat\Acrobat.exe" set acrobat="C:\Program Files\Adobe\Acrobat DC\Acrobat\Acrobat.exe"
if not defined acrobat (
echo Cannot find Acrobat Distiller, did you installed Acrobat Pro DC?
exit 404
)
echo Found %acrobat%
echo %acrobat% >acrobat.location
goto return

0 comments on commit 0c9eba6

Please sign in to comment.