A-PDF :: Affordable PDF Tools

Is there a way to reverse the author name and put a comma bewteen the two parts?

Return KB main page

Question

I have 100 PDF files whose "Author" metadata is in the "normal" name form such as "Iain Banks". I would like to change/rename this metadata so that the author name becomes the form "Banks, Iain". Is there a way in A-PDF to "reverse" the author name and put a comma after the surname as in my example?

Solution

You can use script below in A-PDF Rename (free download here) to reverse the author name easily, with comma added:

1. Import your PDF file into A-PDF Rename, Write below script in "Advanced" window:

Var
first,last:string;
p:integer;
Begin
author:=trim(author);
p:=length(author)-pos(' ',reversestring(author))+1;
first:=leftstr(author,p-1);
last:=rightstr(author,length(author)-p);
newauthor:=last+','+first;
End.

2. Run the script and you will get you wanted result, and change the author at last.

You can also rename your PDF files in this way, justfree download A-PDF Rename to have a try now!

Related products

We always like improving our products based on your suggestions. Please send your feedback (or ask questions) to us in the contact page.

Return KB main page