X-Received: by 2002:a0c:881d:: with SMTP id 29mr1282587qvl.13.1551785992739; Tue, 05 Mar 2019 03:39:52 -0800 (PST) X-Received: by 2002:a81:d55:: with SMTP id 82mr502364ywn.278.1551785992475; Tue, 05 Mar 2019 03:39:52 -0800 (PST) Path: csiph.com!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!m21no8987783qta.0!news-out.google.com!y15ni4865qta.0!nntp.google.com!m21no8987782qta.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.java.programmer Date: Tue, 5 Mar 2019 03:39:52 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=93.43.94.186; posting-account=sKzxtgoAAACwIiuwvlJrQFj1rLdBzQgc NNTP-Posting-Host: 93.43.94.186 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Javax Print : truncated document From: antonior0409@gmail.com Injection-Date: Tue, 05 Mar 2019 11:39:52 +0000 Content-Type: text/plain; charset="UTF-8" Lines: 30 Xref: csiph.com comp.lang.java.programmer:38790 Hi, I'm printing some NA LEGAl document using javax print but (only with java) I get truncated documents due to margin not properly aligned So I'm trying to modify it but every attempt is ignored below the used code: private DocAttributeSet getDocAttributeSet(...) { OrientationRequested orientationRequested = PageOrientationEnum.LANDSCAPE.name().equals(request.getPageOrientation()) ? OrientationRequested.LANDSCAPE : OrientationRequested.PORTRAIT; DocAttributeSet docAttributeSet = new HashDocAttributeSet(); docAttributeSet.add(orientationRequested); int width = Math.round(MediaSize.ISO.A4.getX(MediaSize.MM)); int height = Math.round(MediaSize.ISO.A4.getY(MediaSize.MM)); docAttributeSet.add(new MediaPrintableArea(0, 0, width/72f, height/72f, MediaPrintableArea.MM)); return docAttributeSet; } Whats I'm wrong? Thanks in advance