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 Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,453
    Rep Power
    20

    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
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

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, 05:37 PM
  2. Image size in java
    By Sharath in forum New To Java
    Replies: 1
    Last Post: 04-01-2009, 02:06 PM
  3. Image size in a JFrame
    By nickbeacroft in forum AWT / Swing
    Replies: 2
    Last Post: 06-26-2008, 05:08 PM
  4. How to get Image size in Java
    By Java Tip in forum java.awt
    Replies: 0
    Last Post: 06-24-2008, 12:23 AM
  5. how to set an image size
    By valery in forum New To Java
    Replies: 1
    Last Post: 08-06-2007, 09: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
  •