Print image using java

Dear All,
Can any one help me, how to print the image in java.
Thanks in Advance.

[http://java.sun.com/products/java-media/2D/index.jsp|http://java.sun.com/products/java-media/2D/index.jsp] will help you . Java 2d also have print api.
you look at this
[http://java.sun.com/javase/technologies/desktop/printing/|http://java.sun.com/javase/technologies/desktop/printing/]

Similar Messages

  • How to resize image using java imageio

    Hello ,
    I want to know how to resize image using java imageio.
    I dont want to use java awt because i am writing a web application.
    help is very much needed
    thank you.

    Just use an AffineTransform !
    Its much easier

  • Print Images using FOP

    Can we print images using FOP by taking it from the database ? Iam using the FOP and outputing to a PDF. However, I have an image that I would like to print. The image is stored in the database as a BLOB. How can I print this image in the PDF document ?
    (b) Alternatively, if this is not possible, do we need to move the image to a physical file system and use <img src> and print ? If so, how can we move the image to the file system ? I found only UTL_FILE can do this ? But Iam not sure if it can work properly for Image file. When I tested this using utl_file, my image file got corrupted.

    Hi there, from what type of device are you trying to print the images from e.g. a smartphone/tablet or a PC/laptop?
    Best
    If my reply helped you, feel free to click on the Kudos button (hover over the "thumbs up").
    If my reply solved your problem please click on the Accepted Solution button so other Forum users may benefit from viewing the post.
    I am an HP employee.

  • How can i generate BARCODE Images using JAVA Code

    Hello ,
    My requirement is to generate BarCode Images to Print using JAVA Code.
    User will give only
    1) String.as Input Parameter and
    2) Type of Encoding you want to apply on to the String.
    outPut : code should generate Bar Code Images as per the requirements.
    can any one help me out with jars ????? or any link which can provide me start.

    1) I have requriement like generate doc file with
    more than one barcode image on that document.???
    So?
    If your chosen "doc file" format supports inclusion of multiple images there's no problem.
    If it doesn't, choose another format.
    2) I am able to generate .doc file but in which
    format i should open that doc file.????
    The same format you used to create it.
    3) Main thing is how can i put more than one barcode
    image on that doc file????
    That would depend on the file format and the API used to create it.
    is any one faced the same problem or gone through
    same requirement.
    Almost certainly. And they solved it too, given the document I'm looking at right now which is an e-ticket for an airline that has many barcodes and other generated images on it.
    So keep on trying, grasshopper, and you may find enlightenment.

  • How to extract the number from image using java

    Hello every one
    i want to develope a project which can extract the number from image
    that i can use as inter or String or char.
    Is there any API in java which provide this type of facility.
    right now i m using java 5
    thanks in Advance
    Jignesh

    In my project i have a image in that i have a
    co-ordinate (x,y) I am still puzzled as to what you seek. It sounds to me like you have a point (x, y) represented by p. in java it's just p.getX() p.getY()
    i want to convert that cordinate to numeric form,
    i mena i want to use that cordinate in somewhere else
    in project.point.getX() point.getY()
    So need to convert it into numeric form u can called
    it OCR also.OCR is optical character recognition. If I want out and took a picture of the US Declaration of Independence and then wanted the words on the parchement in the picture in text form, then I would run the picture through a software program and it would try to optically recognise what lettering and number were present in the picture. In the end, I would have a text of what is written on the US Declaration of Independence.
    Is that what you want?

  • Problem Printing Images Using JAI

    I'm using JAI in an application that prints images. My program works fine on my development machine (Windows XP), but when I put it on my Windows Server 2008 r2-64 bit, it crashes for certain images (these are large images of land plats) that go to a particular printer (OCE PlotWave 300) It prints my smaller images that are printing on a variety of printers just fine (images of Mortgages etc..) and it prints everything just fine on my development machine. What could possibly be causing this?
    Edited by: LongStranjeTrip on Feb 2, 2011 4:34 PM
    Edited by: LongStranjeTrip on Feb 4, 2011 8:11 AM

    I'm using JAI in an application that prints images. My program works fine on my development machine (Windows XP), but when I put it on my Windows Server 2008 r2-64 bit, it crashes for certain images (these are large images of land plats) that go to a particular printer (OCE PlotWave 300) It prints my smaller images that are printing on a variety of printers just fine (images of Mortgages etc..) and it prints everything just fine on my development machine. What could possibly be causing this?
    Edited by: LongStranjeTrip on Feb 2, 2011 4:34 PM
    Edited by: LongStranjeTrip on Feb 4, 2011 8:11 AM

  • How to convert JPEG - PNG images using java?

    Hi,
    Has anyone done this before?
    Can you provide me with a sample code or point me to the direction on how this can be done?
    Are there any existing Java technology that supports this?
    Most grateful. Thanks.

    It's should be easy using Java Advanced Imaging (JAI). Try this.
    import javax.media.jai.JAI;
    import javax.media.jai.RenderedOp;
    public class convert {
      static public void main(String[] args) {
        String inName = args[0];
        String outName = args[1];
        RenderedOp source = JAI.create("fileload", inName);
        JAI.create("filestore", source, outName, "PNG", null);
        System.exit(0);
    }

  • Hey need help reading images using java bean

    Hey everyone,
    I will like to read some images from a directory using Java and display it on a JSP page, how do I accomplish this,
    thanks
    KT

    What happen is, I have to display 52 card depending on string concatenation, I have a java file that takes two elements from an array, depending on the two strings concatenation I want to display an image on a jsp page, any ideas on how to accomplish this?

  • Hiding the Image in another Image using Java

    Hi all,
    I have to implement the Steganography using Java, i have to get two images and have to hide one image in another , please give me some ideas or sample links where i can explore to implement it...
    Thanks & Regards,
    Justin

    Try the ImageConsumer class. The Image's getSource method returns an ImageProducer that can be linked to the consumer.
    Some images (such as BufferedImage) also provides a Raster, which gives access to its contents through a DataBuffer. I don't know which is the easiest way, though...

  • Pattern matching for thumb print scanner using java

    I want to get some information about security system technology using java to develop my final year project. Please kindly assist me in searching some related information regarding thumb print scanner security system. Anyone who can help me in this, i will really appreciate it, thank you in advanced !

    This is going to be a tough project. Here are a couple of ideas
    1. Java, or whatever language you do it in probably won't matter that much.
    2. You need to find algorithms for matching fingerprints. There are probably some out there... You may need to pay to use them. There are also probably some books out that might help you figure out how to do this, or how other people have done this, or who to contact about doing this.
    3. Partnering up with someone, either in industry (like IBM maybe) or at the very least a professor is going to be important.
    4. Don't try to invent the wheel. Do your research and reuse as much as you can. Getting the algorithm + the scanner are going to be the hard parts

  • Print messages using Java or Jython

    Hi,
    In my ODI procedure I would like to print out some results to make it easier to check the results.
    Is there a way to print out messages in a step using java or jython?
    I tried out to print to stdout - that did not work...
    Thanks,
    Helmut

    Hi H,
    Sure.
    Below is the sample code snippet,
    import os
    ftrg = open('c:/temp/listdir.txt', 'w')
    try:
    __mydir = 'c:/odi'
    __mylist = os.listdir(mydir)
    __mylist.sort()
    __for dirOrFile in mylist:
    ____if os.path.isdir(mydir + os.sep + dirOrFile):
    ______print >> ftrg, 'DIRECTORY: %s' % dirOrFile
    ____else:
    ______print >> ftrg, 'FILE: %s' % dirOrFile
    finally:
    __ftrg.close()
    The above code will print the list of directories in a specified path to a file listdir.txt.
    P.S: If you want to try the code please replace __ with tab. Also, you can have a look at oracledi_jython_reference.pdf for more info.
    Thanks,
    G

  • Print documents using java

    hai,
    how can print the text(.txt) file or some message to the printer using Java?
    pls answer it.

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.print.Printable;
    import java.awt.print.*;
    import javax.swing.*;
    import java.awt.Graphics;
    import java.text.*;
    import java.awt.geom.Point2D;
    import java.awt.font.LineBreakMeasurer;
    import java.awt.font.TextLayout;
    import java.util.Vector;
    public class Print implements Printable {
    private AttributedString mStyledText = null;
    private Vector msg = new Vector();
    public Print( Vector msg ) {
    this.msg = msg;
    public int print(Graphics g, PageFormat format, int pageIndex) {
    Graphics2D g2d = (Graphics2D) g;
    /* Move the origin from the corner of the Paper to the corner
    * of the imageable area.
    g2d.translate(format.getImageableX(),format.getImageableY());
    /* Set the text color.
    g2d.setPaint(Color.black);
    /* Use a LineBreakMeasurer instance to break our text into
    * lines that fit the imageable area of the page.
    Point2D.Float pen = new Point2D.Float();
    for ( int i = 0; i < msg.size(); i++ ) {
    mStyledText = new AttributedString((String)msg.get( i ) );
    AttributedCharacterIterator charIterator =mStyledText.getIterator();
    LineBreakMeasurer measurer = new LineBreakMeasurer(charIterator, g2d.getFontRenderContext());
    float wrappingWidth = (float)format.getImageableWidth();
    while (measurer.getPosition() <charIterator.getEndIndex()) {
    TextLayout layout = measurer.nextLayout(wrappingWidth );
    pen.y += layout.getAscent();
    float dx = layout.isLeftToRight() ? 0 :(wrappingWidth - layout.getAdvance());
    layout.draw(g2d, pen.x + dx, pen.y);
    pen.y += layout.getDescent() +layout.getLeading();
    if ( pageIndex > 0 ) {
    return this.NO_SUCH_PAGE;
    }else {
    return this.PAGE_EXISTS;
    try this class. the msg Vector contains the text lines that you would like to print.
    Hope this helps.

  • How do I overlay n number of  bitmap images using Java.

    Hi All,
    I have a task of creating a composite bitmap or a .gif image from "n" number of bitmap images , so that the resulting composite image will look like as if all those "n" images were placed side by side . How can I achieve this ? Can you point me to some place where I can understand the concepts behind this?

    Create a new BufferedImage with the dimensions of all the images you want combined, then paint all the images into it through the Graphics object you can obtain from the BufferedImage. Then write out the image using the ImageIO class.

  • How to get printer IPAddress using java code

    Hi all,
    Can some one suggest in java
    1) how to get printer IPaddress
    2) send a printer job to a particular printer either by using printer name or by printer IPaddress ?

    Hi all,
    Can some one suggest in java
    1) how to get printer IPaddress
    2) send a printer job to a particular printer either by using printer name or by printer IPaddress ?

  • Programmatically creating VM from already created image using Java

    Hello.
    I am writing a Java program to create VMs from already created VM images. I was able to create through the web portal.
    I am using the API given here http://msdn.microsoft.com/en-us/library/jj157194.aspx
    The request sent is
    <?xml version="1.0" encoding="UTF-8"?>
    <Deployment xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <Name>mltestdeploy</Name>
    <DeploymentSlot>Production</DeploymentSlot>
    <Label>ZGVwbG95bWVudF9tbHRlc3RkZXBsb3k=</Label>
    <RoleList>
    <Role>
    <RoleName>mltesthost</RoleName>
      <RoleType>PersistentVMRole</RoleType>
    <VMImageName>ml-centos-image</VMImageName>
    </Role>
    </RoleList>
    </Deployment>
    "ml-centos-name" is an existing image with that name and I have used this to create another VM from this image.
    I have already created the required cloud service as required by this API.
    I am getting error 400 with text as "Bad Request". This means some parameter is wrong.
    Any help is very much appreciated.
    -Siva

    Now instead of the VMImageName, I used SourceImageName as given in the example.
    The XML body now looks like
    <Deployment xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <Name>mltestdeploy</Name>
    <DeploymentSlot>Production</DeploymentSlot>
    <Label>ZGVwbG95bWVudF9tbHRlc3RkZXBsb3k=</Label>
    <RoleList>
    <Role>
    <RoleName>mltesthost</RoleName>
    <RoleType>PersistentVMRole</RoleType>
    <ConfigurationSets>
    <ConfigurationSet i:type="LinuxProvisioningConfigurationSet">
    <ConfigurationSetType>LinuxProvisioningConfiguration</ConfigurationSetType>
    <HostName>mltesthost</HostName>
    <UserName>mladmin</UserName>
    <UserPassword>password</UserPassword>
    <DisableSshPasswordAuthentication>false</DisableSshPasswordAuthentication>
    </ConfigurationSet>
    </ConfigurationSets>
    <OSVirtualHardDisk>
    <MediaLink>http://portalvhds7dplkth082kmh.blob.core.windows.net/vhds/1v5wpayu.pwl201404160535060424.vhd</MediaLink>
    <SourceImageName>ml-centos-image</SourceImageName>
    </OSVirtualHardDisk>
    </Role>
    </RoleList>
    </Deployment>
    Even now I get the same 'Bad Request' error.
    Is there any way to find out which element is causing this Bad Request error? Thanks

Maybe you are looking for

  • Information Broadcat error

    HI all, We have a report in Portal published through Information Broadcast. I am new to this Broadcast,(as the report is earlilerly designed and published to portal). Now users are saying that the report is not getting updted,i.e. it is giving the sa

  • Premiere Pro CC wont activate

    I purchased Premiere Pro CC and tried to launch it but it keeps giving me a message saying my trial has expired and I need to license my software. When I clock to license the software it asks for a code which I don't have because its cc. I tried unin

  • Have trouble loading firefox get error #400 what is my problem

    I do not have trouble loading Mozilla under two of our user names but when I use my user ID it will not load and comes up as a error#400. What does that mean and how can I correct this. It only been happening for about a week.

  • Basic questation about VSS and windows backup

    hi all, basic questation about backup and VSS Environment: windows 2008r2,NAS backup disk connected with iSCSI If i create in the windows backup server job , where i backup disk D , target is NAS disk and start it . Windows backup is requester and is

  • Why does my iPhone repeatedly beep when i plug it into my macbook

    My phone is repeatdly every 5 seconds making the noise that it makes when you plug your phone into a charger, my phone keeps beeping every time i try to hook it up to itunes on my macbook... has anyone else had this issue?!