This is quickly becoming very off-topic for this list!

On 19.05.2006 13:43:49 Camilakill wrote:
> 
> Thank you!!!
> Its going to be a much better solution for my app.
> 
> I am trying to use it in my code, but the scanner is not being able to read
> the barcode.

Again, I can't help you much with that. It's certainly not a bug in
either Barcode4J or the PSDocumentGraphics2D. It's about the way you set
up the output format, the barcode parameter, font sizes etc. and it
depends on the printer resolution.

> How do I change the position that I want to print the barcode? 

You should read http://barcode4j.krysalis.org/embedding.html#Java2D+%28AWT%29.
It tells you that you have to set up a transformation matrix so 1 unit
is equivalent to 1mm. Then you can translate the coordinate system
origin to whereever you want. Java2DCanvasProvider will start painting
at (0,0).

If the Java2D approach is ok for you, fine. My suggestion tended towards
using the EPSCanvasProvider but it's your call.

> I believe the begining of the barcode is being cut.
>  
> my code is as bellow:
> 
> OutputStream out = new java.io.FileOutputStream(new File(targetDir,
> "ps-barcode.ps"));
> out = new java.io.BufferedOutputStream(out);
> 
> PSDocumentGraphics2D g2d = new PSDocumentGraphics2D(false);
> g2d.setGraphicContext(new org.apache.xmlgraphics.java2d.GraphicContext());
> 
> g2d.setupDocument(out, 615, 315); 
> 
> Code39Bean bean = new Code39Bean();
> 
> final int dpi = 20;
> bean.setModuleWidth(UnitConv.in2mm(1.0f / dpi)); 
> bean.setWideFactor(3);
> bean.doQuietZone(false);
> bean.setHeight(50.0);
> 
> Java2DCanvasProvider canvasJava2d = new Java2DCanvasProvider(g2d);
> 
> bean.generateBarcode(canvasJava2d, "FL999078");


Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to