Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 507615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:49:22+00:00 2026-05-13T06:49:22+00:00

I am trying to fix the height and width of image in pdf generated

  • 0

I am trying to fix the height and width of image in pdf generated using fop 0.95.
Here is the code used for it

<fo:external-graphic src="s\image.png" height="2.00in" width="2.00in"/>

Following also does not work

<fo:external-graphic src="s\image.png"  content-height="scale-to-fit" height="2.00in"  content-width="2.00in"/>

These gives us the image that is governed by width .
In summary I am trying to stretch the image rather than keeping the aspect ratio using fop 0.95.Does any one have idea for it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:49:22+00:00Added an answer on May 13, 2026 at 6:49 am

    These gives us the image that is
    governed by width . In summary I am
    trying to stretch the image rather
    than keeping the aspect ratio using
    fop 0.95.

    By default fop keeps the aspect ratio regardless of the image height and width specified. This means fop does uniform scaling by default.

    To have rather stretched image according to your specification, you should use non-uniform scaling. This way:

    <fo:external-graphic src="s\image.png"  content-height="scale-to-fit" height="2.00in"  content-width="2.00in" scaling="non-uniform"/>
    

    This will display your image.png image with height 2.00in and width 2.00in.

    Hope this helps. Thank you,

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to resize an image based off of a max-width/max-height array. Here's
I am trying to fix height for HTML table row. Below is the code
I'm trying to fix single quote bug in the code: std::string Index; connection->Open(); String^
I'm trying to fix something in some Objective C++ (?!) code. I don't know
I am trying to fix a regular expression i have been using in php
Have been trying to fix this problem I have here. Basically I have a
I'm trying to BOTTOM align an image in a fixed-height block: div { float:
I'm trying to do some image processing on iPhone. I'm using http://developer.apple.com/library/ios/#qa/qa2010/qa1702.html to capture
I am seeking help with trying to fix my background image fill issue. I
I'm trying to fix an image to the bottom of the document for a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.