benu Posted September 28, 2013 Share Posted September 28, 2013 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 reportAdd a Text Field elementSet 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 squareNow, 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 ServerRun 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 More sharing options...
astrid.guenther Posted September 28, 2013 Share Posted September 28, 2013 I am very new here but I try an idea: You can change the encoding used for exporting here: Options | Export Options | Common. But I am sure you know this.Did you use the properties pdfFontName, isPdfEmbedded and pdfEncoding in your textfield? Link to comment Share on other sites More sharing options...
benu Posted September 30, 2013 Author Share Posted September 30, 2013 Hi Astrid. Thanks for your suggestions. I've tried isPdfEmbedded - no luck. The other two properties are deprecated, so I've not tried them. So, it's still not working for me, but thanks for your response! Ben Link to comment Share on other sites More sharing options...
vn Posted October 7, 2013 Share Posted October 7, 2013 Benu,I am facing with the same issue where I need to display square root in my PDF, did you get yours to work? If so, can you please share with us?Thanks,vn Link to comment Share on other sites More sharing options...
benu Posted October 7, 2013 Author Share Posted October 7, 2013 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 More sharing options...
tchen Posted October 24, 2013 Share Posted October 24, 2013 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 More sharing options...
benu Posted October 31, 2013 Author Share Posted October 31, 2013 This worked great - all I had to do was set fontName="DejaVu Sans". Good article here, too: http://www.tutorialspoint.com/jasper_reports/jasper_report_fonts.htm Thanks Tom! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now