Need to print in image with good quality in multiple pages

rinting of the image display area is to small to read on some large displays
Need to restrict the image resizing in generating the print output to a minimum size (to allow it to be readable) and allow the printed output to flow into a multiple pages wide by multiple pages in length if necessary. Currently it is restricted to one page.
below is the code
public int print(Graphics g, PageFormat pageFormat, int pageIndex) throws PrinterException {
if (pageIndex != 0)
return NO_SUCH_PAGE;
Graphics2D g2d = (Graphics2D) g;
Rectangle2D.Double printBounds = new Rectangle2D.Double(
pageFormat.getImageableX(),
pageFormat.getImageableY(),
pageFormat.getImageableWidth(),
pageFormat.getImageableHeight()
// Print the header and reduce the height for printing
float headerHeight = printHeader(printBounds, g2d);
printBounds.y += headerHeight;
printBounds.height -= headerHeight;
// Carve off the amount of space needed for the footer
printBounds.height -= getFooterHeight(g2d);
// Print the nodes and edges
printDisplay( printBounds, g2d, 0 );
if (footer != null) {
printBounds.y += (printBounds.height + 15);
printFooter(printBounds, g2d);
return PAGE_EXISTS;
=================================
protected void printDisplay( Rectangle2D.Double printBounds, Graphics2D g2d, double margin ) {
// Get a rectangle that represents the bounds of all of the DisplayEntities
Rectangle r = null;
for (Enumeration e=displayManager.getEntitySet().getEntityEnumerati on();e.hasMoreElements();) {
DisplayEntity de = (DisplayEntity)e.nextElement();
if (r == null)
r = de.getBounds();
else
r = r.union(de.getBounds());
// Get that as doubles, rather than ints, and expand by half the margin
// height in all directions
Rectangle2D.Double entityBounds = new Rectangle2D.Double(r.x,r.y,r.width,r.height);
entityBounds.x -= margin/2;
entityBounds.y -= margin/2;
entityBounds.width += margin;
entityBounds.height += margin;
// See if height and/or width was specified
Unit specifiedSize = configuration.getHeight();
double printHeight = (specifiedSize != null) ?
specifiedSize.getValueAsPixels((int)printBounds.he ight) :
printBounds.height;
specifiedSize = configuration.getWidth();
double printWidth = (specifiedSize != null) ?
specifiedSize.getValueAsPixels((int)printBounds.wi dth) :
printBounds.width;
// Figure out the ratio of print-bounds to the entities' bounds
double scaleX = 1;
double scaleY = 1;
// See if we need to scale
boolean canExpand = configuration.expandToFit();
boolean canShrink = configuration.shrinkToFit();
if (canExpand == false && canShrink == false) {
scaleX = scaleY = configuration.getScale();
else {
if ((canShrink && canExpand) ||
(canShrink &&
(entityBounds.width > printWidth ||
entityBounds.height > printHeight)) ||
(canExpand &&
(entityBounds.width < printWidth ||
entityBounds.height < printHeight))) {
scaleX = printWidth / entityBounds.width;
scaleY = printHeight / entityBounds.height;
if (configuration.maintainAspectRatio()) { // Scale the same
if (scaleX > scaleY)
scaleX = scaleY;
else
scaleY = scaleX;
above methods am using for printing image. but in large display i cant able to read letters.
Thanks in advance
Srini

Your renderer is wrong.... try this (untested):
   class myCellRenderer extends DefaultTableCellRenderer {
     public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col) {
        if (value!=null) {
          ImageIcon icon = new ImageIcon(image);     // assuming image is defined elsewhere and is accessible
          setIcon(icon);
          setText(value.toString());
        } else {
          setIcon(null);
          setText("");
        return this;
   };o)
V.V.

Similar Messages

  • How to resize image with high quality

    I refer lot of examples in image resizing. But quality of resized image not good. pls can give me solution for that with code?

    I refer lot of examples in image resizing.Have you read [_this article_|http://today.java.net/pub/a/today/2007/04/03/perils-of-image-getscaledinstance.html]?
    db

  • Action to: Print current document to PDF Printer "As Image" with Specified DPI

    I FREQUENTLY do the following task on documents.  I would LOVE to have an action that did it for me.  Can someone help me create one or point me to someone who can?
    Version: Adobe Acrobat X Pro.  Windows 7 64-bit
    With current PDF file open:
    2) Print
    3) Select PDF Printer
    4) (Under advanced printer settings) choose "Print as Image", "150" DPI.
    5) OK
    6) Save file AS the original with _printed appended to the filename.
    Image1: Printer dialogue box
    Image 2: After selecting the PDF Printer and pressing "Advanced"

    The forum added some nice links and i found my answer here http://forums.adobe.com/message/1179199#1179199 - changed the registry key permissions and it's working like a charm. Thank you.

  • Pixelated images (with High Quality Display turned on)

    Here's my problem: The images look sharp on the internet, but when I download them, place them in Indesign and print them, the look pixelated!
    Take this one for example: http://media.smashingmagazine.com/images/typefaces/productus.gif
    It's resolution is 72 ppi. But when I place it onto the Indesign A4 page (or Letter format for that matter) it occupys almost entire width of the page.
    Why is it so? Why is it so big by default without enlarging it? It's kinda logic that a small 72 ppi image stretched across the whole page will appear blurry when printed on 300 dpi printer.
    So how can I set the indesign page to 300 ppi/dpi so images with lower restion will appear smaller when placed on the page and - will be printed sharp?

    mike.n03 wrote:
    Where can you specify this preference?
    And you mean there's a script for InDesign? Wow, it would be cool to get it. So far I solved that problem by recording an Action in Photoshop and than apply it to all the images using Batch command.
    Preference is down at the bottom of the File Handling section ...  Check the bos to preserve dimensions and a the relinked file will be scaled back to the same size in ID. Uncheck, and the scale percentage will be preserved.
    Almost anything is scriptable in ID (but I don't write them). I recall a script that was posted a year or two ago that would allow you to select an image and type a desired effective resolution into a dialog. The image would get scaled to reach that effective ppi. Your batch action in Photoshop is fine, and useful if you want to palce everything at 100%, but it isn't required to change the resolution in Photshop to achieve what you want. Scaling in ID is exactly the same thing as changing the resolution without resampling in Photoshop. No pixels are added, removed or altered -- only their dispalyed size is changed. If you want a script to set all images to 300 ppi effective resolution, you should probably pay a visit to the scripting forum.

  • Printing .GIF images with PHP

    Hello,
    As part of a PHP IF statement, I would like to print an image
    instead of text. How do I do this?
    Thanks in advance,
    John

    I've done some dabbling in PHP's GD library (the image
    manipulation extension of PHP).
    What I have done in the past is create a separate php file
    just for the image output. I then pass in the parameters needed to
    create the image in the image request. So as an example, I'd send
    the image request like so:
    http://domain.com/preview_image.php?text_string=Type%20Text%20Here&text_color=black&bg_col or=white&font=ADORABLE
    preview_image.php is the php file that contains the script to
    generate the image based off of the text_string, text_color, and
    bg_color variables contained in the query parameters.
    Or if you don't need a dynamic image, just echo the image tag
    inside the if statement:
    echo "<img src='pathtoimage.jpg'>;

  • Face needs a name shows images with no un-named faces

    I've upgraded from Aperture 2 to 3, and imported all my iPhoto '09 images. I've been through and removed dupicates and named all the faces in my library.
    However, the smart album included with Aperture 3 with the default settings "Needs a Name" is showing a number of images with no faces in.
    Now I'm used to this happening in iPhoto, so checked for faulty face detection. As you can see from the enclosed screenshot, there are no un-named faces (or objects) detected. (I am in naming mode, the screenshot did not caputre the HUD).
    I've tried the Dectect Missing Faces menu item (nothing found). I've tried adding a manual face and removed it. Nothing.
    Is anyone else having this problem? Any idea how I can get rid of these faceless images?
    All the best
    Daniel

    It's not that faces doesn't work at all - I can see, name and get suggested faces with the library as it is - so I don't see what I'm going to prove by creating a new library.
    I wanted to be sure that Aperture is working correctly, if the library has no issues.
    You suggest my faces database might be broken - what does that imply - is no repair possible?
    You have tried the built-in repair options - repair library, rebuild library. If you have enough disk space you could try to rebuild the library by importing it into a new library. Add some images with faces to it, before you import your old library. This will recreate the library and the Faces database. I cannot guarantee that this will solve the trouble, however. When I had a similar problem, only manually repairing the library package by replacing the "Faces" database inside from the backup did help, but you have added too many faces since the last working backup to go this way.

  • Method needed to combine 50+ images with same background. Not a portrait.

    Hello,
    Here is what I want to do. I have taken about 50 images of people walking in a heavily trafficked area. I want to have all the people added together into one image. Each person is to have full opacity.
    I started by making an image with no one in the scene using the Median blend mode with a layer stack to remove all the people. Worked fine. Now, I am hoping there is some way to create masks or knockouts of the people in each of the individual images by somehow comparing them to the scene with no people. Some way to mask out or knock out those areas which are different, i.e. the people. I will then stack all the images of the people on top of one another to create a very complicated image showing the volume of traffic.
    Any suggestions would be greatly appreciated.
    Using CS3.
    Best regards, Seder

    Difference blendmode. Put the people on your clean BG, switch the mode. Flatten the result, use adjustments to properly make it b/w. Select all, insert as custom channel or into an existing layer mask to get the transparency. If the photos were shot under same lighting conditions, you could even create an action for it to easily repeat all steps.
    Mylenium

  • Printing an image in the centre of the page

    Uhhhh, anybody know how to do the above?
    Sometimes I print documents and there clipped, so I'n page setup I reduce the page to 90%, but when I print it I cant centralise the document, it always stays bottom left.
    Thanks for you time.

    igrok,
    I'm not sure exactly what you are asking for. Do you want a detailed explanation of the steps gone through to try to print a particular type of document from a particular application, or do you want to see a screenshot of the preview and print dialog, followed by a scan of the clipped output? I think I have figured out what is happening in my case, though I'm not sure if the cause is rooted in the OS, or in the HP printer drivers I am using.
    As an example: If I try to print a PDF document which was scanned from an 8.5" X 11" original, obviously the bottom would be cut off by the printer without my either specifying a reduced print size or selecting "Scale each page to fit paper" in the print dialog. The problem is, when either one of these avenues is tried, the image is relocated to the left/bottom of the page, rather than centered in the printable area or at least at the middle/top. This behavior effectively places the bottom and sometimes left edges of the image outside of the printable area on the paper no matter how small a print size is specified.
    I was able to find a partial workaround. If I print in landscape, and check the "Automatically rotate each page" option, the image ends up printed at the top/left of the sheet. This saves the bottom of images for me, but still cuts of the left edge occasionally.
    As implied by the subject of the original post, there really should be an option to center the image on the page. There is not. This would merely be a small annoyance were it not for the fact that the scale to fit function is either broken in Leopard or in HP's drivers.
    If you are interested in a screenshot of the print dialog illustrating this behavior, I can post one and provide a link.
    Thank you for your interest and to anyone else who cares to look into this issue.
    Otto

  • Need help with displaying content on multiple pages

    Hi I'm kind of a dreamweaver newbie and i'm a little in over
    my head. I'm trying to design a web site with the same content
    appearing on multiple pages. Here's the current site...
    http://home.comcast.net/~gascec/cecnh20/index.html
    I'm trying to establish the top bar and side bars of links
    and the logo on each page from one point so i don't have to change
    forty pages if i update a link.
    I know there's a way to do this and i thought it was using a
    CSS page but i can't figure it out and i'm running out of time.
    Help

    Got it. Thank you. I'm having one other problem though. I
    keep getting this bizare message every time i save or try to use
    the template:
    The is an error at line 41 column 7 (absolute position 2486)
    of "~pathandfilename.dwt": Nested editable regions
    The only thing at line 41 is the <body> tag. I took all
    the formating out to try to trim this out... any thoughts about
    this one.
    Thanks G

  • Help with header field on multiple pages

    I am trying to print three multiple page documents.  The first document in the dat file has data in a header comment field.  The last two documents in the dat file do not have data for the header comment field. On the form I have defined this comment field as global.  When I print the documents the first document comment is being printed on the last two documents that should not have comments.
    If I remove the global condition for the comment field, then the comment is only printed on the first page of the first multiple page document.  Is it possible to print the comment on each page of the first multiple page document and not print the comment on the documents that should not have a comment?  Thanks for any help.

    Got it. Thank you. I'm having one other problem though. I
    keep getting this bizare message every time i save or try to use
    the template:
    The is an error at line 41 column 7 (absolute position 2486)
    of "~pathandfilename.dwt": Nested editable regions
    The only thing at line 41 is the <body> tag. I took all
    the formating out to try to trim this out... any thoughts about
    this one.
    Thanks G

  • Can't Print Large Images With PrintJob()

    Hey all,
    I'm having an issue where when I try to print a larger image
    via printjob one of two things happens. One either the job fails or
    two the output of the image is literally diagonally cut off. I am
    simply passing the stage to the print job. I've tried both with and
    without using printAsBitmap. Anyone encounter anything like
    that?

    nope. but you'll need to scale your stage to fit the
    page.

  • Need to capture dvd footage with great quality. dvdxdvpro doesn't do it.

    hi
    I have lots of noncopyright footage from dvd's that I need to convert for fcp, yet when I use dvd.dvpro the quality is not as good. Is there a better way I can do this and maintain the quality of the original video? Would it work better if I just hooked up the dvd player to a camcorder and recorded it that way? How about the canopus media converter? Would that be better?

    as posted several times before; the dvd is where your quality problem comes from.
    now as for chosing between dvdxdv and streamclip;
    dvdxdv - afaik - only converts to dv, adding dv compression on top of mpeg2 compression.
    mpeg streamclip lets you export into a range of formats, from original m2v (wihtout recompression) to any format quicktime supports. in this case, you might want to compare exporting to for example quicktime animation compression. yes this will create gigantic files that are too "loose" a fit for the heavily compressed m2v video from the dvd, but at least it will avoid adding another layer of compression.
    in general; if all you need to do is straight cuts, avoid any conversion and try to work with the m2v files
    that's about the best you can do
    hope this helps

  • I have an HP Office Jet Pro 8500 A 917 unit. I need to print *pdf documents with larger print

    I cannot read the print (normal) when I print a pdf document.  I need to enlarge the text but I can't find any information on how to accomplish this.
    Thanks in advance.

    Hello DJohnsen,
    I am sorry that you are having trouble printing a readable .pdf document!  I would like to know a couple of things.  Is this a general .pdf print from a local PC/External Hard Drive, web content or is this an ePrint attachment?  There are a couple of different factors that could be effecting the outcome of this print job.  To name a few: resolution of the document, how the .pdf was created (format) and print settings.  I would like to give more insight; please post with more details about the print job.  Thanks! 
    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.

  • Reduce physical size of image with minimal quality loss

    Hello,
    I have to fit high res, high quality, images behind a presentation frame, which is only about 800x600. Everytime i reduce the high res images to fit behind the frame, even with bicubic sharper on, the reduction in quality is really bad. Is there anyway i can maximise quality when reducing the dimensions of the image?
    Any help much appreciated...

    Hi Ed,
    What approximate sizes are you starting from? My hunch is that you are expecting too much detail to remain in an 800 X 600 which is pretty small. As far as I know the bicubic algorithm is the best for reducing images that Photoshop has ever produced.
    You might try an experiment. After shrinking your image duplicate the background layer in the layers palette. On the duplicate layer run Filter > Other > High Pass and set the radius to 0.5. Then change the blend mode of the High Pass layer to Overlay. You may find that you like the subtle sharpening without artifacts.

  • Print a image with the standard pdf-print function

    hello,
    we have a Web-Template with a query a chart an the company-image.
    When we want to print the Web-Template with the pdf button, then we get only the query and the chart in the PDF.
    What can I do, that I get also the image in de PDF-Print-Layout?
    I tried it with a .png and a .gif image.
    Thank you very much!
    Best reagards,
    andreas

    hi,
    at the time I have no solution for this problem.

Maybe you are looking for

  • Adobe Bridge Search Stuck On Current Folder

    to start off, the adobe bridge search feature is loaded with glitches. sometimes it works great, other times not at all. well, today when i opened the program and tried to search for some files i found that for some reason i was only able to search i

  • 802.1x authentication on PSK key mgmt?

    Hello, I'm setting up a new 5508 WLC (the first wlc I have ever setup) and I have my WLAN setup with our existing WPA/TKIP ssid for transitioning our clients from our existing autonomous system to the wlc. I have selected PSK as the key mgmt and I ca

  • Tracking Usage of an application that uses EAI Object Manager

    Hi, We have had created for us an application that works using Siebel EAI. I have been asked to implement some tracking of usage, so that we can see who is using the application. Building on some work that we use in the main application, I have an ex

  • Changing hitData area on a column chart?

    Hi everyone, I want to allow the user to hover over the chart and have the datatip for a column come up without the user having to scroll over the filled in area of the actual column - in other words if the user hovers his/her mouse 100 inside the ch

  • Report Error (Basis)

    Hi Experts, I developed a report which involves alot of calculations,When i executed that report on Cal Year/Mon it shows results but when i drill down it by day r department,It shows following error and disconnects <b><i>1)Error An exception with th