How to set properties for PDF files which contain split characters in names?
Question
I am trying out A-PDF Rename to batch-process a large number of files from our book library, the current filename format is "Author name and surname - Book title.pdf". The file properties I am aiming to are:
[filename] = [filename],
[metadata Title] = the filename part AFTER the "-",
[metadata Author] = the filename part BEFORE the "-".
How can I write script to get the properties changed correctly?
Solution
While adding properties with A-PDF Rename(free download here), you can use below script to get the properties changed correctly based on your request:
Var
p :Integer;
Begin
p := Pos(ReverseString('-'), ReverseString(Filename));
if p > 0 then
newtitle := RightStr(Filename, p - 1);
p := Pos('-', Filename);
if p > 0 then
newauthor := LeftStr(Filename, p - 1);
End.
After inputting, click "Run" and you will get result previewed in the program, as below image shows:
Related products
- A-PDF Text Replace - batch replace, change or delete multiples text in Acrobat PDF files automatically
- A-PDF Preview and Rename - Preview PDF content easily, rename PDF based on content you previewed.
We always like improving our products based on your suggestions. Please send your feedback (or ask questions) to us in the contact page.