Rename file names with content

This Forum is for the use of End Users requiring help and assistance for Tracker Software's PDF-Tools.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Post Reply
biofunc
User
Posts: 13
Joined: Tue Mar 03, 2020 6:35 am

Rename file names with content

Post by biofunc »

Hello Tracker support,

I would like to rename the file name with text from the side content.

The function of creating bookmarks from the side content works very well.

Is there a way to use this function to rename the file name?

Or is it on the detour to create the bookmarks with the text from the side content and then use the bookmarks for the renaming of the file name?

best regards
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17765
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Rename file names with content

Post by Tracker Supp-Stefan »

Hello biofunc,

Please accept my apologies - but I can not 100% sure what you mean by "Side Content" so can you please send us an example (e.g. screenshots of the settings you use + the resulting file) so that we can get a better understanding of the workflow?

Kind regards,
Stefan
biofunc
User
Posts: 13
Joined: Tue Mar 03, 2020 6:35 am

Re: Rename file names with content

Post by biofunc »

Hallo Stefan,

sorry, with "Side Content" I meant "Page Text"

What works very well in PDF tools is "Generate Bookmarks from Page Text".
I am looking for a possibility "Generate FileName from Page Text".

Kind regards
biofunc
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6813
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: Rename file names with content

Post by Paul - Tracker Supp »

Hi biofunc,

there would be some real challenges to this.

For example, can you say what text exactly we must use from a doc with hundreds of pages and full of text? From first text-line on first page only? How many words from that line?

I think it may prove somewhat cumbersome to implement and with the best will in the world, I'm not sure how many would use it.
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
User avatar
Vladimir G - Tracker Dev
User
Posts: 40
Joined: Thu Nov 30, 2017 1:24 pm

Re: Rename file names with content

Post by Vladimir G - Tracker Dev »

Hello biofunc,

As Paul said, it could be really challenging task. But, depending on your situation, some of our action could be helpful.

First is 'Find by Regular Expression' action. You can find it in Tool Edit -> Actions Library(right pane) -> Find by Regular Expression. This action finds the first match between the text on the page and a regular expression. Using action's 'Value name' option you can use found text on 'Save Documents' action step.
The bad news is that 'Find by Regular Expression' action is designed as filtering action that means that document which text doesn't match a regural expression will be skipped for further processing

Second is 'Split/Merge Documents' action. It has split method 'Split by top bookmarks' and if you pass '%[Bookmark]' macro as value for 'Name for generated document(s)' option you will get document with the name of the bookmark.

Unfortunately, everything I have proposed has a very limited and not universal use. Maybe we could suggest you more conrete steps to solve your problem if you provide us some example.

Best regard,
Vladimir Goshko
Software Developer
Tracker Software Products
biofunc
User
Posts: 13
Joined: Tue Mar 03, 2020 6:35 am

Re: Rename file names with content

Post by biofunc »

Hello Vladimir,

I set the Split/Merge Documents' Action in the editor and it works very well - thanks!

I probably chose the wrong setting in the PDF tools because the file name does not fit there (see screenshoot). But it works very well in the editor and I can do it there.
2022-05-11 08_08_23-Einstellungen.png
There are about 4.800 individual pages that I want to rename. How many pages can I Merge in a run (32 GB RAM)?

I added a file with a few pages as an example.
"Generates Bookmarks from Page Text" I do with the Setting Font Size 30 and Tolerance 10. I hope that most files work. Better and safer would probably be a rule to always take the text with the greatest Front sizes.

Thank you for the great and quick support and the proposed solution!
Traueranzeigen.pdf
(580.77 KiB) Downloaded 50 times
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6813
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: Rename file names with content

Post by Paul - Tracker Supp »

Hi biofunc,
How many pages can I Merge in a run (32 GB RAM)?
I believe this will be dependent on the page content.
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
User avatar
Vladimir G - Tracker Dev
User
Posts: 40
Joined: Thu Nov 30, 2017 1:24 pm

Re: Rename file names with content

Post by Vladimir G - Tracker Dev »

Hello, biofunc
How many pages can I Merge in a run (32 GB RAM)?
As Paul said, it depends on documents which you are going to process. Anyway, if you run into any problems, you can turn off 'Batch processing mode' option until separate processing is expected (I mean that you don't want to merge all documents to one or merge documents in other more tricky way). When 'Batch processing mode' option is turned off, every input document will be processed by all actions from from beginning to end and only after that the next document processing will be started.
Screenshot.png
I added a file with a few pages as an example.
Based on file, I can suggest you tool that partially do operation that you need.
Screenshot_1.png
Please, pay attention on 'Split/Merge Documents' action's options. It will get every top level bookmark, create document with pages between top bookmarks (1 page in your case), set documents' names as bookmark name, save documents with that name.
But I couldn't say that this tool completely performs task you needed. The problem is that sometimes you could get two top level bookmarks for one page. It happens when text that matches 'Generate text from bookmarks' criteria is splitted somehow, e.g. text is placed on different rows or splitted by another text that doesn't match criteria. You have such case in the example document where first name and last name are placed on different rows.

Unfortunately, we have no perfect solution for you. We will keep in mind your needs while developing new features, but I couldn't say when exactly the feature that can help you will appear in PDF-Tools.

I hope that suggested tool will help you at least will reduce the amount of work for you.

I've also attached PDF-Tools tool export ZIP with suggested tool.

Best regards
Attachments
Name files with bookmarks name.zip
(1.89 KiB) Downloaded 46 times
Vladimir Goshko
Software Developer
Tracker Software Products
Post Reply