Print string to client printer using applet

How to print a string directly to the client printer after clicking a button from my jsp/html page?
I have posted a similar question here and someone(pqeuens) advised to use applet. I have been reading about applet & created one.
I tried running it as a Java application & it prints as expected. However when i put it inside a jsp/html page, it will not print.
Can anyone help me out on this? Perhaps share a code. That will be very much appreciated...
Thank you

I said you couldnt just print from JSP but you might be when you use a SIGNED applet.
But then you need to move to the java applet forum and ask question there.
Furthermore a standard applet cannot print because of the security invloved in applets. Nor will you be allowed to write files onto the client.

Similar Messages

  • Report Print Directly to Client Printer in Linux

    Hi,
    I m doing migration of Forms and Reports from 6i to 10g.
    In this 6i form contain the Direct Report Print to Client Printer.
    But in 10g, How to achive this,
    I don't want to show the report in screen, i want directly report goes to Client Default Printer for Printing Purpose.
    Can any one tel me if you have any solution.
    Thanks
    Gany

    Thanks For you reply,
    I already tried this, But I don't Know ,how to create Java Bean.
    So Any Other Method is there.
    If Any one know any other Solution for Print Directly to Client Printer.
    Thanks,
    Gany

  • How to retrieve system Information on client machine Using Applets

    How to retrieve video card information on client machine using applets and JNI, please suggest me on this
    Thanks
    GReddy

    1. Research platform specific OS API to do whatever you want with video cards
    2. Write C/C++ code to wrap the functionality in 1 into something looks closer to what you want to see in java
    3. Write a class that models the functionality of 2 with native methods.
    4. Write the native methods of 3 such that they call the methods of 2.
    Note that steps 1 and 2 have NOTHING to do with jni nor java. So you start by looking somewhere else for the answers to that.

  • Print report to client printer from forms

    Hi,
    I need to print a report directly to a client printer.
    There is a utility called ORARRP - Oracle Reports Remote Printing Utility.
    But the document I saw was from Oct 2001 - so is this still the only and best option ?
    I'm using RUN_REPORT_OBJECT in forms to launch the report.
    This works fine when the DESTYPE is FILE and DESNAME = PDF
    The PDF-outputt is then successfully shown with WEB.SHOW_DOCUMENT
    When changing DESTYPE to PRINTER and DESNAME to clients printername then report won't run. "Report filed with error message TERMINATED_WITH_ ERROR".
    Is it possible to print directly to a client printer using RUN_REPORT_OBJECT ?
    (Our client printers are not networkprinters)
    Environment:
    Forms [32 Bit] version 9.0.4.0.19
    Report Builder 9.0.4.0.33
    Reportsserver on linux
    Thanks !
    Sam

    (Our client printers are not networkprinters)This means you cannot print from the server directly on the client printer with destype=printer, since the server cannot see the printer.
    So, a manual print command by the user from the browser or the orarrp utility are your options.

  • Printing Report on client printer

    Hi,
    I am using oracle 9ids ( Oracle9i Developer Suite 9.0.2.0.1 ).
    I have an application which call a report from a form module.
    I run the application from another machine and that machine has a local printer installed on that machine.
    when I give destype=printer in the parameter form and submit, it will not print the report.
    What I have to do to print the reports.
    Please let me know the solutions for this ASAP.
    Regards,
    Malay

    The simplest way is to have your report output to pdf and then they can print the pdf. If you are trying to print directly to the printer without showing the report on the screen at all, then what we have done is make the local printer available from the network and then send the output of the report to the network name for the printer.
    The problem is that the report is running on the reports server, not the local machine. The reports server doesn't know anything about the local printer of the client. To be able to print a report directly, the reports server has to be able to "see" the printer.

  • Show parameter form and then print directly to client printer

    I have few reports that show parameter form for user entry. After the user enters the parameter and hits Submit query, the report should automatically get printed on the client's default printer. I tried to use ORARRP but I could get that to work only for reports do not open parameter form before going directly to the printer. Can someone please guide me how to achieve this?
    Thanks!

    I would like it to go to the client PCs default printer. Can you please tell me how do I do that?

  • Interacting with client system using Applet

    Hi,
    I want to interact with client system and access files on his system using applet,could u suggest the way to do it or any other siurce where I can find this information.
    It's very urgent,pl reply soon
    thanq

    hi,
    These steps will get your applet signed and you could interact with your client system through applets.
    IRENE 10 steps : http://forum.java.sun.com/thread.jsp?forum=63&thread=132769
    best wishes
    Rajesh

  • How to print report on client default printer ?

    I develop web application. I use jdev 10.1.3.4.0 . I can print report in PDF format.
    My Problem
    I can't print report on client default printer. when Client run application and print. Report is printed at server default printer
    How can I do.
    _My source code for print to PDF format._
    FacesContext context = FacesContext.getCurrentInstance();
    response = (HttpServletResponse)context.getExternalContext().getResponse();
    String urlSchema = "jdbc:oracle:thin:@localhost:1521:ORCL";
    String schemaName = "hr";
    String schemaPass = "hr;
    reportPath = "D:\\Project\\Reports";
    Class.forName("oracle.jdbc.driver.OracleDriver");
    conn = DriverManager.getConnection(urlSchema, schemaName, schemaPass);
    reportPath = reportPath.endsWith("\\") ? reportPath : (reportPath + "\\");
    input = new File(reportPath + reportName + ".jasper");
    reportParameters.put("SUBREPORT_DIR", reportPath);
    reportParameters.put("P_IMAGE_PATH", reportPath);
    jasperPrint = JasperFillManager.fillReport(input.getPath(), reportParameters, conn);
    response.setContentType("application/pdf");
    response.addHeader("Content-Disposition", "attachment;filename=" + reportNameOutput + ".pdf");
    OutputStream outputStream = response.getOutputStream();
    JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
    outputStream.flush();
    outputStream.close();
    conn.close();{code}
    _My source code for print to *printer*._
    {code}FacesContext context = FacesContext.getCurrentInstance();
    response = (HttpServletResponse)context.getExternalContext().getResponse();
    String urlSchema = "jdbc:oracle:thin:@localhost:1521:ORCL";
    String schemaName = "hr";
    String schemaPass = "hr;
    reportPath = "D:\\Project\\Reports";
    Class.forName("oracle.jdbc.driver.OracleDriver");
    conn = DriverManager.getConnection(urlSchema, schemaName, schemaPass);
    reportPath = reportPath.endsWith("\\") ? reportPath : (reportPath + "\\");
    input = new File(reportPath + reportName + ".jasper");
    reportParameters.put("SUBREPORT_DIR", reportPath);
    reportParameters.put("P_IMAGE_PATH", reportPath);
    jasperPrint = JasperFillManager.fillReport(input.getPath(), reportParameters, conn);
    JasperPrintManager.printReport(jasperPrint, false);
    conn.close();Edited by: jaae251 on Jun 18, 2009 2:29 AM

    If you offer a PDF to the end user, they usually know what to do with it. OTOH, if you wish to provide software to facilitate the local printing, you might launch an application on the client side that accesses the JNLP API's PrintService - that can be done in a sandboxed application.
    A signed application might access the normal J2SE based print services. Though I heard that Sun had decided to make printing a 'prompt on first attempt' deal - even for sandboxed apps., from 1.5 plus (or was it 1.6 plus?).
    It would be a serious security bug if a web site could print on the client printer, without trust or active involvement from the end user.

  • Print Reports on Client Default Printer

    Hi All,
    I am using  Oracle Reports 11g Release 2 (11.1.2.2.0).
    I want to print oracle reports from ADF which is JEE base framework on client default printer. I am send just plane url to generate report to report server. In Oracle forms we have option to get job id of report, but in plain url i am not seeing any thing like that. In forms in am generating PDF wait untill job is finished and then send pdf to client printer by using job id.
    How it will be possible by using plain URL send to report server or any other idea to achieve this task.
    Thanks in advance.

    If you offer a PDF to the end user, they usually know what to do with it. OTOH, if you wish to provide software to facilitate the local printing, you might launch an application on the client side that accesses the JNLP API's PrintService - that can be done in a sandboxed application.
    A signed application might access the normal J2SE based print services. Though I heard that Sun had decided to make printing a 'prompt on first attempt' deal - even for sandboxed apps., from 1.5 plus (or was it 1.6 plus?).
    It would be a serious security bug if a web site could print on the client printer, without trust or active involvement from the end user.

  • Printing client side with Applet!!!

    Hi,
    Does anyone can help me with my applet. It must get the current page and print it in landscape out over at the user side (local printer).
    Here some sample of my source to help....
    // JavaScript part
    function print(){
    var myURL = document.location.href;
    alert(myURL);
    testApplet.print(myURL);
    // Applet part
    public class MyClass extends Applet implements Pageable, Printable {
    // .... some source ...
    public void print(String myURL) throws IOException, PrinterException {
    PrinterJob job = PrinterJob.getPrinterJob();
    PageFormat landscape = job.defaultPage();
    Paper sheet = new Paper();
    sheet.setImageableArea(0,0,landscape.getImageableWidth()+ (landscape.getImageableX()*2),landscape.getImageableHeight()+(landscape.getImageableY()*2));
    landscape.setPaper(sheet);
    landscape.setOrientation(PageFormat.LANDSCAPE);
    JTextPane txt = new JTextPane();
    txt.setPage(myURL);
    // this method initialise the parameters for the printing
    initialise(txt.getText(), landscape);
    job.setPageable(this);
    job.print(); ///// THE PROBLEM IS HERE
    java.awt.print.PrinterException: No print service found.
    at sun.print.RasterPrinterJob.print(Unknown Source)
    at sun.print.RasterPrinterJob.print(Unknown Source)
    at PageableText.test1(PageableText.java:151)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at sun.plugin.com.MethodDispatcher.invoke(Unknown Source)
    at sun.plugin.com.DispatchImpl.invoke(Unknown Source)
    I have printers define and they worked well. Also, I have use the same code but without the Applet (calliing it from the main and with a static url) and it work perfectly. I'm pretty sure it's the Applet who's causing trouble.
    Anyone has any idea or sample to help me?
    Thanks

    It has to do with the JS call to the print method. I got around it by calling my printData() method in a separate thread...
    try something like this:
    ============================
    public void jsPrintData()
    if ( isPrinting )
    return;
    isPrinting = true;
    Thread runner = new Thread()
    public void run()
    printData();
    runner.start();

  • Take laptop & printer to client, need to print from client computer using my printer

    I nstalled my HP Laserjet 1102w to my laptop with my ips address to work wireless.
    I take my laptop & printer to client's location and need to print from their computers using my HP Laserjet 1102w.
    I network in to their ips address using my laptop to.
    Could not install my HP Laserjet 1102w on their computer & print from their computer.
    How do i print from my HP Laserjet 1102w using their computers at their location?
    Thanks!

    Hi debitacct ,
    Thanks for clarifying that information.
    You would have to restore the printer's defaults and reset up the printer on their network at the new location every time, to be able to print from the clients computer and you would have to connect to their network on your computer and add the printer back in again with the new IPv4 address.
    Another way you could do this is through a USB connection or use the Wireless Direct.
    You would have to enable the Wireless Direct on the printer through the printer's Embedded Web Server if you didn't select this feature during the installation. This will allow both computers to connect directly to the printer and print, but keep in mind you won't have internet access at the same time. So you can print when connected to the printer's network or connect back to the main network again to access the internet.
    Here are the steps for enabling the Wireless Direct through the printer's Embedded Web Server if you decide to go this route. Print a configuration page to get the printer's IPv4 address. Printing a Configuration Page.
    Type the IP address into your web browser's address bar. (Internet Explorer)
    Then click on the Networking tab, select Wireless Direct Setup on the left side and check the Enable wireless direct printing.
    I hope I explained that alright for you. The USB connection would most likely be the easiest way to go.
    Have a nice day!
    Thank You.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

  • Use of formatting when printing strings

    I would like to know how to print a string that is italicized. I am open to ideas involving complicated methods .. good to learn something new.

    831334 wrote:
    Well I am a graduate student in Computer Science currently building from scratch a database program as part of my school database class I am taking this semester. I have taken undergraduate courses in Java covering simple types, and data structures; at the graduate level algorithm analysis covering topics such as Fourier Transforms. I am also engaged in improving my C programming skills and learning Python to boot.Well that's nice for you, but I doubt many will be impressed here.
    When I originally posted I thought I would receive an answer to my question regardless where I posted; perhaps this forum would be more active and relevant for my question. Now that my resume is out there including a background in electrical engineering, should I hit Google or can I get an answer to my question?Now I know that one shouldn't expect much eloquence from a computer scientist, but your original question of "How can I print Strings in italics" wasn't exceptionally well thought out. Or was it news to you that Java is capable of outputting Strings in more ways than outputting to a standard console?
    If not the current adage is: "Its easy, just Google it" will suffice and follows the wade through data overload but oh well.We gave you plenty of answers already, do we need to hold a lecture for you to understand them?

  • Client Server program using Applets for client

    Creating a client server program using Applets for the clients.
    Having problems distrubting the message from client to client
    using ObjectOutputStreams/ObjectInputSteams.
    I can connect each client to simple server and respond with by writting
    the i/o stream of each client but unable to communicate from client to client. If any one out there has in tips of creating a class of objectOutputStreams that holds a array of ObjectOutputStreams and then broadcasts the message to every client, it would be much appreciated
    Thanks.

    Cheers poop for your reply
    I never explained the problem properly. What it is I am trying to set up a Client Server program using Applets as the clients GUI. The problem is broadcasting the message to multiply client connnection(s).
    Below is code, each client can connect and send message to the server. The problems is broadcasting the message to every client connection. The every client can input a message but only the last connected client can receive the message?????? Thanks in advance..
    /*this my server class */
    import java.io.*;
    import java.net.*;
    public class Server extends JFrame
    private static final int ServerPort=8080;
    private static final int MaxClients=10;
    private ObjectOutputStream output=null;
    private ObjectInputStream input=null;
    private BroadCastMessage broadcastMessage;
    public void runServer()          
    BroadCastMessage broadcastMessage= new BroadCastMessage();
    try
    {  //connect to server
    ServerSocket s = new ServerSocket(ServerPort,MaxClients);
         //listen to port 5000 for new connections
         ///max is 25
         System.out.println("Server listening on port "+ServerPort);
    while (state.isProgramRunning())
         try
         /// sGUI.waitForConnection();//new line
         s.setSoTimeout(100);
         //enable times in server-socket
         while (true)     
         Socket incoming = s.accept();
         //wait and accept connnections from serverSocket
         //instance of the class,pases the new connection and message
         //spawn as a thread
         SocketConnection connection=new SocketConnection(incoming,broadcastMessage);
         Thread a = new Thread(connection); a.start();
         System.out.println(state.getConnectionCount()+"Connection received from :"+incoming.getInetAddress());
         catch(InterruptedIOException x){}
    while (state.getConnectionCount()>0);
    System.exit(0);
    }catch (IOException e){}
    public static void main(String[] args)
    Server s =new Server();
         s.runServer();
    /*this is my socket connection thread*/
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    public class SocketConnection implements Runnable
    private ObjectOutputStream out;
    private ObjectOutputStream output=null;
    private ObjectInputStream input=null;
    private BroadCastMessage passOnMessage;
    private Socket theConnection=null;
    private String Inmessage="";
    private int Ocount;
    public SocketConnection(Socket caller,BroadCastMessage broadcastMessage,Ocount)
    theConnection =caller;///(5000,n)
    Ocount=ncount;
    passOnMessage=broadcastMessage;
    public void run()
    try
    getStreams();
    processConnection();
    catch(Exception e)
    {String clientDetails=("connection from IP Address: "+theConnection.getInetAddress());}
    private synchronized void getStreams() throws IOException
    { //get streams to send and receive data
    //set up output buffer to send header information
    ///Ocount++;
    //create new objectoutputstream
    output=passOnMessage.getOutputObject(output,theConnection,Ocount);
    ///flush output buffer to send header info.
    Ocount++;
    //set up input stream for objects
    input =new ObjectInputStream(
    theConnection.getInputStream());
    System.out.print("\nGot I/O streams\n");
    private synchronized void processConnection()throws IOException
    //process connection with client
    String Outmessage =" count : "+status.getConnectionCount();
    //send connection successful message to client
         Outmessage=Outmessage+"SERVER>>>Connection successful";
         output.writeObject(Outmessage);
    output.flush();
    do ///process messages sent from client
         try
         Inmessage = (String) input.readObject();
         System.out.println(Inmessage);
         /* //while the connection is open each line
         that is passed from the client to the server
         is read in and is displayed*/
         messageDetails.setMessage(Inmessage);
         String CurrentMessage=messageDetails.getMessage();
         //output.writeObject(CurrentMessage);
         // output.flush();
         passOnMessage.FloodMessage(CurrentMessage);
         //sending out the message
    catch(ClassNotFoundException classNotFoundException){}
    }while (!Outmessage.equals("CLIENT>>>TERMINATE"));
    /*this my attempt at broadcasting the message to all clients
    my thinking was that you could create a array of objectoutputstreams
    which in turn could be broadcasted(bit confussed here)*/
    import java.io.*;
    import java.net.*;
    public class BroadCastMessage /// implements Runnable
    private int count;
    private String Inmessage="";
    private ObjectOutputStream temp=null;
    private ObjectOutputStream[] output = new ObjectOutputStream [12];
    //temp level of array of objects
    public BroadCastMessage()
    count=0;
    public synchronized void FloodMessage(String message) throws IOException
    System.out.print(count);
         for(int i=0;i<count+1;i++)
         try
    {  System.out.print(count);
         output[count].writeObject(message);
         output[count].flush();
         catch(IOException ioException)
    {ioException.printStackTrace();}
         notifyAll();
    public ObjectOutputStream getOutputObject(ObjectOutputStream out,Socket caller,int Ocount)
    try
    { temp = new ObjectOutputStream(caller.getOutputStream());
         AddObjectOutputStream(temp,Ocount);
    ////FloodMessage();
         catch(IOException ioException)
    {ioException.printStackTrace();}
    return temp;     
    public void AddObjectOutputStream(ObjectOutputStream out,int Ocount)
    { ///add new object to array
    count=Ocount;
    output[count]=out;
    System.out.print("\nthe number of output streams : "+count+"\n");
    }

  • Printing documents on client instead of server

    Hello,
    I am using a piece of code which prints a document when a user requests a page on its browser. The only problem is that the document is printed on the server instead of the clients default printer. The printer on the current client (the testing machine in my case) is a network printer.
    Here is the code
    import java.awt.*;
    import java.awt.font.*;
    import java.awt.geom.*;
    import java.awt.print.*;
    import java.text.*;
    public class PrintDocument implements Printable
         private static final String mText =
         "Print this"
         + "And this as well ";
         private static final AttributedString mStyledText = new AttributedString(mText);
         static public void main()
              PrinterJob printerJob = PrinterJob.getPrinterJob();
              Book book = new Book();
              book.append(new PrintDocument(), new PageFormat());
              printerJob.setPageable(book);
              boolean doPrint = printerJob.printDialog();
              if (doPrint)
                   try
                        printerJob.print();
                   catch (PrinterException exception)
                        System.err.println("Printing error: " + exception);
         public int print(Graphics g, PageFormat format, int pageIndex)
              Graphics2D g2d = (Graphics2D) g;
              g2d.translate(format.getImageableX(), format.getImageableY());
              g2d.setPaint(Color.black);
              Point2D.Float pen = new Point2D.Float();
              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();
              return Printable.PAGE_EXISTS;
    }As you can see, I have not set any properties of the document to be printed on the clients default printer. How do I do this? Note that my server has NO printer installed. Do I need to share the clients default printer? Etc
    Thanks in advance

    I can't think of any way to make the client side print
    something just from your server side request.If there was a way for the server to automatically print something on the client's printer, you can be sure that those websites that spam you with popup windows would already be doing it. But they aren't, which leads me to believe it can't be done.
    Maybe you can put a the template in a HTML file, put a
    reference to it in a teeny-weeny FRAME or IFRAME in
    the HTML of your JSP code. The HTML file with the
    "template" could have that "window.print()"-thing in
    the "onLoad"-event handler of the body-tag of that
    document (or what ever, I'm not a JS expert)The solution is going to be something that is done at the client side, and that would be something like a button that executes some Javascript code, as you say. I'm not a JS expert either.

  • How to print jasperreport at client side printer? please help me...

    HI,
    I am new to using JasperReports.
    I am developing a web application using jsp and jasperreports and mysql.
    I was succeed with all with their examples and iReports tool.
    We have a requirement that client can print the report that is visible to him at his printer. I make success to print the report at server printer.
    If anyone know how to print the report at client printer please let me know. I was stopped at this place. Please help me as early as possible.
    Thanks in Advance.

    I have same problem with you. In My Application I want to print at client default print.
    But when Client run application and print. Report is printed at server default printer.
    How can I resolve this problem.
    My Code For print is following
    FacesContext context = FacesContext.getCurrentInstance();
    response = (HttpServletResponse)context.getExternalContext().getResponse();
    String urlSchema = "jdbc:oracle:thin:@localhost:1521:ORCL";
    String schemaName = "hr";
    String schemaPass = "hr;
    reportPath = "D:\\Project\\Reports";
    Class.forName("oracle.jdbc.driver.OracleDriver");
    conn = DriverManager.getConnection(urlSchema, schemaName, schemaPass);
    reportPath = reportPath.endsWith("\\") ? reportPath : (reportPath + "\\");
    input = new File(reportPath + reportName + ".jasper");
    reportParameters.put("SUBREPORT_DIR", reportPath);
    reportParameters.put("P_IMAGE_PATH", reportPath);
    jasperPrint = JasperFillManager.fillReport(input.getPath(), reportParameters, conn);
    JasperPrintManager.printReport(jasperPrint, false);
    conn.close();{code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • Can I REPAIR my External Hard Drive in Disk Utility without losing all of the Data?

    So, here's the story... A while back, I made the mistake of throwing my TM backups in the Trash folder. They were "stuck" there in my External Trash FOREVER until I finally decided to do something about it. I read a few forums that gave instructions

  • Can not remove older version on windows 7 PC?

    How do I remove an older version of iTunes on my windows 7 PC? I can not install iTunes unless I do this? Thanx, Dan.

  • Vendor Payment documents print with Bank details(Bank name) in FBZ5

    Dear All, Here one of my client requirement is when we take printout using t.code FBZ5 for vendor payment documents, he wants to take print along with his Bank name (Name of the Bank and Name of the person), How can I generate check print after enter

  • Link with a query string

    I am having problems when placing a link to an .asp page with a query string in it. Here is the link: http://www.destaco.com/new_products.asp?loc=<%=Request.QueryString("loc")%>&lang=<%=Reques t.QueryString("lang")%> The developer I'm working with sa

  • Gracefully throwing a error when the web service is down

    Guys, I have web service calls in my application. (through web service data control). My Appliacation throws exception when the web service is down. i want to my application to throw some meaningful error on the UI. How this can be acheived?