Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to access to the fields/data of a pdf birt report
Laurent240
Hi,
I generated a PDF report file with BIRT and I would like to know how can I access to the fields of that report (with an other program) and fetch the value of these fields ?
Thanks.
Regards,
Laurent
Find more posts tagged with
Comments
kclark
I haven't tried this but iText might work for you. You can create some java code to read the fields in a PDF with some code like this.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
PdfReader reader = new PdfReader("your_file.pdf");
AcroFields fields = reader.getAcroFields();
System.out.println("Value of Employee_ID:
"+fields.getField("Employee_ID"));</pre>
Laurent240
Yes but the fields of my reports are not 'editable fields' but simply labels or dynamic data.
Is there a possibility to use iText for these kind of fields ? Thanks.
kclark
Do the fields you want to read from have a fixed length of a max length? You could read the PDF to a string and then find the index of the field you're wanting + the length of the data. Depending on how many fields you have this could work for you. How many fields are you trying to access?