genehunter
14th July 2009, 18:32
A new blog entry has been added:
Creating a PDF INVOICE to disk with Invoice number in the file name for archiving purposes.
I have been working on a way to archive invoices and to automatically label the file name with the invoice number. This is the code I have so far. It uses Ghost script pdf converter and it seems to work. If you have questions send me an email at ghunter@immucor.com
This is the print driver. the code near the middle (findstr) is what finds the string with the INVOICE number and labels the pdf file.
gswin32c -q -dNOPAUSE -dBATCH -sPAPERSIZE=a4 -sDEVICE=pdfwrite -sOutputFile=e:\baan\tmp\archive_pdf.pdf e:\baan\tmp\archive_pdf.txt
copy e:\baan\tmp\archive_pdf.pdf e:\archive_invoice\archive_pdf.pdf
copy e:\baan\tmp\archive_pdf.txt e:\archive_invoice\archive_pdf.txt
rem -- ren e:\archive_invoice\archive_pdf.pdf invoice%date:~4,2%%date:~7,2%%date:~10,4%%time:~1,1%h%time:~3,2%m%time:~6,2%s%.pdf
findstr /C:"45 444" archive_pdf.txt >e:\archive_invoice\results.txt
set /P test=<e:\archive_invoice\results.txt
ren e:\archive_invoice\archive_pdf.pdf invoice-%test:~49,3%-%test:~72,8%.pdf
del e:\archive_invoice\results.txt
:end
Creating a PDF INVOICE to disk with Invoice number in the file name for archiving purposes.
I have been working on a way to archive invoices and to automatically label the file name with the invoice number. This is the code I have so far. It uses Ghost script pdf converter and it seems to work. If you have questions send me an email at ghunter@immucor.com
This is the print driver. the code near the middle (findstr) is what finds the string with the INVOICE number and labels the pdf file.
gswin32c -q -dNOPAUSE -dBATCH -sPAPERSIZE=a4 -sDEVICE=pdfwrite -sOutputFile=e:\baan\tmp\archive_pdf.pdf e:\baan\tmp\archive_pdf.txt
copy e:\baan\tmp\archive_pdf.pdf e:\archive_invoice\archive_pdf.pdf
copy e:\baan\tmp\archive_pdf.txt e:\archive_invoice\archive_pdf.txt
rem -- ren e:\archive_invoice\archive_pdf.pdf invoice%date:~4,2%%date:~7,2%%date:~10,4%%time:~1,1%h%time:~3,2%m%time:~6,2%s%.pdf
findstr /C:"45 444" archive_pdf.txt >e:\archive_invoice\results.txt
set /P test=<e:\archive_invoice\results.txt
ren e:\archive_invoice\archive_pdf.pdf invoice-%test:~49,3%-%test:~72,8%.pdf
del e:\archive_invoice\results.txt
:end