Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #38802
| From | Knute Johnson <nospam@rabbitbrush.frazmtn.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Javax Print : truncated document |
| Date | 2019-03-06 17:22 -0600 |
| Organization | A noiseless patient Spider |
| Message-ID | <q5pknm$1t6$1@dont-email.me> (permalink) |
| References | <cc5addd3-217e-43e7-843e-114ef28f4993@googlegroups.com> |
On 3/5/2019 05:39, antonior0409@gmail.com wrote:
> 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
You have to protect the printer margins yourself.
--
Knute Johnson
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Javax Print : truncated document antonior0409@gmail.com - 2019-03-05 03:39 -0800
Re: Javax Print : truncated document Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2019-03-06 17:22 -0600
Re: Javax Print : truncated document antonior0409@gmail.com - 2019-03-07 03:19 -0800
Re: Javax Print : truncated document Eric Douglas <e.d.programmer@gmail.com> - 2019-03-07 05:14 -0800
Re: Javax Print : truncated document antonior0409@gmail.com - 2019-03-07 05:41 -0800
Re: Javax Print : truncated document Eric Douglas <e.d.programmer@gmail.com> - 2019-03-07 07:16 -0800
Re: Javax Print : truncated document antonior0409@gmail.com - 2019-03-07 09:44 -0800
Re: Javax Print : truncated document Eric Douglas <e.d.programmer@gmail.com> - 2019-03-07 10:06 -0800
Re: Javax Print : truncated document antonior0409@gmail.com - 2019-03-08 10:33 -0800
Re: Javax Print : truncated document Eric Douglas <e.d.programmer@gmail.com> - 2019-03-08 11:34 -0800
Re: Javax Print : truncated document antonior0409@gmail.com - 2019-03-08 12:42 -0800
Re: Javax Print : truncated document Eric Sosman <esosman@comcast-dot-net.invalid> - 2019-03-08 16:13 -0500
Re: Javax Print : truncated document Eric Douglas <e.d.programmer@gmail.com> - 2019-03-08 14:04 -0800
csiph-web