• Post Reply Bookmark Topic Watch Topic
  • New Topic

Using javax,print to print custom sized images

 
Andres Delrotti
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I can currently working on a back end printing job that would print tickets. The dimensions are Length=160mm , Width = 80mm. I can't seem to print them at that dimensions. Below is the line of code I use to set the paper size.

aset = new HashPrintRequestAttributeSet();
aset.add(OrientationRequested.LANDSCAPE);
aset.add(MediaSize.findMedia(160,80,Size2DSyntax.MM));

I now add this aset to the DocPrintJob class.


Do I still need to do anything else? BTW I am using the TSP700 printer.


Thanks,
Andres
 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the dimensions of the medium in a portrait orientation,

Source: The docs.
 
Andres Delrotti
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
^^ Hey thanks

Tried it and it worked but there's just one small problem, the left margin became way too large that playing and experimenting with the parameter sizes doesn't seem to do anything about it. Is this the setting of the actual printer that I need to change already?
 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
These get too involved, I got into one yesterday. Spent a week on it, got a compiler diagnostic along the lines of

and these are or can be really involved. I will work on it if I get the time but I am in the middle of a complete rewrite of my primary project.

Just keep twiddling.
[ May 17, 2008: Message edited by: Nicholas Jordan ]
 
Alejandro lopez
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Could you please post more code?? i have problems using this (can't find printer) i have problems with paper size.

regards

Originally posted by Andres Delrotti:
Hi,

I can currently working on a back end printing job that would print tickets. The dimensions are Length=160mm , Width = 80mm. I can't seem to print them at that dimensions. Below is the line of code I use to set the paper size.

aset = new HashPrintRequestAttributeSet();
aset.add(OrientationRequested.LANDSCAPE);
aset.add(MediaSize.findMedia(160,80,Size2DSyntax.MM));

I now add this aset to the DocPrintJob class.


Do I still need to do anything else? BTW I am using the TSP700 printer.


Thanks,
Andres
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!