Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to let appear by default the bar in the LineEdit?
Next Topic: Append separate Strings to a DocEdit[SOLVED]
Goto Forum:
  


Current Time: Sun Apr 28 15:44:55 CEST 2024

Total time taken to generate the page: 0.05369 seconds