• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
printing margins with LEIPPPrintService from webobjects application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

printing margins with LEIPPPrintService from webobjects application


  • Subject: printing margins with LEIPPPrintService from webobjects application
  • From: Johan Henselmans <email@hidden>
  • Date: Mon, 21 Sep 2009 11:03:08 +0200

I am working on a eticketing system and one of the requirements is that the application will print out real tickets at the location (it's easier for access control to print humanly easy recognizable tickets somewhere before the access control than to check the barcode electronically from a variety of paper/phone sources).

So I create a PDF document via itext.jar (replacing form fields from a template with the actual data) and feed that to a printer.

I implemented  Andrew Lindesay's
LEIPPDocPrintJob
LEIPPPrintService
LEIPPPrintServiceTest

to see if that would work. The printing works, but there is a one inch gap on the top of the pdf document that I am sending to the printer. I looked at some of the solutions to get rid of the 1 inch margin that is on top of the document (search for hashprintrequestattributeset margin), but none of them seemed to give the desired result.

Does anybody have a working example to reduce the margins to zero, so the 8x3.25 inch PDF document would print on a 8x3.25 ticket?

I tried these:

protected HashPrintRequestAttributeSet getPrintRequestAttributeSet(){
HashPrintRequestAttributeSet as = new HashPrintRequestAttributeSet();
as.add(BocaMedia.w576h234); // the 8 inch translates to a 576 point document in CUPS, that's why the w576xh325 document
int x = 0; //left and right margin
int y = 0; //top and bottom margin.
int w = 576; //Width
int h = 234; //Height
int units = MediaPrintableArea.MM;
as.add(new MediaPrintableArea(x, y, w, h, units));
as.add(new JobName("ticket-page", Locale.getDefault()));
}


	protected HashPrintRequestAttributeSet getPrintRequestAttributeSet()



Regards,

Johan Henselmans
http://www.netsense.nl
Tel: +31-20-6267538
Fax: +31-20-6279159



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: printing margins with LEIPPPrintService from webobjects application
      • From: Andrew Lindesay <email@hidden>
  • Prev by Date: Re: Optimistic Locking?
  • Next by Date: Re: printing margins with LEIPPPrintService from webobjects application
  • Previous by thread: Re: Optimistic Locking?
  • Next by thread: Re: printing margins with LEIPPPrintService from webobjects application
  • Index(es):
    • Date
    • Thread