I fear this is going to be long... but will try to be as concise as possible.
I’m capturing data that was intended to be printed. The data is sent one of two ways, either by hitting the “print screen” key or by requesting the machine to print. I have no control over the machines that are sending the data and no way of changing print drivers etc.
Data send using the “print key” is encoded using codepage 437. The other data is presumably sent using the same codepage but looks as though it has been sent via a print driver as it also contains special codes to change Font size, alignment, indenting etc.
I’ve written two programs, one to capture the sent data and save it to file, and another to ‘read’ the file so as to view/print the data. I’ve done this as there will be six machines connected to the PC and I want to try and ensure that all the data is captured and saved.
Q1. – Am I correct in thinking that B4PPC cannot be opened with arguments to load a file? I would like to trigger the ‘read’ program to load the file that has just been saved so that the operator can check the data is intact and that the order/batch numbers are correct (as these form part of the filename).
My way around this is going to be to open the ‘read’ and first check to see if an .ini file is present, this .ini file will hold the last saved file and will be deleted as the ‘read’ file opens. Is there a better way?
So I have all my data captured and this seems to be working very nicely , and I’m also able to open and view the files, which after a little manipulation (i.e removal of the special printer codes) look reasonably similar to the originals. But now when I come to print all goes horribly wrong!
The formatting is all over the place, I’ve tried sending the raw file to the printer (not the same printer as connected to the machine) and the formatted string from the Textbox which looks great on screen but not so good on paper .
However, if I save the Textbox string to file (in this example I’ve called the file FormattedText.txt) and then open using Wordpad or Notepad it is displayed correctly but more importantly it also prints correctly :BangHead:.
Q2.- Why does the TextBox not print the same as it displays on screen?
I then decided that maybe I should use the RichTextBoxDesktop Library as this would also provide more control over the formatting.... ideally I’d like to reduce the font size for the table at the bottom of the results screen. But I still have the same problem Loading the string into the RichTextBox produces exactly the same result as I get when attempting to print. Loading the file fails as .txt files are not supported.
Any idea’s on where I should go from here?
Regards,
RandomCoder.
I’m capturing data that was intended to be printed. The data is sent one of two ways, either by hitting the “print screen” key or by requesting the machine to print. I have no control over the machines that are sending the data and no way of changing print drivers etc.
Data send using the “print key” is encoded using codepage 437. The other data is presumably sent using the same codepage but looks as though it has been sent via a print driver as it also contains special codes to change Font size, alignment, indenting etc.
I’ve written two programs, one to capture the sent data and save it to file, and another to ‘read’ the file so as to view/print the data. I’ve done this as there will be six machines connected to the PC and I want to try and ensure that all the data is captured and saved.
Q1. – Am I correct in thinking that B4PPC cannot be opened with arguments to load a file? I would like to trigger the ‘read’ program to load the file that has just been saved so that the operator can check the data is intact and that the order/batch numbers are correct (as these form part of the filename).
My way around this is going to be to open the ‘read’ and first check to see if an .ini file is present, this .ini file will hold the last saved file and will be deleted as the ‘read’ file opens. Is there a better way?
So I have all my data captured and this seems to be working very nicely , and I’m also able to open and view the files, which after a little manipulation (i.e removal of the special printer codes) look reasonably similar to the originals. But now when I come to print all goes horribly wrong!
The formatting is all over the place, I’ve tried sending the raw file to the printer (not the same printer as connected to the machine) and the formatted string from the Textbox which looks great on screen but not so good on paper .
However, if I save the Textbox string to file (in this example I’ve called the file FormattedText.txt) and then open using Wordpad or Notepad it is displayed correctly but more importantly it also prints correctly :BangHead:.
Q2.- Why does the TextBox not print the same as it displays on screen?
I then decided that maybe I should use the RichTextBoxDesktop Library as this would also provide more control over the formatting.... ideally I’d like to reduce the font size for the table at the bottom of the results screen. But I still have the same problem Loading the string into the RichTextBox produces exactly the same result as I get when attempting to print. Loading the file fails as .txt files are not supported.
Any idea’s on where I should go from here?
Regards,
RandomCoder.