Jump to content
We've recently updated our Privacy Statement, available here ×

SOLVED: PDF/A embedded font problem


krls23

Recommended Posts

I have a problem with the PDF/A support of JasperReports 4.2.1.

I have folowed the example in the repository but, when I try to create the PDF/A, a blank file Is generated with no text inside. I have done the tests with both my report and the FirstJasper.jrxml in /demo/samples/jasper/reports, and the results is the same.

I think the problem is caused by the embedded font, because the generated PDF/A file, doesn't have any attached font file.

Could you help me in how to embed fonts in PDF?

Code:



Post Edited by krls23 at 10/17/2011 09:35



Post Edited by krls23 at 10/21/2011 11:58
Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Are you sure that it's not just an empty report because it doesn't have any data?  If Jasper can't find a font, it's smart about falling back on other system installed fonts.

Some things you can try to see if it's a missing font or no data problem:

1) Try a different export format other than pdf.  Is the report still coming up blank?  If so, try #2

2) Add a no-data section to your report and put some text on it.  Did the report come up with the no-data section showing?

 

 

Link to comment
Share on other sites

Thanks for your replay.

I’m sure that report is not empty, because the same report generated with iReport 4.1.2 it’s good when export to PDF/A format.

The report is very simple, I have static-text with “Hello world!”.

The different between the PDF generated with iReport and the PDF generated with my code is the embedded font. IReport embedded font correctly and my code don’t embedded font.

I attached my report.

Could you help me, this is very important for  me.



Post Edited by krls23 at 10/19/2011 07:50
Link to comment
Share on other sites

fitxerPlantilla = new File(plantilla);

What is plantilla? Is that a JRprint file? I would really try to export it to a different format and see if you're still having problems. If you are, and still think it's font related, I would read the jasper embedded font howto http://jasperreports.sourceforge.net/sample.reference/fonts/index.html

First, though, I would look

at the QueryApp sample that comes with Jasper and write a few lines of standalone code to see if the problem is within the jasper engine that doesn't have embedded fonts.

 

 

 

Link to comment
Share on other sites

The report result is a blank page because you aren't using any datasource.

If you change the line:

       print = filler.fill(new HashMap())

by this one:

print = filler.fill(new HashMap(), new JREmptyDataSource());

It'll work.

Joan

 

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