# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals

import lib.sys

def cut(source, dest, start, end):
	lib.sys.call([
		"pdftk",
		"A=%s" % source,
		"cat",
		"A%d-%d" % (start, end),
		"output",
		dest
	], stddefault = None)


def burst(source):
	lib.sys.call([
		"pdftk",
		source,
		"burst"
	], stddefault = None)

def svg(source):
	lib.sys.call([
		"pdftocairo",
		"-svg",
		source
	], stddefault = None)

@@ -124,17 +124,19 @@
 %0Adef cut
-(
+ ( 
 source, 
@@ -151,17 +151,19 @@
 art, end
-)
+ ) 
 :%0A%09lib.s
@@ -291,25 +291,39 @@
 ef burst
-(
+ ( 
 source
-):
+, *others ) :%0A
 %0A%09lib.sy
@@ -321,32 +321,33 @@
 %0A%0A%09lib.sys.call(
+ 
 %5B%0A%09%09%22pdftk%22,%0A%09%09s
@@ -388,27 +388,75 @@
 None
+ )%0A%0A%09if others : burst( *others 
 )%0A%0A
+%0A
 def svg
-(
+ ( 
 source
-):
+, *others ) :%0A%09
 %0A%09li
@@ -458,32 +458,33 @@
 %09%0A%09lib.sys.call(
+ 
 %5B%0A%09%09%22pdftocairo%22
@@ -505,30 +505,60 @@
 source%0A%09%5D, stddefault = None
+ )%0A%0A%09if others : svg( *others 
 )%0A

allow multiple sources for pdf.burst and pdf.svg