1
0
mirror of https://github.com/ciromattia/kcc synced 2026-01-06 05:19:39 +00:00

Fixed PDF queue (close #73)

This commit is contained in:
Paweł Jastrzębski
2013-12-28 08:30:37 +01:00
parent 22b7258aa3
commit 29f901f92a

View File

@@ -24,13 +24,16 @@ __copyright__ = '2012-2013, Ciro Mattia Gonano <ciromattia@gmail.com>, Pawel Jas
__docformat__ = 'restructuredtext en'
import os
from random import choice
from string import ascii_uppercase, digits
class PdfJpgExtract:
def __init__(self, origFileName):
self.origFileName = origFileName
self.filename = os.path.splitext(origFileName)
self.path = self.filename[0] + "-KCC-TMP"
# noinspection PyUnusedLocal
self.path = self.filename[0] + "-KCC-TMP-" + ''.join(choice(ascii_uppercase + digits) for x in range(3))
def getPath(self):
return self.path
@@ -63,7 +66,6 @@ class PdfJpgExtract:
istart += startfix
iend += endfix
print "JPG %d from %d to %d" % (njpg, istart, iend)
jpg = pdf[istart:iend]
jpgfile = file(self.path + "/jpg%d.jpg" % njpg, "wb")
jpgfile.write(jpg)