Jump to content
Changes to the Jaspersoft community edition download ×

Export to PDF not displaying extended ASCII characters


benu

Recommended Posts

I'm using some extended ASCII characters in a few reports, but sadly, they fail to show up in my PDF exports. Here's the scoop, and how to reproduce:

  • Use the latest iReport (v5.1.0 at time of writing)
  • Start a blank report
  • Add a Text Field element
  • Set the Text Expression to "▪" (this is the small square, like this: ▪ . Hey - I can paste it in here from a succesful print-to-PDF!)
  • Set the Markup property to "HTML"
  • Preview the report - you should get a small black square

Now, save the report to a PDF doc. Open it - NO black square.
Try printing from iReport to a PDF print driver (e.g. CutePDF). Open the PDF - voila! Small black square.

Now, try adding the report to Jasper Reports Server
Run the report - the viewer will show you the square.
Try  exporting the report to PDF - no-go, we still don't get a small black square.

Try exporting the report to DOCX - works! Good, but I still need a PDF.
 
I'm mystified, and there's no joy in Internet searches for solutions.
 
BTW, I'm using the Calibri font, which I've added in as a font extension to both iReport, and also packaged up as a resource for this particular report on JRS. Still no luck. And, obviously, it does work, just doesn't export to PDF properly. The built-in Sans Serif font shipped with iReport doesn't work either.
 
Anyone have any ideas?



 

 

 

 

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Hi vn. No, I did not get this to work. I'm pursuing a support incident to get this resolved, as this is a requirement for our organization. I'll post the solution once we get it figured out. Regards, Ben
Link to comment
Share on other sites

  • 3 weeks later...

Please use "DejaVu Sans" as pdf Font Name and "Identity-H" as pdfEncoding. This should work:

 

                <textElement textAlignment="Center" verticalAlignment="Middle" markup="html">
                    <font fontName="DejaVu Sans" size="11" pdfFontName="DejaVu Sans" pdfEncoding="Identity-H" isPdfEmbedded="true"/>
                </textElement>
                <textFieldExpression><![CDATA["☐"]]></textFieldExpression>

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