#!/bin/bash
# doc/tool/pdf2svg - PDF to SVG utility support

set -e


######
# Native Dependencies

doc_tool_pdf2svg_client_packages=( pdf2svg )


######
# Library Configuration

doc_tool_pdf2svg_config_init() {
	lib_setting_vars --null pdf2svg_selector
}


######
# doc/tool/pdf2svg CLI

pdf2svg_dispatch() { lib_cmd_dispatch pdf2svg "$@"; }

pdf2svg_usage() {
	cat <<USAGE
...
Commands
	one <pdf> [<svg>]		Saves first page of <in> 
	page <n> <pdf> [<svg>]		Converts page <n> in <pdf> to <svg>
	all <pdf> <svg>			Converts all pages from <pdf> to
					files specfied by <svg> format string
					(e.g. 'output-%04.svg').
USAGE
}


######
# Public Interface

pdf2svg_run() {
	has_args 2 "$@"
	run pdf2svg "$1" "$2" $pdf2svg_selector
}

pdf2svg_one() { pdf2svg_run "$1" "${2:-${1%.pdf}.svg}"; }
pdf2svg_page()  { pdf2svg_selector=$1 pdf2svg_one "$2" "$3"; }
pdf2svg_all()  { pdf2svg_selector=all pdf2svg_run "$@"; }

View the Developer Guide Index

View the Reference Manual Index


Generated on Fri Jul 28 14:35:41 PDT 2017 by mcsh d14 v0.23.0.