Windows照片打印向导的批处理替代

时间:2015-08-07 05:17:39

标签: batch-file printing explorer divide

批量脚本以单张Letter尺寸(1200x800像素)的纸张打印多张图像,布局最多300张图片适合1张。除非图片裁剪或丢失数据,否则无法在Windows照片打印向导中执行此操作。我们的想法是调整图片和图片的大小。使用批处理脚本,html&分隔表。 IE浏览器。这里是代码片段,需要简单地将其设置为300(Plz在回答之前运行一次..!)

Print.cmd
@echo off &title ThumPic (siva) &color 3f & DEL "c:\zz.html"
setlocal EnableDelayedExpansion
:j
set j=200
set u=0
set o=0
set /p j=How many in a page?
set /p o=Prez1 to print name?
if %j% LEQ 2 goto p1
if %j% LEQ 4 goto p2
if %j% LEQ 6 goto p3
if %j% LEQ 9 goto p4
if %j% LEQ 12 goto p5
if %j% LEQ 16 goto p6
if %j% LEQ 20 goto p7
if %j% LEQ 25 goto p8
if %j% LEQ 30 goto p9
if %j% LEQ 36 goto p10
if %j% LEQ 42 goto p11
if %j% LEQ 49 goto p12
if %j% LEQ 56 goto p13
if %j% LEQ 64 goto p14
if %j% LEQ 72 goto p15
if %j% LEQ 81 goto p16
if %j% LEQ 90 goto p17
if %j% LEQ 100 goto p18

goto j

:p1
if %o% EQU 1 set d=%%~nxi & set u=45
set /a w=800
set /a h=1025/2-%u%
set m=2
goto print
:p2
if %o% EQU 1 set d=%%~nxi & set u=45
set /a w=800/2
set /a h=1025/2-%u%
set m=3
goto print
:p3
if %o% EQU 1 set d=%%~nxi & set u=45
set /a w=800/2
set /a h=1025/3-%u%
set m=3
goto print
:p4
if %o% EQU 1 set d=%%~nxi & set u=30
set /a w=800/3
set /a h=1025/3-%u%
set m=4
goto print
:p5
if %o% EQU 1 set d=%%~nxi & set u=30
set /a w=800/3
set /a h=1025/4-%u%
set m=4
goto print
:p6
if %o% EQU 1 set d=%%~nxi & set u=30
set /a w=800/4
set /a h=1025/4-%u%
set m=5
goto print
:p7
if %o% EQU 1 set d=%%~nxi & set u=25
set /a w=800/4
set /a h=1025/5-%u%
set m=5
goto print
:p8
if %o% EQU 1 set d=%%~nxi & set u=30
set /a w=800/5
set /a h=1025/5-%u%
set m=6
goto print
:p9
if %o% EQU 1 set d=%%~nxi & set u=25
set /a w=800/5
set /a h=1025/6-%u%
set m=6
goto print

:print
echo ^<table cellspacing=2^> >>"c:\zz.html"
for %%i in (%*) do (
set /a "p=p+1"
set "bo="
if !p! == !m! (set "p=1" & set "bo=<tr>")
echo !bo!^<td^>^<img width=%w% height=%h% src=%%i^>^<br^>%d%>>"c:\zz.html" )
start c:\windows\explorer.exe "c:\zz.html" &exit
  

将此代码放在%userprofile% SENDTO文件夹中,右键单击几个图像&gt;发送到和Print.cmd,编写高达300的脚本是乱七八糟的我需要简单地/找到常见的,布局就像这1 / 1,1 / 2,2 / 2,2 / 3,3 / 3,3 / 4,4 / 4,4-5,5 / 5..etc upto300,平均分配1200x800pix

1 个答案:

答案 0 :(得分:0)

下载http://www.imagemagick.org/script/binary-releases.php(在Windows二进制发布部分中)

convert -crop +100+10 in.jpg out.jpg
从左边框裁剪100像素,距离顶部10像素。

convert -crop -100+0 in.jpg out.jpg
右边100像素,距离顶部0像素。

结帐imagemagick命令行处理网站了解更多信息:http://www.imagemagick.org/script/command-line-processing.php