Jump to content
Changes to the Jaspersoft community edition download ×

PDF Metadata through iReport


Gaizka

Recommended Posts

Hi! Is it possible to set a property of the PDF file generated directly from iReport? I found some generic properties for pdf, but nothing seems to be good

I need, for example, to set the author of a PDF file craeted through iReport and exported in PDF format.

Any help is appreciated!

Thanks,

Gaizka

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Hi Gaizka, 

Not sure how it works because I've never used it but it seems that this is what you want: 

http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/export/JRPdfExporterParameter.html#METADATA_AUTHOR

Maybe you can directly set the property and its value in iReport: net.sf.jasperreports.engine.export.JRPdfExporterParameter.METADATA_AUTHOR

There is a similar property METADATA_CREATOR. I really don't know which one is the difference between them but maybe you can use any of them to achieve what you want. 

Hope this help. 

Regards,

Aitor

Link to comment
Share on other sites

Hi Gaizka,

 

I've tried to set it through iReport but didn't work for me. Im my case, as I export the reports through java, I have a exporter method, to which I have added the both properties mentioned in the previous post:

 

public void ExpToPdf (String Nam, List JasLst)

/************************************************************************************************/

 

{

try{

JRPdfExporter PdfExporter = new JRPdfExporter ();

PdfExporter.setParameter (JRExporterParameter.JASPER_PRINT_LIST, JasLst);

PdfExporter.setParameter (JRExporterParameter.OUTPUT_FILE_NAME, Nam);

PdfExporter.setParameter (JRPdfExporterParameter.METADATA_AUTHOR, "Aitor Ugarte");

PdfExporter.setParameter (JRPdfExporterParameter.METADATA_CREATOR,"Ugarte Aitor");

PdfExporter.exportReport ();

}

catch (Exception e){

e.printStackTrace();

}

}

 

This worked for me, don't know if it is a valid solution for you.

 

Hope this helps.

 

Regards,

Aitor

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