Help!!! Image print problem

hi,
I want to print an image using JAI(Java Advance Imaging). I have something which scales the image
first and then prints it out. It prints the image, but the resolution of the Image is horrible.
The image comes out so blury it hard to see. Can anybody help me with this problem.
Any help is always appreciated.
Here is the Code.
import java.util.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.print.*;
import javax.media.jai.*;
import com.sun.media.jai.codec.*;
import java.awt.image.renderable.ParameterBlock;
import javax.swing.RepaintManager;
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2002</p>
* <p>Company: </p>
* @author unascribed
* @version 1.0
public class JAIImagePrint implements Printable {
protected RenderedImage renderedImage;
protected int imageWidth, imageHeight;
protected Point printLoc = new Point(0,0);
public void setPrintLocation(Point d) {
printLoc = d;
public Point getPrintLocation() {
return printLoc;
public void loadAndPrint(String filename){
RenderedOp renderedOp = JAI.create("fileload", filename);
renderedImage = renderedOp.createInstance();
print();
protected void print() {
PrinterJob pj = PrinterJob.getPrinterJob().getPrinterJob();
pj.setPrintable(this);
pj.printDialog();
try{
pj.print();
}catch(Exception e){System.out.println(e);}
public int print(Graphics g, PageFormat f, int pageIndex){
if(pageIndex >= 1) return Printable.NO_SUCH_PAGE;
Graphics2D g2d = (Graphics2D) g;
g2d.translate(f.getImageableX(), f.getImageableY());
if(renderedImage != null){
double scale = Math.min(f.getImageableWidth()/ renderedImage.getWidth(), f.getImageableHeight()/renderedImage.getHeight());
Interpolation interp = Interpolation.getInstance(Interpolation.INTERP_BICUBIC);
ParameterBlock params = new ParameterBlock();
params.addSource(renderedImage);
params.add(new Float(scale));
params.add(new Float(scale));
params.add(0.0F);
params.add(0.0F);
params.add(interp);
PlanarImage image = JAI.create("scale",params);
printImage(g2d, image);
return Printable.PAGE_EXISTS;
} else return Printable.NO_SUCH_PAGE;
public void printImage(Graphics2D g2d, RenderedImage image){
if((image == null)|| (g2d == null)) return;
int x = printLoc.x;
int y = printLoc.y;
AffineTransform at = new AffineTransform();
at.translate(x,y);
g2d.drawRenderedImage(image,at);

I have run into the same problem. From what I have seen the Image object is only capable of handling a pixel based picture. A pixel based picture only has a resolution of 72 dots per inch, where as most printers have a much higher resolution.
I haven't found a way around it yet. But I am looking at some alternative methods.

Similar Messages

  • Image Printing Problem

    I make use of Crystal 10.  I have a report that print 1 page per record.  This page include data and 3 images.  Recently, this report started to print some pages correctly while other pages images printed black.  Would appreciate if someone can highlight what happen because after rebooting the crystal report server, the problem goes away.  Need to find the root clause and not reboot server all the time.
    rgds,
    Loh

    Hi Loh,
    Need a lot more info.
    Are you using CR Enterprise?
    Are you using a custom application you or someone else wrote?
    You'll have to monitor the WEB servers resources or local browser cache etc.
    What have you done so far to debug the issue?
    Thank you
    Don

  • Image printing problem with Photoshop and Lightroom specifically with 11X14 cuts off top of image and moves bottom border up. Windows 7 OS - Epson Printer is working properly.

    Have an unprecedented problem with printing 11X14 photos in both PS and Lightroom. The printer is operataing properly. Printing 81/2X11 correctly. Have double and triple checked all the printing settings and they are correct. Have checked with friends to no avail. This problem started yesterday. Widows 7 OS. Need help.

    You show the OS receiving an image from Photoshop, and the OS starting the Epson print driver and handing it part of the image, the driver connects to the printer, then the print driver fails. It looks like a bug in the Epson rasterizer, or the printer communication.
    You really need to talk to Epson.  Photoshop isn't involved in that error.

  • Please help, color printing problems.

    I have snow leopard and just bought a new HP officejet 7500 wide format wireless all-in-one. The problem is when I Print from my boyfriend's PC, the pictures are fine but when I print from my imac, the image I see on the monitor isn't what is printed. The colors are off and the picture is way too dark. I've looked on the internet to try to find a solution but haven't really found one. Please help.

    Hello
    Driver from HP web site
    http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=mp-86352-1 &cc=us&dlc=en&lc=en&os=219&product=4083652&sw_lang=
    instruction for configurationn  and use
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c01846935&tmp_task=setupCate gory&cc=us&dlc=en&lc=en&os=219&product=4083652&softwareitem=mp-86352-1&sw_lang=# N28
    HP printer listing for os 10.6 support is not that clear but "HP Officejet Pro L7500 series" in on the list so you may not need to download driver from hp but only from apple
    HTH
    Pierre

  • Help resolving printing problem with v10.6.8 and Canon MP780 PIXMA

    Hello,
    My Canon MP780 PIXMA stopped being able to print text in black some months ago and having scoured the internet for advice I've discovered that this issue is not that uncommon. This printer uses 5 ink tanks 3 of which are for single colours and two of which are for different kinds of black ink. The tank responsible for printing black text (fonts) for some reason just won't do its job.
    Amongst other people's online posts I found a workaround cheat to print black text (simply change the paper setting to Photo Quality or Double Sided Photo for printing either single or duplex printing).
    But this uses up too much ink and is EXTREMELY slow.
    I have read of the same issue using a different series of Canon printers - and apparently those Canon laser printers just needed an updated CAPT driver.
    Tasks already attempted to no avail:
    - cleaning the ink nozzles via the software utility
    - print test via software utility demonstrates absent gridline pattern
    - taken out print head and cleaned carefully with water then left to dry naturally before replacing
    - removed Microsoft Word font folders from user library location then restarted my machine (in a desperate response to some advice given in this community to someone else experiencing the same problem but with a different printer)
    - opened FontBook and resolved duplicate fonts and restarted my machine (there were about 5 duplicates)
    - tried printing from TextEdit and Preview to see if Apple software was behaving differently to Microsoft Word and Adobe Acrobat - but still cannot print black text
    I've had this printer for about 7 years and although it's a massive machine and doesn't have built-in proper networking, it makes scanning and printing massive documents so easy - well it did before the black text problem began - so I'd love to find a true solution rather than chuck it out and buy a new printer.
    I run it from a MacBook 2GHz Intel Core 2 Duo, Version 10.6.8 via USB cable.
    Thanks in advance for taking the time to read this.
    Simone

    Hi there! Because the forum you originally posted in is for beginners trying to learn the basics of Photoshop, I moved your question to the Photoshop General Discussion forum, where you'll get more specialized help.
    You will be able to continue your current conversation with PECourtejoie without inturruption.

  • Can someone help with print problem?

    I have problem saving the printer driver settings in CS6, and not shure it is problem with my installation only. Can anyone check for simlar behaviour by selecting some printer driver settings that are not the default ones and see if those are saved when Done button in the Print dialog is pressed. Thank you!

    There are only few threads describing the similar problem, I have been checking for meny years for that because it is nothing new to me I remember the same behaviour in CS and CS2, and allways wondered why there was no official fix for it. Actually, the reason to ask for help is not the bug itself, but rather the bizzare lack of user complaints in community forums, that would have eventually rised the program designers attention. Am I the only one out of maybe millions of Illustrator userrs that regularly prints from it?

  • HELP  with printer problems...

    Have just reinstalled printer drivers and I do not have the folder PRINT CENTER in my utilities folder. Not sure why. Only the PRINTER SETUP UTILITY folder is there. My problem is that I cannot access the printer dialogue box that has pulldown menu for paper specs, so cannot print as needed. My printer is Epson Stylus 1280. Any help/ advice would be greatly appreciated.. troubleshooting all day to no avail..
    G4 PPC   Mac OS X (10.4.8)  

    OK. Did that. But I cannot access the pull down menu that enables me to choose the type of paper. Both quark and photoshop heve that box but its not coming up on this computer. (It does on my other OS9 computer)

  • Image Print problem in PDF Reports

    Hi,
    I have imported a JPG image on the layout using Reports builder 6i using File -> Import -> Image. Once imported, this image is displayed correctly in the report layout editor. But, when I run this report (Pdf format) from Oracle Apps, this image is displayed with half side displayed as solid black color and the other half side with the actual picture.
    I have tried to change the size of the image, import other type of images (BMP) & tried dynamic image using "Link File" option, but nothing could work.
    Appreciate your help on the same.
    Thanks.

    Hi,
    Yes. I have tried running that report with other images of different formats & size. But nothing worked out till now.
    Regards.

  • Help! Printer Problem

    Hi everyone, here's is the situation. My Dad bought my Mom a Dell Inspiron laptop running vista64, I know, I know She can print fine when the epson rx680 is directly connected to her laptop. She can print fine to the printer, which is connected to the Airport Extreme, when she connects the ethernet cable from the AE, but when she try's printing wirelessly it prints funny. Meaning the document starts to print the first page ok, gets about half way through the second page and then stop's, after about 50 seconds its starts to print again, continuing on the second page, except it will start to print the top of the first page on the bottom of the second page, and then start the same process over and over again. It just keeps printing.
    We have tryed Bonjour and the manual setup of Standard TCP/IP port, puting the AE ip 10.0.1.1 as the printer Name,niether will let it print correctly. I hope some one can help we dont want to call a network geeks in.
    thnx Jess

    We're all still looking. I've asked the same thing here: http://discussions.apple.com/thread.jspa?threadID=2221755&tstart=0, and to my knowledge nobody's found a workaround yet.
    ...+but we're all still looking for one!+
    Doc

  • Please help with Printer problem on MBP

    I am running 10.5.1 and am trying to install the software to enable me to scan. I have tried from the original CD, but it doesn't work (i assume this is because it was meant for 10.4). I have also tried downloading from the website but the download always says something like "19mb out of ?" and then eventually the downloads errors out.
    Is there any way i can get the scanner to work? can anyone upload this software to me? I know its a lot to ask but im not sure what to do.

    Don't know what to tell you, but I downloaded the file without any problem. Do you have enough space on your drive for the file? You may have a problem on your drive so you might consider doing the following:
    Repairing the Hard Drive and Permissions
    Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Installer menu (Utilities menu for Tiger and Leopard.) After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list. In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive. If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer. Now shutdown the computer for a couple of minutes and then restart normally.
    If DU reports errors it cannot fix, then you will need Disk Warrior (4.0 for Tiger and Leopard) and/or TechTool Pro (4.6.1 for Leopard) to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.

  • HELP- Printing Problem with Photoshop CS4

    Hello Everyone,
    I just bought the PHOTOSHOP CS4, and I am having problem when it prints. The image is not clear, it has dots (pixels). This computer where I installed this program is brand new. I have previously worked with Photoshop CS2 and never had an issue but was force to buy this new one because the computer that I bought has Windows Vista and CS2 is not compatible. I thought maybe the problem was my printer but is not I have a Brother HL-5140 (black and white). I have connected my old computer with the printer and the images print perfectly fine. I have printed photos and it prints clear. But this only happens with Photoshop CS4. It prints dots, can someone please help me. Is driving me crazy.

    Really I'd be willing to bet it's your driver under Vista.
    I have the same problem using Vista and a older HP LaserJet, under XP and CS2 it prints well. Under Vista it's a bunch of dithered pixelated dots.
    They want you to buy a newer printer.

  • Printing problem linked to EXIF time data for JPEG images.

    For some years I have been using Photoshop Elements 8.0 with no problems of any kind. My computer runs on XP Professional with a system comfortably in excess of the minimum requirements to run Elements 8.0. I load my images into Elements from a card reader which is the same one since I got this version of Elements. I shoot mostly in JPEG with a Nikon D300. I print to one of 2 Epson printers, an SX100 and a PX700W. I don't use the wireless feature of the PX700W, connecting it via USB.
    About a year ago I suddenly began to experience printing problems. If I tried to print an image Elements crashed just at the point where printing would begin. By trial & error I discovered that if I adjusted the time in the EXIF data of the image in Elements, whether by advancing or retarding it by hours or days and then adjusted it back to the original time I had no problems printing that image thereafter.
    I also discoveredc that where I had shot in RAW I could print direct from the RAW image in Elements or from the JPEG I saved from an edited in RAW and had no problems.
    I saw the forum discussions about the issues about the date/time in EXIF having been changed following the import into Elements. For those images I still had on my memory cards I checked the EXIF data in Elements and compared it what was on the image on the card. They were the same. I also checked the time zone and time settings of the camera and they were correct.
    I backed up my catalog, re-formatted the computer to bring it back to its ex-factoy status, re-installed Elements and restored my catalog. I imported new images, tried to print them and the problem was still there.
    Before I might upgrade to Photoshop Elements 10 I'm hoping someone else may tell me they have had the same problem and, hopefully, be able to tell me how they fixed it. I know the workaround will bypass the problem but it really annoys me that it suddenly appeared and I seem to be stuck with it. I'm also concerned that, given I totally re-formatted my computer but the problem  is still with me, that the problem may be imbedded in my catalog and simply gets backed up to,\and restored from,  my backup.
    I'd be grateful for any ideas.

    Hi Miceal,
    Though I'm not sure, but see if Catalog repair and optimize helps resolve the issue.
    For doing this, click File >> Catalog and selec your catalog and then click "repair' button.
    Tick the checkbox for rebuilding indices in the repair workflow.
    Now perform the optimize operation on the catalog similarly.
    Let me know if that helps.
    Thanks
    andaleeb

  • Optimizing images for Help and Print/PDF

    i'm struggling with how to optimize graphics so they look good in both Help and print/pdf output.
    I use Snag-it to Capture and save as PNG 300 dpi.
    I often put the images in Vision and add callouts and save as PNG.
    From RH I generate a printed output (Word) which I convert to PDF.
    So with all the programs an image goes through (snag-it > visio > RH > Word > PDF) i'm not always sure what the best settings are.
    Does anyone have guidelines/suggestions  ?
    Thanks

    I've had very good luck going from a SnagIt capture to Robohelp to Word to PDF. I add callouts directly in SnagIt to save myself a step and save the files as a 24-bit (True Color) PNG. The graphics are very legible in the WebHelp output, in the Word document, and in the printed PDF.
    The only thing that doesn't work well, I've found, is when I reduce the size of a graphic in either SnagIt or Robohelp. Instead, to keep a graphic's dimensions manageable, I either shrink the s/w application window before I grab the screen, capture just a portion of the screen, or crop the screen shot in SnagIt.
    What problems have you been encountering?

  • Officejet j6480 sometimes not printing entire image: printer or software problem or conflict?

    Dell Inspiron, windows xp-pro, version 5.1 sp 3,
    software: microsoft digital image 2006
    I've been using digital image (DI) for several years and have never encountered this issue before now, but my printer is new and has some features I may not entirely understand.
    I've created 4 separate images for a t-shirt transfer using DI.  2 images each are set up on an 8.5 x 11 layout, landscape mode.  They were "cut out" and placed on each layout for printing.  On my monitor, each image is a complete image: ie, no part of either image is missing or blocked out.  However, when I print the document, sometimes part of one image doesn't print.  The actual printed piece looks like an object or "blank" box was placed on top of the sheet of paper before printing, printed, and then taken off the printed paper leaving no ink beneath it.
    DI allows you to cut out a photo and use the cut out with no background which is what I've done. The cut out follows the line of the object, dogs head, for example.  The edges are not straight as if in a frame, however when the object is selected for editing, a dotted frame does appear around the edge.  More than one object can be selected at one time and there can be an overlap of these frames, but once the object is deselected the frame disappears.  
    What really has me baffled is that the missing part of the image is squared off on two sides, is always in the same spot on the paper, completely different documents print the same way, you can see where the edge of the missing piece printed, but very light in color, and the document does print out correctly, sometimes.
    Sorry to be so long winded.  I'm trying to preserve the transfer paper since it is expensive and don't want to chance an incomplete printed sheet having to discard it and start over, hoping "this time it will work!"
    Does anyone have any ideas?  I know it sounds like a software problem but it also sounds like a printer problem, or both.

    Hello @rslade , and welcome to the HP Forums, I hope you enjoy your experience!
    I see you're having problems printing in colour.  I would like to help!
    Do you have any issues making a colour copy, as opposed to a print?
    I would suggest deleting the printer from your print system, using this document: Uninstalling the Printer Software.
    Once you have deleted it, I would suggest verifying and repairing the disk permissions: About Disk Utility's Repair Disk Permissions feature.
    I would also suggest running your Apple updates:  OS X: Updating OS X and Mac App Store apps
    After the updates, I would recommend reiadding the printer:
    Installing a Mac Printer Driver Using Apple Software Update
    Good luck and please let me know the results of your troubleshooting steps. Thank you for posting on the HP Forums!
    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!
    Jamieson
    I work on behalf of HP
    "Remember, I'm pulling for you, we're all in this together!" - Red Green.

  • Problem: codebase, jar and image reloading problem please help!

    Hi Java Gurus,
    I have written an applet that extends JApplet for viewing webcam. In order to reduce the download time I put my classes into a doorcam.jar file. The following is my <applet> tag in my html file.
    <applet code="CameraApplet.class"
    archive="doorcam.jar"
         codebase = "webcam/classes"
         width="375" height="475">
    <param name="imagePath" value="http://judge/webcam/images">
    <param name="webCamImage" value="door.jpg">
    <param name="COMPort" value="COM2">
    <param name="frameRate" value="10"> <!-- could not exceed more than 10-->
    <param name="host" value="judge">
    </applet>
    The fist problem is that my class file does not get loaded from the jar file if i provide the "codebase" attribute as above. Instead the browser load every single class file from the webserver. This has some problem too. Coz the browser sometimes just thorough NullPointerException or ClassNotFoundException. After much of debugging I found out that the problem is the IE browser which seldom fails to load classes or image file from the server. If i referesh the browser the applet and all its classes loaded successfully and runs smoothly. This behaviour never occurs when running with "appletviewer".
    I wanted all my classes to be loaded from my jar file. After much of trial and error I found out that if i remove "codebase" attribute the browser loads the classes from my jar file and applet loads very fast. This is where the second problem comes in. The browser does not reload my webcam image file so that the webcam become alive with live images, like before.
    If I run on "appletviewer" everything works fine my web cam is displayed properly. But in IE browser the image does not get reloaded when I refresh my image to give live to my webcam display. The refresh method is given below.
    private void refresh(final URL url) {
    Image webCamImage =getImage(url);
    webCamImage.flush(); // flush out the previous image
    webCamImage = getImage(url); // get a new image
    webCamImageIcon.setImage(webCamImage); webCamImageIcon.paintIcon(webCamLabel, webCamLabel.getGraphics(), 15, 15);
    When I add the "codebase" attribute back, the image gets reloaded for every refresh() and everything works fine. But the classes are also loaded from the server. And occasionally also suffers Class loading and image loading problem. As I presented earlier, when I do refreshing in the browser everything gets loaded and the applet function correctly with web cam displaying very well.
    The problem is so strange that I could not find any way to solve it.
    It would be a great help to me if somebody provide me some work around to the problem.
    I tested on Windows 2000, Windows XP, IE 5.5, IE 6 with J2SDK 1.4.0.
    Thank you all very much in advance.
    best regards,
    Judge

    Thank you so much for the suggestions. I did tried the way u suggested. The problem still the same.
    I think its the problem between IE browser and Java Plug-in.
    I which SUN would find these incompatibilities and solve these problems.
    I even tried using java SDK and plug-in 1.4.1 it even worst. It can't even load an applet. And it does not show any loading messages nor any error messages. It just show a cross sign on the upper left coner.
    I would be so glad, if Sun would try to eliminate the inconsistancies such as caching, loading, initializing etc between browser and its Java plug-In. For example, applets behave well in appletviewer and behave unpredictably in browser environment.
    I have seen so many people in the forums with all sorts of problems because of this.
    Right now I m desperately looking for work around to my problem.
    If somebody would provide me with the solution to my problem it would be a great help to me.
    thank you all so much.
    best regards,
    Judge

Maybe you are looking for

  • BAPI for Purchase Order Creation

    Hi All, Purchase Order creation through BAPI, Auto Po creation. Please advise program. The requirement is: when we delivery the goods from one plant to another plant,PO should create in second plant with goods what delivered from first plant. Pranith

  • How can I get a new rear cover for iphone (not 3G)

    I have the older iphone 16GB (not 3G). it was broken when I dropped it. I tried taking it apart, and of course, I bent the aluminum back cover of the phone and can't get it back to the exact shape it was in before I bent it. Does anyone know where I

  • IDOC to FILE - Output problem

    Experts, In the IDOC I receive, there a ~ symbol after each record. So while conversion, my file is holding only the first record. Later records are missing. What do I need to do to get complete file output.

  • Changing Role created with Customizing Auth. Utility

    I created a role in PFCG using the Customizing Auth. option under Utilities by referencing a project view that I created in the IMG.  My intent was to create a security role with access to all of the SPRO tcodes and related security objects.  I then

  • Can I use Sample Tank and Beatmaker2 programs. I have those in my iPad. and if so how?

    I have Beat Maker 2 and Sample Tank in my ipad 2, can I integrate the sounds and possibly songs so that I can work with them in Logic Pro?