Re: resolution on PS files

2006-05-19 Thread Camilakill

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.
How do I change the position that I want to print the barcode? 
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);


--
View this message in context: 
http://www.nabble.com/resolution+on+PS+files-t1644209.html#a4467914
Sent from the FOP - Users forum at Nabble.com.


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



Re: resolution on PS files

2006-05-19 Thread Jeremias Maerki
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]



resolution on PS files

2006-05-18 Thread Camilakill

Hi,

I am using PSDocumentGraphics2D to create a postscript file.
I draw a label in which I use a barcode font (IDAutomation).
When I run it in Windows it prints perfect, but when I run the same code,
with the same fonts, in Linux I am not being able to scan the barcode.

Is there any command on the PSDocumentGraphics2D or GraphicContext which I
could do to make the resolution of the file better.

Maybe it is a problem with the fonts (the way they have been installed in
Linux) but I just wanted to make sure that I am using the API correctly.

My code is like follow:
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, 815, 415); 

Font barcode = new Font(IDAutomationSC39XL, Font.PLAIN, 10);//14
g2d.setFont(barcode);
g2d.drawString(!SALFL359F78999078!,50,50);

g2d.finish();

Thank you,

Camila

--
View this message in context: 
http://www.nabble.com/resolution-on-PS-files-t1644209.html#a4453344
Sent from the FOP - Users forum at Nabble.com.


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



Re: resolution on PS files

2006-05-18 Thread Jeremias Maerki
There's no resolution setting for this. In your case, the text is
painted as shapes (vector graphics). The painting is delegated to the
Java2D subsystem. If the output is not readable you can't do much here.

I'd also verify if your barcode is not a little bit too small. In my
experience, unreadable barcodes are often a result of a mismatch between
barcode settings and printer resolution.

In case you didn't know, Barcode4J can generate high-quality barcodes as
EPS files. No font necessary. Might be an alternative for you.

On 18.05.2006 17:45:09 Camilakill wrote:
 
 Hi,
 
 I am using PSDocumentGraphics2D to create a postscript file.
 I draw a label in which I use a barcode font (IDAutomation).
 When I run it in Windows it prints perfect, but when I run the same code,
 with the same fonts, in Linux I am not being able to scan the barcode.
 
 Is there any command on the PSDocumentGraphics2D or GraphicContext which I
 could do to make the resolution of the file better.
 
 Maybe it is a problem with the fonts (the way they have been installed in
 Linux) but I just wanted to make sure that I am using the API correctly.
 
 My code is like follow:
 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, 815, 415); 
   
 Font barcode = new Font(IDAutomationSC39XL, Font.PLAIN, 10);//14
 g2d.setFont(barcode);
 g2d.drawString(!SALFL359F78999078!,50,50);
 
 g2d.finish();
 
 Thank you,
 
 Camila



Jeremias Maerki


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