Where to pick the default printed page size?

This forum is for general developer support questions.
Post Reply
blmara
Posts: 73
Joined: Thu Jun 23, 2011 9:03 am
Location: Vantaa, Finland

Where to pick the default printed page size?

Post 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
Marko
Steady
Posts: 21
Joined: Tue Aug 30, 2011 3:23 am
Location: Melbourne, Australia
Contact:

Re: Where to pick the default printed page size?

Post 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
User avatar
thomasrapp
Posts: 298
Joined: Sat Jun 18, 2011 11:22 pm

Re: Where to pick the default printed page size?

Post by thomasrapp »

Reading prefs should not be necessary. You can query all the required settings directly from printer.device.
blmara
Posts: 73
Joined: Thu Jun 23, 2011 9:03 am
Location: Vantaa, Finland

Re: Where to pick the default printed page size?

Post 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
Marko
blmara
Posts: 73
Joined: Thu Jun 23, 2011 9:03 am
Location: Vantaa, Finland

Re: Where to pick the default printed page size?

Post 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
Marko
Post Reply