Click here to Skip to main content
15,867,756 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
If I do not have Acrobat reader but need to see where the meta data values is it seems that according to all the questions etc answers there would be a meta data tab where in one can see the tags and there placeholder values.

The question I have is if that is not the case, does anybody have any idea where I can get these values from and see where they are so that in C# I can populate the correct fields with the itext# setField method.

I have tried to google it and even tried to inject a javascript into adobe reader to show these values but no luck so far...

If anyone has a way to work around this it would be deeply appreciated

Thanks
Posted
Comments
Kornfeld Eliyahu Peter 23-Jun-14 4:20am    
Did your read ALL this? http://en.wikipedia.org/wiki/Extensible_Metadata_Platform
CBadger 23-Jun-14 4:28am    
I have not no, thanks for the link. I will read through and see if I might come up for a solution in the process :)
Kornfeld Eliyahu Peter 23-Jun-14 4:31am    
It provides an explanation of XMP and some links to free/commercial softwares to read/write XMP data...
Do you want me to find you an open-source project for that :-)...
CBadger 23-Jun-14 4:50am    
DO you know of one? Because I would love that, there is no need for me to go and buy a legal acrobat reader just for this project anyway :-)
Kornfeld Eliyahu Peter 23-Jun-14 5:06am    
Open source found only Java or Perl - that may be a bit problem...However, not open source, but probably the best you can get is http://www.adobe.com/devnet/xmp.html

1 solution

I found a solution for this if anyone else was wondering.

All I did is get all the dictionary keyvalues and using IText I just populated the values with their names.

C#
// pdfTemplate is the string value of the pdf template
PdfReader pdfReader = new PdfReader(pdfTemplate);
// newFile is where the newly created pdf would be
PdfStamper pdfStamper = new PdfStamper(pdfReader, new FileStream(newFile, FileMode.Create));;
AcroFields pdfFormFields = pdfStamper.AcroFields;

// See all values
foreach (KeyValuePair<string, AcroFields.Item> item in pdfFormFields.Fields)
{
   pdfFormFields.SetField(item.Key, item.Key);
}
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900