mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
PDF Output: Fix 1 pixel wide left and top margins on the cover page for some PDF conversions due to incorrect rounding. Fixes #1162054 (ePub to PDF conversion regression)
This commit is contained in:
parent
5209b2fd29
commit
71a18a47aa
@ -7,7 +7,7 @@ __license__ = 'GPL v3'
|
||||
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
import sys, traceback
|
||||
import sys, traceback, math
|
||||
from collections import namedtuple
|
||||
from functools import wraps, partial
|
||||
from future_builtins import map
|
||||
@ -356,9 +356,9 @@ class PdfDevice(QPaintDevice): # {{{
|
||||
@property
|
||||
def full_page_rect(self):
|
||||
page_width = self.page_width * self.xdpi / 72.0
|
||||
lm = self.left_margin * self.xdpi / 72.0
|
||||
lm = int(math.ceil(self.left_margin * self.xdpi / 72.0))
|
||||
page_height = self.page_height * self.ydpi / 72.0
|
||||
tm = self.top_margin * self.ydpi / 72.0
|
||||
tm = int(math.ceil(self.top_margin * self.ydpi / 72.0))
|
||||
return (-lm, -tm, page_width, page_height)
|
||||
|
||||
@property
|
||||
|
Loading…
x
Reference in New Issue
Block a user