diff --git a/src/calibre/ebooks/pdf/writer.py b/src/calibre/ebooks/pdf/writer.py index a9cb951e35..76ab6b9096 100644 --- a/src/calibre/ebooks/pdf/writer.py +++ b/src/calibre/ebooks/pdf/writer.py @@ -27,10 +27,10 @@ def get_custom_size(opts): custom_size = None if opts.custom_size != None: width, sep, height = opts.custom_size.partition('x') - if height != '': + if height: try: - width = int(width) - height = int(height) + width = float(width) + height = float(height) custom_size = (width, height) except: custom_size = None