[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Printing issue in Windows

On 02/11/10 19:44, albert wrote:
Good day Chris,

This is the final about printing I guess.

I created a pdfwrite.bat file with the following lines
@echo off
gsprint -sDEVICE=pdfwrite -sOutputFile="C:\tmp\X.pdf" -noprinter - > NUL 

In the ledgersmb config file I added the following to the printer section
PDF     pdfwrite.bat

This creates a pdf file. Th only annoying feature is the file name
but handy when no printer is connected.

Best regards


You can put some more code into your batch file and it will create a name you specify. Obviously you can do the same with %TIME% to make up whatever stamp you want.
@echo off
rem Windows cmd.exe
rem This gives you the correct format
rem offsets
rem 01234567890123
rem Mon 01/11/2010
set DAY=%DATE:~4,2%
echo Day %DAY%
set MON=%DATE:~7,2%
echo Month %MON%
set YY=%DATE:~12,2%
echo Year %YY%
echo Formatted (DDMMYY) %DAY%%MON%%YY%

gsprint -sDEVICE=pdfwrite -sOutputFile="C:\tmp\lsmb-%DAY%%MON%%YY%.pdf" -noprinter - > NUL 

fn:James McDonald
org:James McDonald IT Services
title:Systems Engineer