Print Page | Close Window

Remove Punctuation

Printed From: Foxit's Planet PDF Forum
Category: Lets Talk PDF
Forum Name: JavaScript
Forum Description: Discussions relating to the use of JavaScript within PDF.
Printed Date: 22 Oct 2019 at 12:41pm
Software Version: Web Wiz Forums 11.10 -

Topic: Remove Punctuation
Posted By: 281Blue
Subject: Remove Punctuation
Date Posted: 30 Oct 2014 at 1:53pm

i'm new to pdf scripting and was wondering if someone could help me out, please.

I made a form that has a field for the first name and a field for the last name. 

I would like to combine the data from those two fields into a third field, called "file name", which will denote how the ID photo file should be named. 

In the combination process, certain filters need to be applied to each field. In the end, the file name is the first initial, plus the last name. 

The issue is dealing with punctuation, suffixes and hyphenated last names.

Some Examples:

First: John 
Last: Doe
File: jdoe

First: John
Last: Doe Jr.
File: jdoe
* Removes suffix and punctuation

First: John
Last: Doe II
File: jdoe
* Removes suffix

First: John
Last: Doe-Ray
File: jray
*Uses the absolute last name in hyphenated names

First: John
Last: La Ti Do
File: jlatido
*In multi-word last names, spaces are removed

First: John
Last O'Doe
File: jodoe
*Removes punctuation from last name

Thanks for the help.


Posted By: aandi
Date Posted: 30 Oct 2014 at 2:12pm
It's a pretty big job. What do you have so far?

Posted By: 281Blue
Date Posted: 30 Oct 2014 at 2:39pm
So far, nothing. Just getting started. Debating if I should force a suffix field, but that does not address the absolute last name problem.

Posted By: try67
Date Posted: 30 Oct 2014 at 8:49pm
As mentioned, this would require quite a complex, custom-made script.

If you're interested in someone creating it for you (for a fee), feel free to contact me privately.

- Acrobat Expert - Contact me personally at
Check out my custom-made scripts website:

Posted By: 281Blue
Date Posted: 30 Oct 2014 at 9:32pm
Thanks. I think we figured it out. Making some changes to the form, adding suffix fields and just running some simple removes. 

I appreciate your offer!

Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.10 -
Copyright ©2001-2017 Web Wiz Ltd. -