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 512963
In Process

The Archive Base Latest Questions

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

We have embedded JasperReports into our application to generate reports, but I’ve been rather

  • 0

We have embedded JasperReports into our application to generate reports, but I’ve been rather dissatisfied with the way that the JEditorPaneHtmlMarkupProcessor handles writing arbitrary XHTML. For example, I needed to output a bulleted list at one point, which it does, but because it converts it to actual bullet characters and newlines, a bullet with fairly long text results in the text wrapping to align with the bullet, not with the first letter of the text.

Because of this and similar problems, I thought I might try rendering XHTML content as a graphic (using the flyingsaucer XHTML renderer). This gives me much better control over how it looks, but there’s still one problem. According to The Definitive Guide to JasperReports, “All positioning and sizing in JasperReports templates and generated documents is performed using the default Java resolution of 72 dpi.” It appears that the individual letters to be rendered are required to be positioned at integral coordinates. At 72 dpi, this is no big deal, since it amounts to sub-pixel positioning errors at worst, not of any significant consequence. However, when rendering to PDF, JasperReports blows it up to 300 dpi, resulting in the horizontal positions of some letters being off by multiple pixels at times.

Is there some way to get better rendering of arbitrary XHTML, or is there some way to make JasperReports perform its positioning and sizing at 300 dpi instead of 72?

  • 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-13T07:22:25+00:00Added an answer on May 13, 2026 at 7:22 am

    I ultimately solved this by using a renderer which did not insist on integral character positions: the JEditorPane from Swing:

    JEditorPane pane = new JEditorPane();
    pane.setBorder(null);
    pane.setSize(w, h);
    pane.setContentType("text/html");
    pane.setEditable(false);
    pane.setText(html);
    pane.paint(g2);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application I have an embedded MSHTML control. The problem is that I
I have an embedded Ethernet interface (Lantronix XPort) that responds to a UDP broadcast
I have an embedded application running httpd for a web server. On the main
I have use embedded code to assign the value to label's text property.But the
I am creating an Android application which will have some embedded music inside of
I am developing a publishing portal in SharePoint. I have embedded a video in
I have here embedded device with linux. There is a webserver boa. http://www.boa.org/ I
I have an embedded system. What I would like for it to do when
Using django-tinymce I have successfully embedded TinyMCE in the Admin before. Embedding it in
I recently upgraded a Flex 3 project to Flex 4 MX Only and prior

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.