Hi Experts!
My goal is to convert a batch of TXT files (that were created by a Fox program)to PDF using the Fox application.
I already have a program that takes each TXT file, sends to the Printer, converts to PDF. In fact, it has been working successfully for years, until a server crash and we lost some setting attributes. I manages to solve the problem outside of Fox which requires several manual steps whereas the Fox program processes all in a fraction of the time.
Some Background: The TXT files are created with a specific number of characters for width and a specific number of lines per page. This along with using Lucida Sans Handwriting font (which uses the same spacing for each character) the PDF is perfectly formatted. I am attaching TXT/PDF samples of before crash and after crash for visuals when using Fox program.
Please note that I can create the before server crash result outside of Fox by Open Windows Explorer, highlight up to 15 of the TXT files, then EITHER (drag/drop them on the adobe PDF printer on my desktop. Windows asks if I want to process multiple files, I reply YES and away it goes and desired result achieved.) OR (RIGHT CLICK the highlighted files, then choose Print, and it immediately processes the TXT into PDFs) Everything is PERFECT. I do want to note that IF I highlight more than 15 files, the RIGHT CLICK ->PRINT option is NOT available to me and I am left with the option to "Convert to Adobe PDF" which DOES NOT work. formatting is all messed up. Both of the successful processes require some important preliminary set up steps:
1. I must first establish some settings in NOTEPAD, which as you may know, once set, all notepad files open with your last adjusted settings.
2. Then... FORMAT -> FONT, I set the font to Lucida Console, Point size 7 under format.
3. Then... File -> Page Setup, I set paper size to A4 and all margins to ZERO except BOTTON which I set to 65
(Note if any of the above are off... Pont size 8 or margin 64, it throws everything off)
4. Then... I adjust the Adobe Pdf Printer Properties. I highlighted in yellow a few settings I had in our tech notes
Doing 15 at a time is tedious and time consuming... and every once in a while it encounters a problem if it processes too fast. This is why we have a 1 second wait coded in between sends which slows the processing down when executed in Fox...
Here's a PDF using the manual system which is identical to the how it worked from Fox before the crash.
Ok, so the PRG that send ALL of the TXT files to the Printer Prompt. The printer dialog box opens once in case I need to reset Adobe as the default printer. I click "OK" and away it goes converting one TXT file at a time to PDF until all the files are complete.
Here's what I am getting now
The following is a procedure the executes the printing. You will see THREE "SET PRINTER FONT" lines. The 2nd is the one that had been working for YEARS. I commented it out to try a 3rd based on some of the images I provided.
In my mind, if it prints fine from NOTEPAD, it should print fine from FOX. Hoping someone has an idea. <fingers crossed emoji>
I hope I provided enough info.... Thank you!
My goal is to convert a batch of TXT files (that were created by a Fox program)to PDF using the Fox application.
I already have a program that takes each TXT file, sends to the Printer, converts to PDF. In fact, it has been working successfully for years, until a server crash and we lost some setting attributes. I manages to solve the problem outside of Fox which requires several manual steps whereas the Fox program processes all in a fraction of the time.
Some Background: The TXT files are created with a specific number of characters for width and a specific number of lines per page. This along with using Lucida Sans Handwriting font (which uses the same spacing for each character) the PDF is perfectly formatted. I am attaching TXT/PDF samples of before crash and after crash for visuals when using Fox program.
Please note that I can create the before server crash result outside of Fox by Open Windows Explorer, highlight up to 15 of the TXT files, then EITHER (drag/drop them on the adobe PDF printer on my desktop. Windows asks if I want to process multiple files, I reply YES and away it goes and desired result achieved.) OR (RIGHT CLICK the highlighted files, then choose Print, and it immediately processes the TXT into PDFs) Everything is PERFECT. I do want to note that IF I highlight more than 15 files, the RIGHT CLICK ->PRINT option is NOT available to me and I am left with the option to "Convert to Adobe PDF" which DOES NOT work. formatting is all messed up. Both of the successful processes require some important preliminary set up steps:
1. I must first establish some settings in NOTEPAD, which as you may know, once set, all notepad files open with your last adjusted settings.
2. Then... FORMAT -> FONT, I set the font to Lucida Console, Point size 7 under format.
3. Then... File -> Page Setup, I set paper size to A4 and all margins to ZERO except BOTTON which I set to 65
(Note if any of the above are off... Pont size 8 or margin 64, it throws everything off)
4. Then... I adjust the Adobe Pdf Printer Properties. I highlighted in yellow a few settings I had in our tech notes
Doing 15 at a time is tedious and time consuming... and every once in a while it encounters a problem if it processes too fast. This is why we have a 1 second wait coded in between sends which slows the processing down when executed in Fox...
Here's a PDF using the manual system which is identical to the how it worked from Fox before the crash.
Ok, so the PRG that send ALL of the TXT files to the Printer Prompt. The printer dialog box opens once in case I need to reset Adobe as the default printer. I click "OK" and away it goes converting one TXT file at a time to PDF until all the files are complete.
Here's what I am getting now
The following is a procedure the executes the printing. You will see THREE "SET PRINTER FONT" lines. The 2nd is the one that had been working for YEARS. I commented it out to try a 3rd based on some of the images I provided.
In my mind, if it prints fine from NOTEPAD, it should print fine from FOX. Hoping someone has an idea. <fingers crossed emoji>
I hope I provided enough info.... Thank you!
Code:
PROCEDURE Print_it
* Print reports
*!
*! Called by: RptByDates (procedure in MA_PRINT.PRG)
*! : SkolsByRng (procedure in MA_PRINT.PRG)
*! : AllSkols (procedure in MA_PRINT.PRG)
*!*****************************************************************************
ACTIVATE WINDOW wtest NOSHOW
IF lcOption = "EOM" && Collection 03/07/10
* SET PRINTER FONT "LUCIDA SANS CONSOLE REGULAR",7
* SET PRINTER FONT "LUCIDA SANS TYPEWRITER REGULAR",7
SET PRINTER FONT "LUCIDACONSOLE REGULAR",7
ENDIF
IF (llAllSkols OR llRange OR llDateRng) AND ll1stTime && 01/19/2003
TYPE (lcPrtFile) TO PRINTER PROMPT
ll1stTime = .F.
ELSE
IF llAllSkols OR llRange OR llDateRng && 01/19/2003
TYPE (lcPrtFile) TO PRINTER
ELSE
TYPE (lcPrtFile) TO PRINTER PROMPT
ENDIF
ENDIF
DEACTIVATE WINDOW wtest
IF llAllSkols OR llRange OR llDateRng && 01/19/2003
RETURN
ENDIF
lcMsg = "FILE:"+gcSkip2+lcPrtFile+gcSkip2+"Sent To Printer"
=MSGBOX(lcMsg,"",gbOK+giInfo)
RETURN