diff -r calibre-debian/src/calibre/ebooks/pdf//fonts.cpp calibre-ori/src/calibre/ebooks/pdf//fonts.cpp
3c3
<  * License: GNU GPL v3
---
>  * License: GNU GPL v2+
diff -r calibre-debian/src/calibre/ebooks/pdf//fonts.h calibre-ori/src/calibre/ebooks/pdf//fonts.h
3c3
<  * License: GNU GPL v3
---
>  * License: GNU GPL v2+
diff -r calibre-debian/src/calibre/ebooks/pdf//images.cpp calibre-ori/src/calibre/ebooks/pdf//images.cpp
0a1,7
> /**
>  * Copyright 2009 Kovid Goyal <kovid@kovidgoyal.net>
>  * License: GNU GPL v2+
>  */
> 
> 
> 
diff -r calibre-debian/src/calibre/ebooks/pdf//images.h calibre-ori/src/calibre/ebooks/pdf//images.h
0a1,7
> /**
>  * Copyright 2009 Kovid Goyal <kovid@kovidgoyal.net>
>  * License: GNU GPL v2+
>  */
> 
> 
> 
diff -r calibre-debian/src/calibre/ebooks/pdf//input.py calibre-ori/src/calibre/ebooks/pdf//input.py
25c25
<         OptionRecommendation(name='unwrap_factor', recommended_value=0.5,
---
>         OptionRecommendation(name='unwrap_factor', recommended_value=0.45,
28c28
<             'default is 0.5, this is the median line length.')),
---
>             'default is 0.45, just below the median line length.')),
diff -r calibre-debian/src/calibre/ebooks/pdf//links.cpp calibre-ori/src/calibre/ebooks/pdf//links.cpp
3c3
<  * License: GNU GPL v3
---
>  * License: GNU GPL v2+
diff -r calibre-debian/src/calibre/ebooks/pdf//links.h calibre-ori/src/calibre/ebooks/pdf//links.h
3c3
<  * License: GNU GPL v3
---
>  * License: GNU GPL v2+
diff -r calibre-debian/src/calibre/ebooks/pdf//main.cpp calibre-ori/src/calibre/ebooks/pdf//main.cpp
0a1,7
> /**
>  * Copyright 2009 Kovid Goyal <kovid@kovidgoyal.net>
>  * License: GNU GPL v2+
>  */
> 
> 
> 
diff -r calibre-debian/src/calibre/ebooks/pdf//output.py calibre-ori/src/calibre/ebooks/pdf//output.py
61a62,84
>         # Remove page-break-before on <body> element as it causes
>         # blank pages in PDF Output
>         from calibre.ebooks.oeb.base import OEB_STYLES, XPath
>         stylesheet = None
>         for item in self.oeb.manifest:
>             if item.media_type.lower() in OEB_STYLES:
>                 stylesheet = item
>                 break
>         if stylesheet is not None:
>             from cssutils.css import CSSRule
>             classes = set(['.calibre'])
>             for x in self.oeb.spine:
>                 root = x.data
>                 body = XPath('//h:body[@class]')(root)
>                 if body:
>                     classes.add('.'+body[0].get('class'))
> 
>             for rule in stylesheet.data.cssRules.rulesOfType(CSSRule.STYLE_RULE):
>                 if rule.selectorList.selectorText in classes:
>                     rule.style.removeProperty('page-break-before')
>                     rule.style.removeProperty('page-break-after')
> 
> 
80a104,105
>                         if not isinstance(self.cover_data, basestring):
>                             self.cover_data = None
diff -r calibre-debian/src/calibre/ebooks/pdf//pdftohtml.py calibre-ori/src/calibre/ebooks/pdf//pdftohtml.py
26,27c26,27
< if (islinux or isfreebsd) and getattr(sys, 'frozen_path', False):
<     PDFTOHTML = os.path.join(getattr(sys, 'frozen_path'), 'pdftohtml')
---
> if (islinux or isfreebsd) and getattr(sys, 'frozen', False):
>     PDFTOHTML = os.path.join(sys.executables_location, 'bin', 'pdftohtml')
diff -r calibre-debian/src/calibre/ebooks/pdf//reflow.cpp calibre-ori/src/calibre/ebooks/pdf//reflow.cpp
3c3
<  * License: GNU GPL v3
---
>  * License: GNU GPL v2+
622a623
>       default: break;
diff -r calibre-debian/src/calibre/ebooks/pdf//reflow.h calibre-ori/src/calibre/ebooks/pdf//reflow.h
3c3
<  * License: GNU GPL v3
---
>  * License: GNU GPL v2+
diff -r calibre-debian/src/calibre/ebooks/pdf//utils.h calibre-ori/src/calibre/ebooks/pdf//utils.h
3c3
<  * License: GNU GPL v3
---
>  * License: GNU GPL v2+
diff -r calibre-debian/src/calibre/ebooks/pdf//writer.py calibre-ori/src/calibre/ebooks/pdf//writer.py
28,31d27
< def get_pdf_printer():
<     return QPrinter(QPrinter.HighResolution)
< 
< 
45c41
< def setup_printer(opts, for_comic=False):
---
> def get_pdf_printer(opts, for_comic=False):
50c46
<     printer = get_pdf_printer()
---
>     printer = QPrinter(QPrinter.HighResolution)
64c60
<         printer.setPaperSize(QSizeF(float(w) / dpi, float(h)/dpi), QPrinter.Inch)
---
>         printer.setPaperSize(QSizeF(float(w) / dpi, float(h) / dpi), QPrinter.Inch)
66c62,68
<     printer.setPageMargins(0, 0, 0, 0, QPrinter.Point)
---
>     if for_comic:
>         # Comic pages typically have their own margins, or their background
>         # color is not white, in which case the margin looks bad
>         printer.setPageMargins(0, 0, 0, 0, QPrinter.Point)
>     else:
>         printer.setPageMargins(opts.margin_left, opts.margin_top,
>                 opts.margin_right, opts.margin_bottom, QPrinter.Point)
68a71
>     printer.setFullPage(True)
72c75
<     printer = setup_printer(opts, for_comic=for_comic)
---
>     printer = get_pdf_printer(opts, for_comic=for_comic)
157,169d159
<     def get_printer(self, set_horz_margins=False):
<         printer = get_pdf_printer()
<         printer.setPaperSize(QSizeF(self.size[0] * 10, self.size[1] * 10), QPrinter.Millimeter)
<         if set_horz_margins:
<             printer.setPageMargins(0., self.opts.margin_top, 0.,
<                     self.opts.margin_bottom, QPrinter.Point)
<         else:
<             printer.setPageMargins(0, 0, 0, 0, QPrinter.Point)
<         printer.setOrientation(orientation(self.opts.orientation))
<         printer.setOutputFormat(QPrinter.PdfFormat)
<         printer.setFullPage(not set_horz_margins)
<         return printer
< 
173,174c163,164
<             self.logger.debug('\tRendering item %s as %i' % (os.path.basename(str(self.view.url().toLocalFile())), len(self.combine_queue)))
<             printer = self.get_printer(set_horz_margins=True)
---
>             self.logger.debug('\tRendering item %s as %i.pdf' % (os.path.basename(str(self.view.url().toLocalFile())), len(self.combine_queue)))
>             printer = get_pdf_printer(self.opts)
188c178
<         printer = self.get_printer()
---
>         printer = get_pdf_printer(self.opts)
236,240c226
<         printer = get_pdf_printer()
<         printer.setPaperSize(QSizeF(self.size[0] * 10, self.size[1] * 10), QPrinter.Millimeter)
<         printer.setPageMargins(0, 0, 0, 0, QPrinter.Point)
<         printer.setOrientation(orientation(self.opts.orientation))
<         printer.setOutputFormat(QPrinter.PdfFormat)
---
>         printer = get_pdf_printer(self.opts, for_comic=True)
245d230
<         printer.setFullPage(True)
