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... » Report Perform() and printing
Report Perform() and printing [message #55150] Wed, 14 October 2020 18:36 Go to next message
jimlef is currently offline  jimlef
Messages: 90
Registered: September 2020
Location: US
Member
When I go to print a document, the defaults show A4 paper size, is there any way short of editing the uppsrc to make it default to Letter?

I don't see any options with regards to Perform()...
Re: Report Perform() and printing [message #55159 is a reply to message #55150] Thu, 15 October 2020 00:17 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
jimlef wrote on Wed, 14 October 2020 18:36
When I go to print a document, the defaults show A4 paper size, is there any way short of editing the uppsrc to make it default to Letter?

I don't see any options with regards to Perform()...


I am afraid no. I believe this is OS preset. I think it could be changed via code, but not yet in U++.

Mirek
Re: Report Perform() and printing [message #55162 is a reply to message #55159] Thu, 15 October 2020 01:58 Go to previous messageGo to next message
jimlef is currently offline  jimlef
Messages: 90
Registered: September 2020
Location: US
Member
On my Linux, Letter is set by default (see attached) and other apps show US Letter in their print access (LibreOffice, Chrome and Firefox).

On windows, however, the app / report does indeed (once you dig down to it) show Letter by default. I realize that on Windows it is one of the print settings as well...

Haven't checked on Mac yet.
index.php?t=getfile&id=6259&private=0
  • Attachment: example.png
    (Size: 137.20KB, Downloaded 347 times)

[Updated on: Thu, 15 October 2020 02:03]

Report message to a moderator

Re: Report Perform() and printing [message #55167 is a reply to message #55162] Thu, 15 October 2020 12:38 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Try

lpoptions -l


My output is:

PageSize/Media Size: Executive Letter Legal 8x10 Statement *A4 B5 Postcard A6 4x6 5x8 Env10 EnvDL EnvC5 EnvC6 EnvA2 EnvChou3 4.4x6 5x7 DoublePostcardRotated ISOB5 FanFoldGermanLegal 3.936x5.75 8.5x14
MediaType/Media Type: *Stationery PhotographicGlossy
ColorModel/Color Mode: *RGB Gray
cupsPrintQuality/Print Quality: Draft *Normal High



And these are presets that PrinterJob should be using now. Note that '*' before A4.

Mirek

[Updated on: Thu, 15 October 2020 12:40]

Report message to a moderator

Re: Report Perform() and printing [message #55170 is a reply to message #55167] Thu, 15 October 2020 16:38 Go to previous messageGo to next message
jimlef is currently offline  jimlef
Messages: 90
Registered: September 2020
Location: US
Member
lpoptions -l
PageSize/Media Size: 3x5 A4 A5 A6 Env10 EnvC5 EnvDL EnvMonarch Executive FanFoldGermanLegal ISOB5 Legal *Letter Custom.WIDTHxHEIGHT
InputSlot/Media Source: *Auto Manual Tray1
MediaType/Media Type: *Stationery StationeryLightweight StationeryHeavyweight StationeryCover Envelope EnvelopeHeavyweight EnvelopeLightweight StationeryRecycled Labels StationeryBond
ColorModel/Print Color Mode: *Gray
Duplex/2-Sided Printing: *None DuplexNoTumble DuplexTumble
cupsPrintQuality/Print Quality: *Normal
print-scaling/Print Scaling: *auto auto-fit fill fit none
Re: Report Perform() and printing [message #55171 is a reply to message #55150] Thu, 15 October 2020 16:52 Go to previous messageGo to next message
jimlef is currently offline  jimlef
Messages: 90
Registered: September 2020
Location: US
Member
And on mac (v. 15251):

index.php?t=getfile&id=6260&private=0
  • Attachment: example.png
    (Size: 522.06KB, Downloaded 302 times)
Re: Report Perform() and printing [message #55173 is a reply to message #55170] Thu, 15 October 2020 17:57 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
jimlef wrote on Thu, 15 October 2020 16:38
lpoptions -l
PageSize/Media Size: 3x5 A4 A5 A6 Env10 EnvC5 EnvDL EnvMonarch Executive FanFoldGermanLegal ISOB5 Legal *Letter Custom.WIDTHxHEIGHT
InputSlot/Media Source: *Auto Manual Tray1
MediaType/Media Type: *Stationery StationeryLightweight StationeryHeavyweight StationeryCover Envelope EnvelopeHeavyweight EnvelopeLightweight StationeryRecycled Labels StationeryBond
ColorModel/Print Color Mode: *Gray
Duplex/2-Sided Printing: *None DuplexNoTumble DuplexTumble
cupsPrintQuality/Print Quality: *Normal
print-scaling/Print Scaling: *auto auto-fit fill fit none


OK, it looks like bug then... Smile

Mirek
Re: Report Perform() and printing [message #55174 is a reply to message #55173] Thu, 15 October 2020 18:07 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I think I have found it. Looks like over those years, lpoptions output changed a bit while we were not watching.

Can you test this fix please?

Size PrinterJob::GetDefaultPageSize(String *name)
{
	Size sz(6000 * 210 / 254, 6000 * 297 / 254);

	Vector<String> dpp = Split(System("lpoptions -l"), '\n');

	for (int i = 0; i < dpp.GetCount(); i++){
		int pos = max(dpp[i].FindAfter("Page Size"), dpp[i].FindAfter("PageSize"));
		if (pos >= 0){
			pos = dpp[i].Find('*', pos);
			//return A4 if there is not default page size
			if (pos < 0) return sz;
			//skip '*'
			pos++;
			int len = dpp[i].Find(' ', pos);
			if (len < 0) len = dpp[i].GetLength();
			len -= pos;
			//page name
			String nm = dpp[i].Mid(pos, len);
			if(name)
				*name = nm;
			const PageSizeName *p = FindPageSize(nm);
			if(p) {
				sz = p->GetDots();
				return sz;
			}
		}
	}
	//return A4 if there is not default page size
	return sz;
}


(It is on the trunk / git too, but I think your U++ journey have not got you there yet Smile
Re: Report Perform() and printing [message #55176 is a reply to message #55174] Thu, 15 October 2020 18:56 Go to previous message
jimlef is currently offline  jimlef
Messages: 90
Registered: September 2020
Location: US
Member
Yes, on linux now working as expected Smile Thank you!
Previous Topic: Documentation / more info
Next Topic: Speller routine
Goto Forum:
  


Current Time: Thu Mar 28 19:13:53 CET 2024

Total time taken to generate the page: 0.01244 seconds