printing margins with LEIPPPrintService from webobjects application

2009-09-21 Thread Johan Henselmans
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  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: printing margins with LEIPPPrintService from webobjects application

2009-09-21 Thread Andrew Lindesay

Hi Johan;

Have you checked the PPD file on your CUPS server for the margins  
configured there? -- this is possibly a good first thing to check.


Otherwise, the 'LEIPPDocPrintJob' is a simple implementation of IPP  
communications and it is ignoring anything other than Media you are  
supplying it as attributes.  I could get it to pass the margins along  
with the job if it is possible, but it may be easier if you want to  
extend the method...


LEIPPDocPrintJob.getPayloadHeader(..)

...as you have the specific device on-hand to check the result.

Another option to check out;

http://www.lohndirekt.de/software/jipsi_quickstart_drucksoftware.html

It looks good although I have not used it.

Let me know how you get on.

cheers.

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.

...
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.


___
Andrew Lindesay
www.lindesay.co.nz

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com