Skip to content

Conversation

BrandonNoad
Copy link

When using docsplit images to split a pdf into a series of images (e.g. foo.pdf --> foo_1.jpg, foo_2.jpg, ...), the user may want the ability to specify the page number delimiter. For example, instead of always using an underscore ('_'), the user may want to use a dash ('-') or something more complicated (e.g. foo.pdf --> foo-page-1.pdf, foo-page-2, ...).

@@ -101,6 +101,9 @@ def parse_options
opts.on('-r', '--rolling', 'generate images from each previous image') do |r|
@options[:rolling] = true
end
opts.on('--delimiter [DELIMITER]', 'set page number delimiter (eg: _, -, -Page-...)') do |d|
@options[:delimiter] = d.tr('^','')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to have your delimiter start with a dash, you need to escape it with the '^' character. So, we need to strip the '^' before passing it to @options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant