Search for fields e.g [NAME] [TITLE] [*]

It seems that you should use ‘pdftron.PDF.TextSearch’ with a regular expression to match your fileds (i.e. [FOO] ) then use ‘pdftron.PDF.ContentReplacer’ to update fileds (i.e. replace placeholder names with values).

As a starting point, please see the corresponding sample projects:

TextSearch: http://www.pdftron.com/pdfnet/samplecode.html#TextSearch
ContentReplacer: http://www.pdftron.com/pdfnet/samplecode.html#ContentReplacer

The reg exp used to find variable text could be: [[A-z,0-9,-,_]++]. For example:

TextSearch.Mode mode = TextSearch.e_reg_expression | TextSearch::e_whole_word | TextSearch::e_ambient_string | TextSearch::e_highlight;

string pattern = “[[A-z,0-9,-,_]++]”;
txt_search.SetPattern(pattern);

text_search.Begin(mp_doc, pattern, mode, pg_num, pg_num);

On Sunday, December 2, 2012 2:35:07 PM UTC-8, Brettski wrote:

Hi,

My first post here so bear with me.

I want to be able to return a list of fields in a PDF, by fields I mean a string of text that matches this pattern ‘[ANY WORDS]’ i.e a open bracket, some wording and a close bracket.

I then which to use this with content replacer etc. So the idea is my user can upload a pdf with some fields and I can build a form so they can update.

Any thoughts on how to do this?

Many thanks,

Brett