Jump to content
We've recently updated our Privacy Statement, available here ×

Images rendered 4/3 larger than reality


2006 IR Open Dicussion

Recommended Posts

By: fancellu - fancellu

Images rendered 4/3 larger than reality

2006-03-04 05:02

iReports 1.2.0

 

I have a report with an image, set to RetainShape.

 

However when I render to JRViewer or PDF the images look exactly 4/3 larger, and hence jaggy.

 

Why is this?

 

I can replicate this by creating a new document, plopping in an image, setting to retain shape and setting the size, i.e. very very simply.

 

Here is the xml of the report

 

<?xml version="1.0" encoding="UTF-8" ?>

<!-- Created with iReport - A designer for JasperReports -->

<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

<jasperReport

name="untitled_report_1"

columnCount="1"

printOrder="Vertical"

orientation="Portrait"

pageWidth="595"

pageHeight="842"

columnWidth="535"

columnSpacing="0"

leftMargin="30"

rightMargin="30"

topMargin="20"

bottomMargin="20"

whenNoDataType="NoPages"

isTitleNewPage="false"

isSummaryNewPage="false">

<property name="ireport.scriptlethandling" value="2" />

<property name="ireport.encoding" value="UTF-8" />

<import value="java.util.*" />

<import value="net.sf.jasperreports.engine.*" />

<import value="net.sf.jasperreports.engine.data.*" />

 

 

<background>

<band height="0" isSplitAllowed="true" >

</band>

</background>

<title>

<band height="50" isSplitAllowed="true" >

</band>

</title>

<pageHeader>

<band height="50" isSplitAllowed="true" >

</band>

</pageHeader>

<columnHeader>

<band height="30" isSplitAllowed="true" >

</band>

</columnHeader>

<detail>

<band height="100" isSplitAllowed="true" >

<image scaleImage="RetainShape" vAlign="Top" hAlign="Left" isUsingCache="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >

<reportElement

mode="Opaque"

x="49"

y="13"

width="463"

height="43"

forecolor="#000000"

backcolor="#FFFFFF"

key="image-1"

stretchType="NoStretch"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>

<graphicElement stretchType="NoStretch" pen="None" fill="Solid"

/>

<imageExpression class="java.lang.String"><![CDATA["gfx\trialserve_predictor.gif"]]></imageExpression>

</image>

</band>

</detail>

<columnFooter>

<band height="30" isSplitAllowed="true" >

</band>

</columnFooter>

<pageFooter>

<band height="50" isSplitAllowed="true" >

</band>

</pageFooter>

<lastPageFooter>

<band height="50" isSplitAllowed="true" >

</band>

</lastPageFooter>

<summary>

<band height="50" isSplitAllowed="true" >

</band>

</summary>

</jasperReport>

 

 

 

 

By: fancellu - fancellu

RE: Images rendered 4/3 larger than reality

2006-03-04 05:25

I told ireports that the image was 75% smaller than it actually is, and now it looks good!

 

Where does this weirdness come from?

Link to comment
Share on other sites

  • 2 months later...
  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Hi!

 

I have the same problem with my images. I have to insert a logo in my reports and they appear at 4/3 of their real size too!

You can see this effect in the image examples of jasper:

http://jasperreports.sourceforge.net/samples/ImagesReport.html

the real image:http://jasperreports.sourceforge.net/jasperreports.png

 

I tried the solution you chose, putting them at 3/4 of the size just to make them have their real size inside the reports (4/3*3/4 = 1 ;)).

 

BUT! with this approach, the logo is out of focus! Haven´t you noticed this? Anyone can help me with this? The logo is not well shown, and the client is complaining!

 

Thanks in advance for all your help!

Link to comment
Share on other sites

Hi!

 

thansk for the reply, but that is not the answer.

 

If you take a look at the example:

 

http://jasperreports.sourceforge.net/samples/ImagesReport.html

 

you will notice it is this code:

Code:
<image scaleImage="Clip" onErrorType="Icon" isLazy="true"><reportElement x="0" y="0" width="150" height="40"/><imageExpression class="java.lang.String">"http://jasperreports.sourceforge.net/jasperreports.png"</imageExpression></image>

 

It is already "Clip", but the size is not the real one of the image, but 4/3 of it.

 

I think this may be a bug, but I have not found anyone with this problem but this post!

 

Don´t you use images in your reports?

 

Thanks again.

Link to comment
Share on other sites

  • 9 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...