Results 1 to 2 of 2
  1. #1
    Shabber102 is offline Member
    Join Date
    Jan 2012
    Posts
    10
    Rep Power
    0

    Default Image Size in PDF

    Hi All,

    I am using ITEXTPDF for creating pdf in java.

    I am using following code to display an image.



    Image image = Image.getInstance("D:\\logo.jpg");

    PdfPTable tHeader = new PdfPTable(1);

    tHeader.setTotalWidth(550);
    tHeader.setLockedWidth(true);

    PdfPCell cell2 = new PdfPCell(image,false);

    cell2.setHorizontalAlignment(Element.ALIGN_RIGHT);
    cell2.setVerticalAlignment(Element.ALIGN_TOP);

    tHeader.addCell(cell2);


    But when it displayed on pdf, it does not show the exact size of image. The image size becomes larger. Any suggessions on this ?

    Thanks,
    Shah.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Moderator
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    10,094
    Rep Power
    17

    Default Re: Image Size in PDF

    1. It's considered bad manners to ask a new question without bothering to reply to responses on an earlier thread.
    Jar File Creation

    2. BB Code List - Java Programming Forum

    db
    Why do they call it rush hour when nothing moves? - Robin Williams

Similar Threads

  1. Setting frame size to the size of an image
    By Yoruichi in forum AWT / Swing
    Replies: 5
    Last Post: 04-22-2009, 04:37 PM
  2. Image size in java
    By Sharath in forum New To Java
    Replies: 1
    Last Post: 04-01-2009, 01:06 PM
  3. Image size in a JFrame
    By nickbeacroft in forum AWT / Swing
    Replies: 2
    Last Post: 06-26-2008, 04:08 PM
  4. How to get Image size in Java
    By Java Tip in forum java.awt
    Replies: 0
    Last Post: 06-23-2008, 11:23 PM
  5. how to set an image size
    By valery in forum New To Java
    Replies: 1
    Last Post: 08-06-2007, 08:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •