Jump to content
Changes to the Jaspersoft community edition download ×

pfd image dimensions


2004 IR Help

Recommended Posts

By: MikieT1 - mikiet1

pfd image dimensions

2005-05-10 06:37

Hi, I am putting images of maps into pdf reports, it is therefore important that I get the size of the image correct for scale reasons, when I produce the report in html the image comes out exactly the size I specified in the JRXML width and height fields, however when I run the report as a pdf the images is coming out larger, can anyone help with this please

 

 

 

 

By: MikieT1 - mikiet1

RE: pfd image dimensions

2005-05-10 08:09

Assuming it is not possible to use the height and width fields as pixel values on a pdf doc, can someone give me a formula to apply to the Width and Height pixel values of an image in Microsoft Photo editor to make the Width and height in cm on the printed pdf doc the same as photo editor says they should be (the way it does with html reports)

 

 

 

 

By: Denny Valliant - xenden

RE: pfd image dimensions

2005-05-10 12:15

You may want to check the DPI of the image. PDF is pretty printer oriented, so it pays attn. to the DPI of an image.

 

You should be able to set this[DPI] via photoshop, maybe photo editor as well. Anyway, most printers print around 300 dpi, I believe.

 

At least my hp laserjest is set at 300. Dot matrix/etc. are probably different ;-) Epson inkjet really gets up there.

 

Mostly just remembering what someone else posted, don't know if it worked or not. Please let us know if changing the DPI fixes your problem.

 

Good Luck, HTH!

 

 

 

 

By: MikieT1 - mikiet1

RE: pfd image dimensions

2005-05-11 02:25

I have noticed that altereing the page width and height in the jasperReport element causes all text and image size to be changed to fit page, i.e. if I increase the page size all images and text gets smaller, and vice versa, can anyone tell me if there is a set size for printing A4 pages in PDF reports, or would it differ from printer to printer ?, currently my width is 595 and my Height 842, and everything is printing slightly larger then expected

 

 

 

 

By: Denny Valliant - xenden

RE: pfd image dimensions

2005-05-11 03:00

is the little checkbox in adobe's print dialog "fit to page" or whatever un-checked?

 

I had these paper air-plane PDF's that just wouldn't print quite right. Was the aforementioned problem (30 mins later, 3rd person to try- ding- lightbulb! ;).

 

Eh. Go figure. =-)

 

Hope this is it!

 

 

 

 

By: MikieT1 - mikiet1

RE: pfd image dimensions

2005-05-11 05:50

No luck changing the options in adobe, the images still appear larger then they should. As far as I can tell I am going to have to calcalate the size of the image on the pfd, and dynamically change the maps scale depending on what reporting function they use. If anyone has a pxl to actual size ratio for a pdf for a document with a width of 595 and Height 842 I would be most greatful !.

Link to comment
Share on other sites

  • 3 years later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

this works:

Code:
			BufferedImage img = ImageIO.read(new File(wo_image_path));			height = img.getHeight();			width = img.getWidth();						jasperSubDesign = JasperManager.loadXmlDesign(context.getRealPath("/WEB-INF/reports/decoration_sheet_header.jrxml"));			JRDesignImage image = (JRDesignImage)jasperSubDesign.getPageHeader().getElementByKey("wo_image");			image.setX(3);			image.setY(69);			image.setHeight(new Long(height - Math.round(height*.35)).intValue());			image.setWidth(new Long(width - Math.round(width*.35)).intValue());			JasperCompileManager.compileReportToFile(jasperSubDesign, context.getRealPath("/WEB-INF/reports/decoration_sheet_header.jasper"));
Link to comment
Share on other sites

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...