gettalong / hexapdf

Versatile PDF creation and manipulation for Ruby
https://hexapdf.gettalong.org
Other
1.21k stars 69 forks source link

[Small proposal] Verbosity when splitting a .pdf file #228

Closed rubyFeedback closed 1 year ago

rubyFeedback commented 1 year ago

Hey there Thomas,

Today I had a use case to split a larger .pdf file into its individual files, then e. g. change some wrong ones (rotate them) and merge back.

When splitting I used this:

hexapdf split foobar.pdf # the .pdf had another name but you get the idea

This created all four smaller .pdf files. So far so good!

There was no output displayed what happened, though. I assume you probably want to keep the default behaviour righ tnow (makes it easier to redirect into a file via >> and what not), but perhaps there could be a verbosity mode or flag, if there is not one already?

Just as an example what I mean:

hexapdf split foobar.pdf --verbose

Would lead to:

"Generating foobar1.pdf."
"Generating foobar2.pdf."
"Generating foobar3.pdf."

And so forth. So via verbose mode we get hexapdf in general to display more information than normal (than its default right now that is).

If this already exists please ignore this request altogether. If not perhaps we could have a generic flag that is meant to tell hexapdf to provide more information than the default. It is no issue at all, I just did another "ls" on the terminal to see what was generated, so no real issue. But I also wondered it may be nice to also get hexapdf to display what it does, aka a more verbose way. Thank you for reading.

gettalong commented 1 year ago

Thanks for the input! I have implemented the necessary changes which will be part of the next release.