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 » RichText,QTF,RTF... » Name of a print job is missing
Re: Name of a print job is missing [message #6453 is a reply to message #6450] Mon, 13 November 2006 10:09 Go to previous messageGo to previous message
zsolt is currently offline  zsolt
Messages: 698
Registered: December 2005
Location: Budapest, Hungary
Contributor
My solution to direct printing:

//CtrlLib/CtrlUtil.h - above struct Win32PrintDlg_; and #ifdef:
Draw * GetDefaultPrintDraw(const String &a_name);




//CtrlLib/PrinterJob.cpp In windows part after PrinterJob& PrinterJob::CurrentPage(int i):
Draw * GetDefaultPrintDraw(const String &a_name)
{
	One<Win32PrintDlg_> pdlg = new Win32PrintDlg_;
	PRINTDLG& dlg = *pdlg;
	dlg.Flags = PD_DISABLEPRINTTOFILE|PD_NOSELECTION|PD_RETURNDC|PD_HIDEPRINTTOFILE
		|PD_PRINTSETUP|PD_ALLPAGES|PD_RETURNDEFAULT;
	dlg.nFromPage = 1;
	dlg.nToPage = 1;
	dlg.nMinPage = 1;
	dlg.nMaxPage = 1;
	dlg.hwndOwner = GetActiveWindow();
	dlg.hDevNames = NULL;
	dlg.hDevMode = NULL;
	if(!PrintDlg(&dlg)) return false;
	return new PrintDraw(dlg.hDC, Nvl(a_name, Ctrl::GetAppName()));
}


//After last method, but in POSIX section:
Draw * GetDefaultPrintDraw(const String &a_name)
{
	String options;
	PrinterDlg dlg;
	options.Clear();
	options << " -d " << ~dlg.printer;
	options << " -o media=" << ~dlg.paper << "," << ~dlg.slot;
	if(dlg.landscape)
		options << " -o landscape";
	options << " -o number-up=" << ~dlg.npage;
	options << " -n " << ~dlg.copies;
	if(dlg.collate)
		options << " -o Collate=True";
	
	Size pgsz;
	pgsz.cx = 6000 * 210 / 254;
	pgsz.cy = 6000 * 297 / 254;

	PrinterDraw *pd = new PrinterDraw(pgsz);
	pd->options = options;
	return pd;
}

Maybe it has a lot of code not needed, but I didn't work too much with it.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: report / qtf to pdf saving
Next Topic: Horizontal scrollbar
Goto Forum:
  


Current Time: Wed Jun 05 12:17:01 CEST 2024

Total time taken to generate the page: 0.01810 seconds