nsIPrintSettings - setPaperName not working for Legal /A4

krithika <[email protected]> Mon, 27 Aug 2007 04:17:24 -0000
Newsgroups gmane.comp.mozilla.devel.java
Organization http://groups.google.com
Message-ID <1188188244.419293.236970__33519.5406260484$1188188422$gmane$org@i13g2000prf.googlegroups.com>
I have embedded gecko in a java application.I tried setting the
paperName to Legal or A4.But always takes Letter by default.

xulrunner1.8.1.3

These are what I set in nsIPrintSettings.Let me know if Iam missing
something.

                        settings=printProxy.getGlobalPrintSettings();
 
settings.setOrientation(nsIPrintSettings.kPortraitOrientation);
                        settings.setShrinkToFit(false);
                        settings.setScaling(0.9);
                        settings.setPrintReversed(false);
                        settings.setPrintSilent(true);
                        settings.setPrintBGColors(true);
                        settings.setPrintBGImages(true);
                        settings.setShowPrintProgress(false);
                        settings.setTitle(htmldoc.getTitle());
                        settings.setMarginTop(mTop);
                        settings.setMarginLeft(mLeft);
                        settings.setMarginRight(mRight);
                        settings.setMarginBottom(mBottom);
                        settings.setPaperName("Legal");
 
settings.setPaperSizeType(settings.kPaperSizeDefined);
 
settings.setPaperSizeUnit(settings.kPaperSizeInches);

 printProxy.printPreview(settings,window,null);



1.Will it work in 1.8.x.x version of xulrunner?
2. Am I missing to set something in settings?
3. Should
"settings.setPaperSize(nsIPrintSettings.kPaperSizeNativeData)" make it
work.


thanks in Advance,
Krithi