Page 1 of 1

Where to pick the default printed page size?

Posted: Sat Apr 24, 2021 3:24 pm
by blmara
Hi,

I'm developing a music notation program. At startup program is trying to find the default page size user would perhaps want to use with the musical scores. I've used IIntuition->GetPrefs() to get the field Preferences->PaperSize. Now, when I created a new partition for OS4 update 2 combined with Enhancer v2 and most of the OS preferences were at their defaults, I noticed that even if I set the page size to ISO_A4 with Prefs/PrinterPS and use Printer preferences to set driver to PostScript & the device to lpr.device (setup for my HP printer), the GetPrefs() page size will be NARROW_TRACTOR. In the Printer preferences the page size is not editable when PostScript driver is set.

Shouldn't the Preferences->PaperSize be updated even if the PrinterPS preferences editor is used for changing the size? Or am I looking in the wrong direction searching for the default paper size?

Marko

Re: Where to pick the default printed page size?

Posted: Mon Apr 26, 2021 7:26 am
by Steady
Yes, GetPrefs() is REALLY OLD and is only supported for backward compatibility with OS 1.x. It can't really represent all the preferences that OS 2.0 and higher can save.

The way to read preferences since 2.0 is not as simple, unfortunately, and is described in the link below:

https://wiki.amigaos.net/wiki/Preferences

Re: Where to pick the default printed page size?

Posted: Mon Apr 26, 2021 8:53 am
by thomasrapp
Reading prefs should not be necessary. You can query all the required settings directly from printer.device.

Re: Where to pick the default printed page size?

Posted: Sat May 08, 2021 1:10 pm
by blmara
@Steady, @thomasrapp

Thanks! My program actually uses both the prefs files and printer.device preferences to get other settings, but I didn't understand that even this piece of information is not valid anymore. I'll check these.

Marko

Re: Where to pick the default printed page size?

Posted: Wed Aug 04, 2021 1:18 pm
by blmara
@thomasrapp

Hi,
I'm back with the question above. I finally had time to test the printer.device approach to get the default paper size. I found only the struct PrinterData copy of Preferences that contain (a copy of) struct Preferences. Unfortunately changing paper size at PrinterPS prefs editor doesn't seem to change this paper size. I didn't find a way to query paper sizes in printer.device autodoc. How should one do that ?

Marko