From bef606f27c53fb95a45f50aa5b791788db09024a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 13 Apr 2017 09:08:13 +0530 Subject: [PATCH] PDF Output: Default to generating PDFs with a page size of letter instead of taking the page size from the output profile. This avoids user confusion/bug reports about PDF Output having "too large fonts". There is a new option "Use profile size" to have the conversion use the output profile page size instead. --- manual/conversion.rst | 11 +- .../ebooks/conversion/plugins/pdf_output.py | 9 +- src/calibre/ebooks/pdf/render/from_html.py | 4 +- src/calibre/gui2/convert/pdf_output.py | 2 +- src/calibre/gui2/convert/pdf_output.ui | 106 ++++++++---------- 5 files changed, 60 insertions(+), 72 deletions(-) diff --git a/manual/conversion.rst b/manual/conversion.rst index 919f0561b9..5a685074ba 100644 --- a/manual/conversion.rst +++ b/manual/conversion.rst @@ -805,12 +805,13 @@ Converting to PDF ~~~~~~~~~~~~~~~~~~~ The first, most important, setting to decide on when converting to PDF is the page -size. By default, calibre uses a page size defined by the current -:guilabel:`Output profile`. So if your output profile is set to Kindle, calibre +size. By default, calibre uses a page size of "U.S. Letter". You can change this +to another standard page size or a completely custom size in the :guilabel:`PDF Output` +section of the conversion dialog. If you are generating a PDF to be used ona +specific device, you can turn on the option to use the page size from the +:guilabel:`output profile` instead. So if your output profile is set to Kindle, calibre will create a PDF with page size suitable for viewing on the small kindle -screen. However, if you view this PDF file on a computer screen, then it will -appear to have too large fonts. To create "normal" sized PDFs, use the -:guilabel:`Override page size` option under :guilabel:`PDF Output` in the conversion dialog. +screen. Headers and Footers ^^^^^^^^^^^^^^^^^^^^ diff --git a/src/calibre/ebooks/conversion/plugins/pdf_output.py b/src/calibre/ebooks/conversion/plugins/pdf_output.py index 32bf2d6f5a..4698a7ccee 100644 --- a/src/calibre/ebooks/conversion/plugins/pdf_output.py +++ b/src/calibre/ebooks/conversion/plugins/pdf_output.py @@ -52,11 +52,10 @@ class PDFOutput(OutputFormatPlugin): file_type = 'pdf' options = set([ - OptionRecommendation(name='override_profile_size', recommended_value=False, - help=_('Normally, the PDF page size is set by the output profile' - ' chosen under the page setup options. This option will cause the ' - ' page size settings under PDF Output to override the ' - ' size specified by the output profile.')), + OptionRecommendation(name='use_profile_size', recommended_value=False, + help=_('Instead of using the paper size specified in the PDF Output options,' + ' use a paper size corresponding to the current output profile.' + ' Useful if you want to generate a PDF for viewing on a specific device.')), OptionRecommendation(name='unit', recommended_value='inch', level=OptionRecommendation.LOW, short_switch='u', choices=UNITS, help=_('The unit of measure for page sizes. Default is inch. Choices ' diff --git a/src/calibre/ebooks/pdf/render/from_html.py b/src/calibre/ebooks/pdf/render/from_html.py index 31d484f817..cbc95fe99f 100644 --- a/src/calibre/ebooks/pdf/render/from_html.py +++ b/src/calibre/ebooks/pdf/render/from_html.py @@ -27,9 +27,7 @@ from calibre.ptempfile import PersistentTemporaryFile def get_page_size(opts, for_comic=False): # {{{ - use_profile = not (opts.override_profile_size or - opts.output_profile.short_name == 'default' or - opts.output_profile.width > 9999) + use_profile = opts.use_profile_size and opts.output_profile.short_name != 'default' and opts.output_profile.width <= 9999 if use_profile: w = (opts.output_profile.comic_screen_size[0] if for_comic else opts.output_profile.width) diff --git a/src/calibre/gui2/convert/pdf_output.py b/src/calibre/gui2/convert/pdf_output.py index dd9f1839e6..dc011abd57 100644 --- a/src/calibre/gui2/convert/pdf_output.py +++ b/src/calibre/gui2/convert/pdf_output.py @@ -24,7 +24,7 @@ class PluginWidget(Widget, Ui_Form): def __init__(self, parent, get_option, get_help, db=None, book_id=None): Widget.__init__(self, parent, [ - 'override_profile_size', 'paper_size', 'custom_size', + 'use_profile_size', 'paper_size', 'custom_size', 'preserve_cover_aspect_ratio', 'pdf_serif_family', 'unit', 'pdf_sans_family', 'pdf_mono_family', 'pdf_standard_font', 'pdf_default_font_size', 'pdf_mono_font_size', 'pdf_page_numbers', diff --git a/src/calibre/gui2/convert/pdf_output.ui b/src/calibre/gui2/convert/pdf_output.ui index 53f72fa1f5..c6e511d152 100644 --- a/src/calibre/gui2/convert/pdf_output.ui +++ b/src/calibre/gui2/convert/pdf_output.ui @@ -15,23 +15,13 @@ - + - <b>Note:</b> The paper size settings below only take effect if you enable the "Override" checkbox below. Otherwise the size from the output profile will be used. - - - true + &Use the paper size set in output profile - - - - &Override paper size set in output profile - - - - + &Paper Size: @@ -41,10 +31,10 @@ - + - + &Custom size: @@ -54,7 +44,7 @@ - + @@ -87,21 +77,41 @@ - + Preserve &aspect ratio of cover - + Add page &numbers to the bottom of every page - + + + + Add a printable &Table of Contents at the end + + + + + + + &Title for ToC: + + + opt_toc_title + + + + + + + Serif famil&y: @@ -111,10 +121,10 @@ - + - + Sans fami&ly: @@ -124,10 +134,10 @@ - + - + &Monospace family: @@ -137,10 +147,10 @@ - + - + S&tandard font: @@ -150,10 +160,10 @@ - + - + Default font si&ze: @@ -163,14 +173,14 @@ - + px - + Monospace &font size: @@ -180,14 +190,21 @@ - + px - + + + + Page margins + + + + Page headers and footers @@ -235,33 +252,6 @@ - - - - Add a printable &Table of Contents at the end - - - - - - - - - - &Title for ToC: - - - opt_toc_title - - - - - - - Page margins - - -