Home » U++ Library support » LineEdit, EditFields, DocEdit » How to Print a file inside LineEdit
Re: How to Print a file inside LineEdit [message #3242 is a reply to message #3240] |
Mon, 15 May 2006 22:00 |
|
mirek
Messages: 13984 Registered: November 2005
|
Ultimate Member |
|
|
forlano wrote on Mon, 15 May 2006 15:09 |
luzr wrote on Sun, 14 May 2006 21:44 | The simplest way to print is to use Report. Simply, instead to sending your stuff to "Draw", you use Report (which implements Draw interface), just add some calls to perform pagination. Alternatively, use Qtf, which you can send to Report as well.
Mirek
|
I tried Report. Perhaps I do some mistake but doesn't seems so immediate. Let's neglect for the moment the pagination and let assume I've only one page to print. I tried the following code:
void VegaTab4::PrintCB()
{ Report r;
// r.Header("[A2> Page $$P");
r << "Round 1";
r << "===================================================================";
r << " 1 = 4 Karpov, Igor - 2 Karpov, Vadim = 1 - 0";
r << "-------------------------------------------------------------------";
Print( r, 1, "Preview");
// Perform(r); //same format error
}
When I run it appear the print panel. Then I click print and I observe the result attached below (I've printed with a pdf driver and then get a screenshot).
So it seems Report try to interpret the strings in qtf terms. This means that my text file is processed as a qtf file while it has no format command and I want to send to the printer each character the file contains.
Before to obtain this error I believed I could get the entire text file and pass via << to r and then print it. But now seems I cannot avoid to save the file in qtf format. Am I right?
Anyway I think could be very useful to have a very direct way to communicate with a printer without any inteference and control about font etc. With linux I could use a calling to system and print via 'lp', but with windows I would like to have the possibility to choose at least the printer.
Luigi
|
You can "avoid" qtf by calling DeQtf for texts you pass... That will add escape characters that will "quote" original text in Qtf.
void VegaTab4::PrintCB()
{ Report r;
// r.Header("[A2> Page $$P");
r << "Round 1";
r << DeQtf("===================================================================");
r << DeQtf(" 1 = 4 Karpov, Igor - 2 Karpov, Vadim = 1 - 0");
r << DeQtf("-------------------------------------------------------------------");
Print( r, 1, "Preview");
// Perform(r); //same format error
}
Mirek
[Updated on: Mon, 15 May 2006 22:01] Report message to a moderator
|
|
|
|
|
How to Print a file inside LineEdit
By: forlano on Sun, 14 May 2006 19:34
|
|
|
Re: How to Print a file inside LineEdit
By: mirek on Sun, 14 May 2006 21:44
|
|
|
Re: How to Print a file inside LineEdit
By: forlano on Mon, 15 May 2006 21:09
|
|
|
Re: How to Print a file inside LineEdit
By: mirek on Mon, 15 May 2006 22:00
|
|
|
Re: How to Print a file inside LineEdit
By: forlano on Mon, 15 May 2006 23:13
|
|
|
Re: How to Print a file inside LineEdit
By: mirek on Tue, 16 May 2006 01:35
|
|
|
Re: How to Print a file inside LineEdit
By: forlano on Tue, 16 May 2006 18:10
|
|
|
Re: How to Print a file inside LineEdit
By: mirek on Tue, 16 May 2006 22:11
|
|
|
Re: How to Print a file inside LineEdit
By: forlano on Wed, 17 May 2006 19:16
|
|
|
Re: How to Print a file inside LineEdit
By: mirek on Wed, 17 May 2006 20:30
|
|
|
Re: How to Print a file inside LineEdit
By: forlano on Wed, 17 May 2006 20:45
|
Goto Forum:
Current Time: Mon Jun 03 23:15:55 CEST 2024
Total time taken to generate the page: 0.02350 seconds
|