|
TOP
TIPS - April 2022
Split PDF Pages in half
How to create a batch script to
merge/append pdf files with the same first n characters. e.g. first 10
characters e.g. AA123421TT1.pdf and AA123421TT2.pdf will both append to
AA123421TT.pdf Products
required in this tip are:
Append PDF
IMPORTANT NOTE: In this example it presumes all
your pdf's are in folder c:\files and you want to append the same
filenames to C:\files\out\ folder. (it's self explanatory to change the
scripts to other folders - see below)
1. Download
Append PDF and
extract to C:\WinAppendPdf\
2 .
Edit/Create
dos .bat script
C:\WinAppendPdf\examples\append-script.bat i.e.
@echo off
setlocal enabledelayedexpansion
for %%a in (c:\files\*.pdf) do (
set fn=%%~na.pdf
set fn10=c:\files\out\!fn:~0,10!
..\AppendPdf !fn10!.pdf c:\files\!fn!
move c:\files\!fn! c:\files\archive\
)
pause
Change the paths as required, make sure folders
C:\files\
c:\files\out and c:\files\archive
are created.
4. now double click the
append-script.bat file to run it.
5.
change the number of charatcers
in the script 0,10! Takes first 10 chars
from filetitle so you could easily change this to e.g. 8
6. to
schedule this to run e.g. weekly use windows task scheduler e.g. Windows
start menu-->control panel, scheduled.
Add scheduled task
Make sure
you remove the 'pause' from the script.
P oint the
command to run to
C:\WinAppendPdf\examples\append-script.bat
Having difficulty? please email us:
support@traction-software.co.uk
|