pdfsam icon indicating copy to clipboard operation
pdfsam copied to clipboard

don't add [BASENAME] always to filename

Open DJCrashdummy opened this issue 5 years ago • 5 comments

e.g. when extracting some pages from a PDF, you can choose a filename prefix via "Generated PDF documents name prefix":
File names settings

so far, so good... but it does not make sense to me why not make this field "Generated PDF documents name" because prefix is not 100% accurate as soon as you use [BASENAME] in this field. and adding [BASENAME] nevertheless, if you didn't specify it (or any other keyword) is IMHO a bug anyways.

with this the naming of PDFsam will get more flexible & powerful (i have original files which basename is complete gibberish - and having to rename each file after operating with PDFsam is tedious). and prefilling this field with PDFsam_[BASENAME] will result in the exact same default and perhaps get more attention to the keywords (not to mention that things like #286 will be avoided).

DJCrashdummy avatar Apr 01 '19 06:04 DJCrashdummy

The name prefix is indeed not 100% accurate. This field act as a prefix in case of a plain string but it acts as a sort of file name template in case you use keywords ensuring unique names (like [TIMESTAMP] etc). That said I don't think I'm fully understanding what you are suggesting, to change the field name?

torakiki avatar Apr 25 '19 08:04 torakiki

well, kind of...

  • [ ] i also suggest to change the field name to be more accurate...
  • [ ] but 1000 times more important, i suggest to change the behaviour: simply strip it down to a name field with template function (no matter what keyword or not is in that field)! this will also make it much easier to understand how it works, without all the ifs and whens.

i'm aware that this may cause collisions, if more than one file is created and no keyword like [TIMESTAMP] etc. to distinguish them is entered. no idea how this is handled now when i just use [BASENAME] and no other keyword, but well... in this case i would simply number the files like it is done by every file manager and perhaps with a little hint before processing (see below) PDFsam will still get easier to understand, more flexible, every possible scenario is covered and everyone is happy. :wink: (beside that, the hint will get more attention to the keywords and its possibilities.)

"more than one file will be created, but you haven't used a keyword to make their names unique. so they will be numbered to prevent just getting one (the last) file." -> "cancel" | "proceed"

DJCrashdummy avatar Jun 15 '19 13:06 DJCrashdummy

well... an example to make it even more clear: if i have to extract some pages (one by one) from a bigger pdf whose name is completely random (but i can't change it), it is pretty annoying having to remove the automatically added _[BASENAME] to the carefully chosen and entered name of every new file created!

the solution would be to keep it pretty simple: no prefix, no ifs and whens for the name, just a simple name field and some variables to place wherever the user needs some (and just then)!

DJCrashdummy avatar Jun 28 '19 12:06 DJCrashdummy

As an aside, this is discussing the "prefix". I will raise a separate issue. Just in case it affects this issue: it would be more useful to me to have a "suffix".

aazbelfast avatar May 20 '20 01:05 aazbelfast

You sound like the kind of guy who would know (probably better than me) so for anyone else having a similar problem (unless/until this issue is resolved in PDFsam), you can always use a Bulk Rename Utility e.g. the one from TGRMN. Hope this helps someone.

aazbelfast avatar May 23 '20 14:05 aazbelfast