Benoit, Have you managed to look at the GTK+ printer dialog problems? With further testing I set the orientation to "Landscape" in code and the paper was correctly oriented. IE The long edge was horizontal but the Paint.Width and Paint.Height did not change so the printing was truncated in width to 210mm (on A4 paper). Also if I set my printer defaults to "Landscape" this did not affect the printer dialog. Orientation was still "Portrait" and disabled. Other defaults, such as "quality" or "Double Sided", could be changed in printer setup and correctly reflected in the Gambas printer dialog.
Regards Michael On 05/12/10 03:06, Benoît Minisini wrote: >> Hi Fabien, >> I've got printing to work ok but positioning objects on the page is >> difficult compared to Gambas2. The Paint.Width and Paint.Height values >> seem to bear no relation to pixels or mm. On A4 paper I get values of >> 559 and 760 approx. What units are used here? (My printer resolution is >> 300) Also in the hPrinter.Configure() dialog I cannot set all the printer >> options, specifically 'Orientation' is disabled. I set it in code with >> hPrinter.Orientation = Printer.Landscape but the Paint component still >> outputs in Portrait mode. >> Would appreciate any assistance. >> Regards >> Michael >> > The Printing example comes from Gambas 2. I removed it as it does not work > anymore with Gambas 3. If Timothy wants to port it to Gambas 3, he's welcome! > > You should do all your drawings relatively to Paint.Width and Paint.Height, > whatever their values. See it as a number of pixels, even if it is not > necessarily true. They are floating point values, so they don't have to be > true pixels. > > The unit of an horizontal "pixel" is the width of the paper divided by > Paint.Width. For an A4 paper on Portrait mode, it's 21 cm / Paint.Width. > > The unit of a vertical "pixel" is the height of the paper divided by > Paint.Height. For an A4 paper on Portrait mode, it's 29,7 cm / Paint.Height. > > I will fix one GTK warning in next revision. But I have another one that is > not triggered by Gambas, but by a GTK+ internal library named "libappmenu.so". > I don't know what it is. > > As you, when calling the GTK+ printer configuration dialog, I cannot change > the orientation and the paper size. I don't know why! I must investigate... > > And there is another bug in gb.qt4 printing: the font size is not resolution > independant, whereas it should be the contrary according the documentation > (i.e. a 50 points font is very small, as if its height is actually 50 > pixels.). I must investigate too... > > Regards, > ------------------------------------------------------------------------------ Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user