|
Answer» How to create pdf file in dos mode, and how to print dos file on usb printer Thanks & Regards Manoj Jain Ajmer Just curious as to why you need to create a PDF in dos? Are you WANTING to capture the DOS command shell and pass it as a screenshot of it into a PDF?
Also printing a file from DOS to USB Printer can be done by redirection on a windows OS system. You have to create a network share for this printer even if no other computers will interface with it. Then create a LPT1 redirect so that its passed to the network shared printer which just happens to be USB. Then any dos programs that print to LPT1 will redirect to your USB printer through the network share.
NET USE LPT1: \\machine_name\PrinterShareName /PERSISTENT:YES
More information here: http://www.hanselman.com/blog/GettingASharedNetworkPrinterToWorkUnderDOS.aspxYou can download various free PDF creator programs. I have found one at the site below called Text to PDF Creator. You can use it from the command line. There are others which can convert various other image or document formats.
http://www.verypdf.com/txt2pdf/index.htm#dl
example batch file:
@echo off echo Example of text to PDF conversion > Input.txt echo. >> Input.txt echo Today's date is %date% >> Input.txt echo. >> Input.txt echo The time now is %time% >> Input.txt echo. >> Input.txt echo SOME DUMMY TEXT >> Input.txt echo. >> Input.txt echo Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec venenatis varius >> Input.txt echo interdum. Proin vitae hendrerit tellus. Phasellus aliquam mauris vitae leo >> Input.txt echo porta et lacinia magna convallis. Pellentesque condimentum lorem eget erat >> Input.txt echo tempor vitae tempor dolor fermentum. Sed et dui libero, a posuere nunc. Aliquam >> Input.txt echo rhoncus, dui at porta aliquam, massa quam suscipit dolor, ut viverra diam >> Input.txt echo ligula eu neque. Integer sit amet urna at diam vulputate mattis tempor at >> Input.txt echo metus. Suspendisse scelerisque lacus in eros interdum aliquet. Aliquam quis >> Input.txt echo purus sed augue pellentesque volutpat. Sed suscipit placerat est ut molestie. >> Input.txt echo Donec commodo accumsan orci nec dictum. Nulla urna nulla, posuere suscipit >> Input.txt echo fringilla vitae, pharetra adipiscing odio. Etiam fringilla gravida lorem, ut >> Input.txt echo placerat quam accumsan malesuada. Nam ac viverra odio. Morbi vitae nulla odio, >> Input.txt echo et consectetur leo. Ut tristique, tortor sit amet cursus hendrerit, neque ipsum >> Input.txt echo consectetur felis, quis vestibulum mauris est in lorem. *CENSORED* sociis natoque >> Input.txt echo penatibus et magnis dis parturient montes, nascetur ridiculus mus. Ut fringilla >> Input.txt echo fringilla sapien nec consequat. Nullam et sapien nulla. >> Input.txt "C:\Txt2PDF\txt2pdf.exe" "Input.txt" "Output.pdf" "-pfn:Arial" -pfs12 -pps7 -plm64 -prm64 -ptm64 -pbm64
Since the OP has given hardly any information I think the most helpful answer to the question "How do I create PDF files from the command line?" is probably "You need to get a PDF creator program if you haven't got one already, and study the documentation to find out if it has any command line support, and if so, what the commands and switches are. Each program is different and there is not one SINGLE way of doing THINGS that applies to all PDF creation software."
|