Hi Michael,

Another stab in the dark for you - try using job.paperWidth and job.paperHeight instead of job.pageWidth/job.pageHeight in your getPrintScale method to see if it makes any difference. pageHeight returns the printable height, which will be less than the paperHeight, which returns the actual height of the page.

More info here: http://tinyurl.com/8uqbw

Regards,


--
Nick/graphis


On 7 Mar 2006, at 16:54, Michael Pliskin wrote:

Hello graphis1,

This is the exact code fragment which prints out the view. Note the
'printScale' method that does exactly what you are describing... the
problem is that is does not help :( because we're printing the MC, not
view, and MC is _always_ of different size than view no matter how you
scale any of them.

               <method name="addPage" args="theView"><![CDATA[
                        var scale = getPrintScale(theView);
                        var mc = theView.getMCRef();

                        var width = theView.width;
                        var height = theView.height;

                        var x = mc._x;
                        var y = mc._y;
                        var xs = mc._xscale;
                        var ys = mc._yscale;
                        mc._x = 0;
                        mc._y = 0;
                        mc._xscale = mc._xscale * scale;
                        mc._yscale = mc._yscale * scale;
                        this.job.addPage(mc, {xMin: 0, yMin: 0, xMax:theView.width, yMax: theView.height}, null};
                        mc._xscale = xs;
                        mc._yscale = ys;
                        mc._x = x;
                        mc._y = y;
                ]]></method>

                <method name="getPrintScale" args="theView, wide, tall"><![CDATA[
                        var xscale = job.pageWidth * wide / theView.width;
                        var yscale = job.pageHeight * tall / theView.height;
                        return xscale < yscale ? xscale : yscale;
                ]]></method>


 We scale the view beforehand according to the pagesize and when we
 print, it works fine except for the page being cropped in the bottom
 for some reason.

gmc> Could you scale the view proportionally dependent upon the height and not the width?

gmc> i.e. 
gmc> 1) Scale the y value of the view to match the y value of the pagesize.
gmc> 2) Resize the x value using the same rescale proportion as above.

gmc> The would result in a view that's rescaled to fit the page
gmc> instead of one that's cropped to fit the page.

-- 
Best regards,
 Michael                            mailto:[EMAIL PROTECTED]


_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user

Reply via email to