Major Issues with printing Images from applet

Hi,
I am currently working on an automated report generation software. The Project Goal is simple, all i need to do is to connect to Access Database, and get all the information onto the applet in an arranged format and display it on the webpage. Now here is the deal... The applet will only be used on a single local machine, (Why Applet?? because i need to print the report... applet viewer will also do). I am able to make the connection to the database from the applet viewer, but fail miserably if i try to do it from Internet Explorer. So i gave up on the IE. The major problem is, on applet i have a ImageViewer (I am using "symantec.itools.multimedia.ImageViewer", if you have an alternative that works then please lemme know). I have a method that sets diffrent Images in the Imageviewer, depending upon what record is being dispalyed. In otherwords, every record has an image associated to it. and i want to display the Image with the data.
Now when i run the applet in appletviewer, it works perfect, BUT.... when i go to print it (using the print in the appletviewer's menu), It print everything EXCEPT the Image..... The Image happens to the main peice of Information, so rest of the code is worthless unless the image is displayed...
Please help me with this project. I have failed many times trying to print it. If you need the code please email me @ [email protected] i will send the code to you, with a sample database.
Please help
Vaibhav

Hi,
I am currently working on an automated report
generation software. The Project Goal is simple, all i
need to do is to connect to Access Database, and get
all the information onto the applet in an arranged
format and display it on the webpage. Now here is the
deal... The applet will only be used on a single local
machine, (Why Applet?? because i need to print the
report... applet viewer will also do). I am able to
make the connection to the database from the applet
viewer, but fail miserably if i try to do it from
Internet Explorer. So i gave up on the IE. An Applet can't connect to an URL or file that isn't in his applet.getCodeBase() directory or subdir. For that to happen you have to create a profile add that profile to your java virtual machine etc.
To much work just use an application.
The major
problem is, on applet i have a ImageViewer (I am using
"symantec.itools.multimedia.ImageViewer", if you have
an alternative that works then please lemme know). I
have a method that sets diffrent Images in the
Imageviewer, depending upon what record is being
dispalyed. In otherwords, every record has an image
associated to it. and i want to display the Image with
the data.Why don't you use a panel with the paint method
use the
java.awt.Graphics.drawImage()
method
It draws the normal image files( e.g. gif jpeg npg etc.)
Now when i run the applet in appletviewer, it works
perfect, BUT.... when i go to print it (using the
print in the appletviewer's menu), It print everything
EXCEPT the Image..... The Image happens to the main
peice of Information, so rest of the code is worthless
unless the image is displayed...
Please help me with this project. I have failed many
times trying to print it. If you need the code please
email me @ [email protected] i will send the
code to you, with a sample database.
Please help
VaibhavYour trying to use the appletviewer to print for you I wouldn't do that
Why don't you just write your own print method by using the java print from sun.
some links
http://java.sun.com/printing/
http://java.sun.com/products/java-media/2D/forDevelopers/sdk12print.html#intro
http://java.sun.com/j2se/1.4/docs/guide/jps/
hope this help you on your way.
greetz pietje

Similar Messages

  • Issue with  print image in air

    hey frnd,
    plz check this link
    http://livedocs.adobe.com/flex/3/html/help.html?content=printing_5.html
    hey frnds,
    while using this multiple print datagrid code, getting 1 issue with
    print image in printheader mxml file.
    I'm adding 1 image tag and runtime getting image path in variable and
    want to print tht image in header ,
    but it is not get printed but if i'm giving @Embed image as a source
    then it is print.
    Is any way there to print runtime image after adding in printheader
    file ?
    thx in advanced,
    [email protected]

    is any solution there ?

  • Issues with Loading Images from a Jar File

    This code snippet basically loops through a jar of gifs and loads them into a hashmap to be used later. The images all load into the HashMap just fine, I tested and made sure their widths and heights were changing as well as the buffer size from gif to gif. The problem comes in when some of the images are loaded to be painted they are incomplete it looks as though part of the image came through but not all of it, while other images look just fine. The old way in which we loaded the graphics didn't involve getting them from a jar file. My question is, is this a common problem with loading images from a jar from an applet? For a while I had tried to approach the problem by getting the URL of the image in a jar and passing that into the toolkit and creating the image that way, I was unsuccessful in getting that to work.
    //app is the Japplet
    MediaTracker tracker = new MediaTracker(app);
    //jf represents the jar file obj, enum for looping through jar entries
    Enumeration e = jf.entries();
    Toolkit toolkit = Toolkit.getDefaultToolkit();
    //buffer for reading image stream
    byte buffer [];
    while(e.hasMoreElements())
    fileName = e.nextElement().toString();
    InputStream inputstream = jf.getInputStream(jf.getEntry(fileName));
    buffer = new byte[inputstream.available()];
    inputstream.read(buffer);
    currentIm = toolkit.createImage(buffer);
    tracker.addImage(currentIm, 0);
    tracker.waitForAll();
    images.put(fileName.substring(0, fileName.indexOf(".")), currentIm);
    } //while
    }//try
    catch(Exception e)
    e.printStackTrace();
    }

    compressed files are not the problem. It is just the problem of the read not returning all the bytes. Here is a working implementation:
    InputStream is = jar.getInputStream(entry);
    ByteArrayOutputStream os = new ByteArrayOutputStream(1024);
    try{
    byte[] buf = new byte[1024];
    int read;
    while((read = is.read(buf)) > 0) {
    os.write(buf, 0, read);
    catch(Exception e){
         e.printStackTrace();
         return null;
    image = Toolkit.getDefaultToolkit().createImage(os.toByteArray());
    This works but I think you end up opening the jar a second time and downloading it from the server again. Another way of getting the images is using the class loader:
    InputStream is = MyApplet.class.getResourceAsStream(strImageName);
    In this case, the image file needs to be at the same level than MyApplet.class but you don't get the benefit of enumerating of the images available in the jar.

  • Issue with displaying images from bestseller.inc.jsp

    Hello all,
    I'm new in developing with NWDI and I'm having this small problem:
    in bestseller.inc.jsp (which includes productlist.jsp) there are two links with a product's code and a products description, which when clicked, navigate to productDetailsISA.jsp with the details of the product. While the images of all the products from other jsp's (for example from ProductsISA.jsp) display correctly in the ProductDetailsISA.jsp, there is a problem with the images of the products from bestseller and recommendations jsp's (they both include productlist jsp).
    The code for creating the links *in productlist.jsp is the following:
    <li> <a href="<isa:webappsURL name="b2b/productdetail.do"/><%=ShowProductDetailAction.createDetailRequest(product,displayScenario) %>">
                          <%=JspUtil.encodeHtml(product.getDescription()) %>
                        </a> </li>
    and the code for displaying products's images in ProductDetailsISA.jsp is this:
    <td width="7%" rowspan="2" headers="Product image">
                   <img src="<isa:imageAttribute guids="DOC_PC_CRM_IMAGE,DOC_P_CRM_IMAGE" name="webCatItem" defaultImg="mimes/shared/no_pic.gif"/>"   width="250"  height="250"/>
              </td>
    I have no idea how isa:imageAttribute tag works, so I was wandering if this problem is somehow connection with the inner workings of this tag.
    Could someone help please?
    Thank you very much in advance

    I think this is not the right forum to post your Question

  • Issues with printing PDF from Adobe FrameMaker 6.0p405

    Hi All,
    I use Adobe FrameMaker 6.0p405 and Adobe Distiller 6.0. The formatting gets all messed up when ever I generate a PDF. Some of the issues that I face are:
    Some icons like "Note", "Warning", and so on do not appear consistently
    Header and footer information does not appear consistently
    Step numbers do not appear consistently
    Headings do not appear consistently
    I tried the following troubleshooting steps:
    Uninstalled and reinstalled Adobe FrameMaker 6.0p405
    Uninstalled and reinstalled Adobe Acrobat 6.0.
    The issue reappears even after performing the above steps. Any help in fixing this is greatly appreciated.

    Thank you Jeff! It worked like a charm!
    I use WinXP SP2.
    For those of you looking for the hotfix, here it is:
    http://blogs.adobe.com/techcomm/2008/07/hotfix_for_framemaker_1.html

  • Having major issues with InDesign CS6. will upgrade fix???

    Having major issues with InDesign CS6. Not only is it crashing, but it is corrupting the existing file.  Then when I relaunch, it is not allowing me to open the file again.
    In another instance, yesterday I opened an file created 3 months ago and it allowed me to make changes, however I could not save them to the existing file, or not even to a new name.
    I had to copy each layer on each page to create a new document.  NOT GOOD!!!  Just saw that ADOBE has an update for InDesign.  WILL THIS FIX THE PROBLEM??

    Yes, I would certainly get the latest update. That we often solve issues like these, for this is not normal. Some further tips would be quite InDesign, then to trash your InDesign preferences and then re-start InDesign (it will rebuild them again). Some further areas to look into would be:
    * Corrupt Font(s) (or corrupt font caches - see below)
    * Corrupt Image(s)
    * Power Failures (power surges)
    * Placing images via drag-and-drop from an Internet page
    * Working on an InDesign file over a network or on a remote server
    If all else fails, we as Markzware (I work for them) also offer a Service to fix corrupt InDesign documents. See:
    http://markzware.com/support/faq/recover-bad-file-service/
    Hopefully this helps you.
    David Dilling of
    Markzware

  • Issue with printing to a network photocopier

    We are a small school where the teachers all have Macbook Pro laptops. For a while we have been having intermittent issues with printing to the Photocopier, today is an example.
    Teacher tried to print, worked fine, then tried again 15 min later, received message Printer is in use (I was standing next to it and it wasn't in use!) tried again 10 min later, printed fine.
    Teacher tried to print, spooled for about 5 min then printed, tried again, printed fine.
    From the CUPS error log there are the following:
    - The Printer is in use
    - ICC Profile "/Library/Printers/Sharp/Profiles/SS0HIN0.icc" does not exist.
    - Remote host did not accept data file(32)
    - The printer did not respond
    - Stopping unresponsive job
    - The printer is not responding
    They are all on wireless. There is no network issue as I can ping the photocopier, get onto the Internet etc.
    They don't print via a server, they all have the photocopier installed on their macbooks as an IP printer using LDP.
    Thanks

    You'll need to manually create the folder and install the profiles. From the finder select Go, Go to Folder. Enter "/Library/Printers/Sharp/Profiles" without the quotation marks, Go. You might have to manually create the Profile folder. You can download this disk image from Sharp that contains the icc files here; http://www.sharpusa.com/ForBusiness/DocumentSystems/MFPsPrinters/MX4110N.aspx?vi ew=drivers
    Drag and drop the icc files from /MX-C26/Profiles to /Library/Printers/Sharp/Profiles
    Also make sure you install the drivers from MX-C26 for the appropriate version of OS X you are running.
    Hope this is clear.

  • I am having major issues with links in keynote! Even though the links (a navigation system) are on the master page, they are only working on some of my slides. Anyone have ideas on how to fix this or similar issues? Help!

    I am having major issues with links in keynote! Even though the links (a navigation system) are on the master page, they are only working on some of my slides. Anyone have ideas on how to fix this or similar issues? Help!
    I have created a navigation system on the master pages and set the presentation to links only mode. I also have other links scattered throughout the program, like a linkable table of contents, etc. Some of them work, some of them don't. Not sure why. Anyone out there having similar issues? Or have any idea on how I can solve this issue? Any help would be appreciated!
    Thanks!

    Links should not create any problems in Keynote.  If they are set up correctly on text, the text will be underlined. Objects that have links will have a curved arrow bottom right, if you click the arrow a popup will display the link information.
    Try this repair for Keynote,  ensure you complete all the tasks and in the order shown:

    delete all the iWork applications if you have them, not just Keynote, using Appcleaner from Mac Update, its a freeware application

    empty the trash:  Finder > Empty Trash

    Shut down your Mac, wait 30 seconds, then power on the Mac, immediately after the start chime, hold down the Shift key
    When you see the grey Apple symbol and progress indicator (a spinning gear), release the Shift key.
    If you are prompted to log in, type your password, then hold down the Shift key again as you click Log in.
    4  
    Let the Mac fully boot up, it will take longer as the OS is repairing the drive

    when fully booted, go to Applications > Utilities > Disc Utility; click on the boot drive then First Aid tab and click  repair disc permissions

    when complete, restart the Mac normally, Apple menu > Restart

    install Keynote from the Mac App Store
    let us know if this helped

  • Acrobat 9 Pro issues with printing and now updating  !!! :(

    hello
    I had an issues with printing from my gmail account or from windows live mail
    so I made a complete re-installation
    now I am stuck with version 9.3.0 and when I check for updates I get a message
    UPDATER IS ALREADY RUNNING
    only... it's not running and nothing is updating !
    I made a restart... just in case... it did not change anything
    as to the printing issue, in case some of you have met it and cleared it...(hope)
    this was with version 9.5.0
    I get no error message but no pdf is created, only a text document with this :
    %%[ ProductName: Distiller ]%%
    %%[Page: 1]%%
    72gmvi not found, using Courier.
    44dcmta not found, using Courier.
    %%[ Error: invalidfont; OffendingCommand: xshow ]%%
    Stack:
    [96 96 97 72 96 42 64 0]
    %%[ Flushing: rest of job (to end-of-file) will be ignored ]%%
    %%[ Warning: PostScript error. No PDF file produced. ] %%
    not a good start for my week... I hope yours is nicer
    I'm running Win7 Ultimate x64

    thanks Mylenium
    the font association problem is something recent though, since I used acrobat to print mails directly from my gmail account previously...
    it's galling but I installed a free pdf printer which does the job, I needed copies of these mails urgently !
    as to the update issue, I see no aum.exe, msiexec.exe or setup.exe running... but that's quite above my head... do I look for those exact processes or are they generic names for processes ?
    does my question make sense ????

  • Issues with printing purchase order

    Dear friends,
    I'm having some issues with printing purchase orders.
    Normally when I create a purchase order via ME21N and then when I save the purchase order it then gets automatically printed.
    Suddenly it is not anymore working. I have created a purchase order this morning and it did not get printed. I get the message "frontend is not available"when i check the spool in SP01
    The funny think is if i call up the spool nr via SP01and then do a reprint then i'm able to reprint.
    What can be possibly the issue that I can't print the purchase order when I create the purchase order via ME21 when I save the purchase order? Can you help me with any guide on where I need to check why the PO is not printing immediatelly when i create the PO via ME21N?
    kind regards,
    Camilla

    hello all,
    thanks so far for your reply.
    i have checked today my user settings and that shows that my prints should go to LOCL (local default printer)
    The output conditions fpr purchase order have also LOCL (local printer)
    The weird thing is that I can print other reports to the default printer without any issues. The issue arise when I create a purchase order via ME21N. Normally when I save the PO it automatically prints. So no manual print instructions are required from my side. Because if I give manual instructions then I'm able to print the purchase order.
    Is it possible that the automatic printing is switched off and that it only prints when I hit manually the print button?
    Is the automatic printing something that is maintained in SPAD?
    kind regards and thanks for your help sofar

  • Major Issues with views in A3

    I am having some major issues with views in A3.
    If you look at my screenshot I am in the Browser;GRID view, however many of my images are out of view to the right (should be 26). There is no way to see them or select them. Also note that there is no SIZE control on the bottom right!
    If i view it in LIST mode, all my images show up. If I go to FULL SCREEN everything works like it is suppose to. It just happens in
    http://farm5.static.flickr.com/4007/4354751139647d87b323b.jpg
    Any ideas on how I can fix this?

    If I go into split view, I do not get any scroll bars so there is no way of viewing all my images.

  • How do i get hpeprint to work with print app from eurosmartz?

    How do i get hpeprint to work with print app from eurosmartz?

    If you have an idea for a new Print App that you would like to see, please submit your suggestion at the below link:
    https://h30495.www3.hp.com/idea/submit
    If I have SOLVED your issue, please feel free to provide KUDOS and make sure you mark this thread as SOLUTION PROVIDED!
    Although I work for HP, my posts and replies are my own opinion and not those of HP.

  • Issues with RAW files from my 7D

    I have Aperture 1.5.6 on my computer and the software updater says that is the current version. I shoot with a 20D and a 7D. I upload my raw files to Aperture and edit them from there and then process for a jpeg. However, every time I upload a raw file from my 7D I get the following message when I click on it to edit it: Unsupported Image format.
    Any words of advice, other than just buy Aperture 3??

    I have Aperture 2.X and had zero issues with RAW files from a 7D, so I think the problem is you are on 1.X. Converting to DNG first was a good suggestion if you don't want to purchase 3.X. Yet another reason to hate proprietary raw image file formats.......

  • Problem in sending image from applet to servlet

    dear friends,
    i have a need to send an image from applet to servlet via HttpConnection and getting back that image from applet.
    i am struggling with this sice many hours and got tired by searching any post that would help me but haven't got yet.
    i tried using this code but it dosent make any execution sit right. i got NPE at ImageIcon.getDescription() line;
    at applet side
          jf.setContentPane(getJContentPane());
                     FileDialog fd=new FileDialog(jf,"hi");
                     fd.setMode(FileDialog.LOAD);
                     fd.setVisible(true);   
                     v=new Vector();
                     try{                                                
                               FileInputStream fis=new FileInputStream(new File(fd.getDirectory()+fd.getFile()));      
                               byte[] imgbuffer=new byte[fis.available()];
                               fis.read(imgbuffer);
                               ImageIcon imgdata=new ImageIcon(imgbuffer);
                               v.add(0,imgicon);
                                String strwp ="/UASProject/Storeimage";              
                                URL servletURL = new URL(getCodeBase(),strwp);             
                                HttpURLConnection servletCon = (HttpURLConnection)servletURL.openConnection();       
                                servletCon.setDoInput(true); 
                                servletCon.setDoOutput(true);
                                servletCon.setUseCaches(false);
                                servletCon.setDefaultUseCaches(false);   
                                servletCon.setRequestMethod("POST");     
                                servletCon.setRequestProperty("Content-Type", "application/octet-stream");   
                                servletCon.connect();            
                                ObjectOutputStream oboutStream = new ObjectOutputStream(servletCon.getOutputStream());                     
                                oboutStream.writeObject(v);
                                v.remove(0);
                                oboutStream.flush();      
                                oboutStream.close();  
                                //read back from servlet
                                ObjectInputStream inputStream = new ObjectInputStream(servletCon.getInputStream());
                                 v= (Vector)inputStream.readObject();                     
                                 imgicon=(ImageIcon)v.get(1);
                                 showimg.setIcon(imgicon);
                                 this.getContentPane().validate();
                                 this.validate();  
                                inputStream.close();                                                        
                             //  repaint();
                     }catch(Exception e){e.printStackTrace();}  and this is at servlet side
            try {       
                         Vector v=new Vector();                    
                         ObjectInputStream inputFromjsp = new ObjectInputStream(request.getInputStream());                                      
                          v = (Vector)inputFromjsp.readObject();                                                                                                          
                          imgicon=(ImageIcon)v.get(0);                     
                          inputFromjsp.close();            
                          System.out.println(imgicon.getDescription());                                      
                          v.remove(0);
                          v.add(1,imgicon);
    //sending back to applet
                           response.setContentType("application/octet-stream");
                          ObjectOutputStream oboutstream=new ObjectOutputStream(response.getOutputStream());            
                          oboutstream.writeObject(v);
                          oboutstream.flush();
                          oboutstream.close();
                   } catch (Exception e) {e.printStackTrace();}  i really need your help. please let me out of this headche
    thanks
    Edited by: san_4u on Nov 24, 2007 1:00 PM

    BalusC wrote:
    san_4u wrote:
    how can i made a HttpClient PostMethod using java applets? as i have experience making request using HttpURLConnection.POST method. ok first of all i am going make a search of this only after i will tell. please be onlineOnce again, see link [3] in my first reply of your former topic.
    yeah! i got the related topic at http://www.theserverside.com/tt/articles/article.tss?l=HttpClient_FileUpload. please look it, i am reading it right now and expecting to be reliable for me.
    well what i got, when request made by html code(stated above) then all the form fields and file data mixed as binary data and available in HttpServletRequest.getinputstream. and at servlet side we have to use a mutipart parser of DiskFileItemFactory class that automatically parse the file data and return a FileItem object cotaing the actual file data,right?.You can also setup the MultipartFilter in your environment and don't >care about it further. Uploaded files will be available as request attributes in the servlet.is the multipartfilter class file available in jar files(that u suggested to add in yours article) so that i can use it directly? one more thing the import org.apache.commons.httpclient package is not available in these jar files, so where can got it from?
    one mere question..
    i looked somewhere that when we request for a file from webserver using web browser then there is a server that process our request and after retrieving that file from database it sends back as response.
    now i confused that, wheather these webservers are like apache tomcat, IBM's webspher etc those processes these request or there is a unique server that always turned on and process all the request?
    because, suppose in an orgnisation made it's website using its own server then, in fact, all the time it will not turned on its server or yes it will? and a user can make a search for kind of information about this orgnisation at any time.
    hopes, you will have understand my quary, then please let me know the actual process
    thanks
    Edited by: san_4u on Nov 25, 2007 11:25 AM

  • Issue with printing an Indesign PDF

    Hi all,
    I'm just getting into the InDesign software, picking new stuff up everyday.  So far, so good! Or so I thought...
    I've just created a small handout / brochure which I've converted to PDF.  The problem I'm having is that when I print the PDF it creates an opaque white box on every page in the same place. I've googled it and can't seem to find anything to solve it - the only thing that slightly married up to my issue was to do with the image clipping paths, but I didn't set any to begin with.  All images are currently JPG's that have been "placed" in and are set to a 30% transparency.
    I'm thinking of just doing a long winded trial and error by removing all images and seeing if that's what's causing the problem.  Unfortunately I have to do so on one machine, transfer it to another just to print to find out if that's the case.  Which is annoying...
    Any help would be most appreciated!
    Cheers,
    Rob

    Turns out it was an issue with the images that i'd put in (not 100% sure what!).  I don't think it was on the master sheet as I left that alone, but took out the JPGs in the rest of the document and put them back one by one.  Can't say what was causing the issue before because I set all the transparency settings the same and placed the images in like before, but at least it's fixed now!
    Update: It would appear it happens when I print the PDF as an image.  /facepalm....
    Thanks again for the replies and help

Maybe you are looking for