[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
(static/overwritten),
but handy when no printer is connected.

Best regards
Albert



Albert,

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 


begin:vcard
fn:James McDonald
n:McDonald;James
org:James McDonald IT Services
email;internet:..hidden..
title:Systems Engineer
version:2.1
end:vcard