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

  • SEARCH
  • Home
  • 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

Ask A Question

Stats

  • Questions 265k
  • Answers 265k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer First of all, you have named variables employees and holidays,… May 13, 2026 at 12:27 pm
  • Editorial Team
    Editorial Team added an answer Update for Django 1.9 The django.db.backends.postgresql_psycopg2 backend has been renamed… May 13, 2026 at 12:27 pm
  • Editorial Team
    Editorial Team added an answer I would not combine the two per se; calls into… May 13, 2026 at 12:27 pm

Related Questions

We have a large enterprise consisting of many apps both old and new backed
Within our Active Directory domain, we have a MS SQL 2005 server, and a
We have an embedded device that needs to interact with an enterprise software system.
We have an embedded linux product with an application which lets the user change
I want to embed Javascript in a hobby game engine of mine. Now that

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.