Merge lp:~user-none/calibre/dev into lp:calibre

Proposed by John Schember
Status: Merged
Merged at revision: 12076
Proposed branch: lp:~user-none/calibre/dev
Merge into: lp:calibre
Diff against target: 64 lines (+18/-23)
1 file modified
src/calibre/ebooks/pdf/writer.py (+18/-23)
To merge this branch: bzr merge lp:~user-none/calibre/dev
Reviewer Review Type Date Requested Status
Kovid Goyal Pending
Review via email: mp+103037@code.launchpad.net
To post a comment you must log in.
lp:~user-none/calibre/dev updated
11991. By Kovid Goyal

KF8: Fix handling of multi-level ToCs

11992. By Kovid Goyal

...

11993. By Kovid Goyal

Fix Der Tagesspiegel

11994. By Kovid Goyal

KF8 debug: Dump the guide

11995. By Kovid Goyal

KF8: Improved handling of startoffset

11996. By Kovid Goyal

Berria by Alayn Gortazar

11997. By Kovid Goyal

...

11998. By Kovid Goyal

...

11999. By Kovid Goyal

Show cover size in a tooltip in the conversion dialog

12000. By Kovid Goyal

Cover Browser: Wrap the title on space only, not in between words. Fixes #986516 (Cover Browser - font size, divided words)

12001. By Kovid Goyal

Fix #986958 (Tooltip not updating when paste cover)

12002. By Kovid Goyal

Fix #986658 (Calibre crashes when updating data on Metadata)

12003. By Kovid Goyal

tighten format_field_extended

12004. By Kovid Goyal

...

12005. By Kovid Goyal

...

12006. By Kovid Goyal

oops, remove the mistaken tightening of gotmat_field_extended

12007. By Kovid Goyal

...

12008. By Kovid Goyal

Nicer dump headers for joint KF8 files

12009. By Kovid Goyal

...

12010. By Kovid Goyal

KF8 Output: Implement joint mobi files with both MOBI 6 and KF8 versions in the same file

12011. By Kovid Goyal

Heuristics: When italicizing words do not operate on words not in between HTML tags. Fixes #986298 (Heuristics breaking id="_anchor_")

12012. By Kovid Goyal

...

12013. By Kovid Goyal

...

12014. By Kovid Goyal

KF8 Output: Fix length entries in the NCX table

12015. By Kovid Goyal

Fix #985353 (Updated Metro Nieuws NL)

12016. By Kovid Goyal

Updated Marketing Magazine

12017. By Kovid Goyal

Non legerlo and Vignetter by faber 1971

12018. By Kovid Goyal

Fix #985353 (Updated Metro Nieuws NL)

12019. By Kovid Goyal

KF8 Output: Generate trailing bytes for books with flat ToCs

12020. By Kovid Goyal

KF8 Input: Handle images referenced via CSS url in the style attribute of a tag

12021. By Kovid Goyal

Conversion pipeline: Fix handling of relative resource URLs in the CSS of the input document

12022. By Kovid Goyal

Switch to using cssutils 0.9.9 for improved performance and robustness

12023. By Kovid Goyal

...

12024. By Kovid Goyal

...

12025. By Kovid Goyal

...

12026. By Kovid Goyal

Fix #988956 (Calibre cant see Android Device after upgrade to Android 4.0.3)

12027. By Kovid Goyal

IGN:Updated translations

12028. By Kovid Goyal

KF8 Output: Split on page breaks to produce KF8 files that work better with viewers that dont support CSS page breaks. Also remove no longer used MOBI_UNPACK code from MOBI input

12029. By Kovid Goyal

...

12030. By Kovid Goyal

KF8 Output: Add an inline ToC if one is not already present in the input document

12031. By Kovid Goyal

...

12032. By Kovid Goyal

Fix #989264 (New Device: Nook Simple Touch w/ Glow Light)

12033. By Kovid Goyal

Richmond Times-Dispatch by jde

12034. By Kovid Goyal

version 0.8.49

12035. By Kovid Goyal

IGN:Tag release

12036. By Kovid Goyal

Fix #989691 (Book details Picture error)

12037. By Kovid Goyal

...

12038. By Kovid Goyal

FB2 Input: Better handling of inline images. Fixes #989869 (fb2: export/display: inline images displayed as top level)

12039. By Kovid Goyal

EPUB Input: Auto set the media-type for OPF manifest entries with an empty media-type

12040. By Kovid Goyal

Fix #989985 (updated tweakers.net recipe)

12041. By Kovid Goyal

Fix #990026 (fb2: lang tag uses wrong ISO)

12042. By Kovid Goyal

KF8 dump: Dump all TBS sequences

12043. By Kovid Goyal

Fix #990451 (Calibre 0.8.4x GUI not detecting Android Phone)

12044. By Kovid Goyal

...

12045. By Kovid Goyal

More informative error message for SplitErrors

12046. By Kovid Goyal

...

12047. By Kovid Goyal

KF8 Output: Proper algorithm for calculatin trailing bytes for all types of ToCs

12048. By Kovid Goyal

...

12049. By Kovid Goyal

Automatically add the Tag 'Sample Book' when an Amazon sample is added to calibre

12050. By Kovid Goyal

Improved derStandard

12051. By Kovid Goyal

AraInfo and Diagonal by Ruben Pollan

12052. By Kovid Goyal

Save to Disk: Do not run out memory when saving very large files on systems with low RAM. Fixes #990741 ("Out of memory" when saving to disk)

12053. By Kovid Goyal

Fix #990881 (Shift-click after using cover browser makes wrong selection)

12054. By Kovid Goyal

FB2 Input: More robust base64 decoding to handle embedded images that are incorrectly encoded. Fixes #990929 (Private bug)

12055. By Kovid Goyal

Conversion: Allow easy re-ordering of the search and replace expressions in the conversion dialog. Also apply the expressions in the same order that they were entered when doing the conversion.

12056. By Kovid Goyal

For the wankers among us. Fixes #991081 (contains copypasted description without copyright)

12057. By Kovid Goyal

Get Books: Amazon fix prices not being found. B&N fix details link. ebooks.com: fix cover image. Website changes to various EU stores

12058. By Kovid Goyal

Update Max-Planck

12059. By Kovid Goyal

Update Mig Pao

12060. By Kovid Goyal

KF8 Output: Handle documents that have XML comments and/or processing instructions

12061. By Kovid Goyal

Write metadata in .azw3 files

12062. By Kovid Goyal

...

12063. By Kovid Goyal

KF8 Output: Write useless FLIS/FCIS records as older kindles refuse to open joint MOBI files without them

12064. By Kovid Goyal

Add azw3 output plugin (thin wrapper around the standalone kf8 mobi output code)

12065. By Kovid Goyal

Update Newsweek Polska

12066. By Kovid Goyal

El Mundo Today by atordo

12067. By Kovid Goyal

Update Daily Mirrot and The Sun

12068. By Kovid Goyal

George Monbiot by DM

12069. By Kovid Goyal

...

12070. By Kovid Goyal

...

12071. By Kovid Goyal

Add calibre-debug --tweak-kf8 tool for tweaking kf8 books

12072. By Kovid Goyal

Command Line Interface for the Tweak Book feature

12073. By Kovid Goyal

Run explode/rebuild of MOBI in worker process to ensure no mem leaks

12074. By Kovid Goyal

...

12075. By Kovid Goyal

Vice Magazine by atordo

12076. By Kovid Goyal

Get Books: Add biblio.bg store

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/calibre/ebooks/pdf/writer.py'
2--- src/calibre/ebooks/pdf/writer.py 2012-03-31 05:15:51 +0000
3+++ src/calibre/ebooks/pdf/writer.py 2012-04-23 01:01:23 +0000
4@@ -45,29 +45,24 @@
5 if not is_ok_to_use_qt():
6 raise Exception('Not OK to use Qt')
7
8+ custom_size = False
9 printer = QPrinter(QPrinter.HighResolution)
10 custom_size = get_custom_size(opts)
11- if isosx and not for_comic:
12- # On OSX, the native engine can only produce a single page size
13- # (usually A4). The Qt engine on the other hand produces image based
14- # PDFs. If we set a custom page size using QSizeF the native engine
15- # produces unreadable output, so we just ignore the custom size
16- # settings.
17- printer.setPaperSize(paper_size(opts.paper_size))
18+ if opts.output_profile.short_name == 'default' or \
19+ opts.output_profile.width > 9999:
20+ if custom_size is None:
21+ printer.setPaperSize(paper_size(opts.paper_size))
22+ else:
23+ custom_size = True
24+ printer.setPaperSize(QSizeF(custom_size[0], custom_size[1]), unit(opts.unit))
25 else:
26- if opts.output_profile.short_name == 'default' or \
27- opts.output_profile.width > 9999:
28- if custom_size is None:
29- printer.setPaperSize(paper_size(opts.paper_size))
30- else:
31- printer.setPaperSize(QSizeF(custom_size[0], custom_size[1]), unit(opts.unit))
32- else:
33- w = opts.output_profile.comic_screen_size[0] if for_comic else \
34- opts.output_profile.width
35- h = opts.output_profile.comic_screen_size[1] if for_comic else \
36- opts.output_profile.height
37- dpi = opts.output_profile.dpi
38- printer.setPaperSize(QSizeF(float(w) / dpi, float(h) / dpi), QPrinter.Inch)
39+ custom_size = True
40+ w = opts.output_profile.comic_screen_size[0] if for_comic else \
41+ opts.output_profile.width
42+ h = opts.output_profile.comic_screen_size[1] if for_comic else \
43+ opts.output_profile.height
44+ dpi = opts.output_profile.dpi
45+ printer.setPaperSize(QSizeF(float(w) / dpi, float(h) / dpi), QPrinter.Inch)
46
47 if for_comic:
48 # Comic pages typically have their own margins, or their background
49@@ -77,13 +72,13 @@
50 printer.setPageMargins(opts.margin_left, opts.margin_top,
51 opts.margin_right, opts.margin_bottom, QPrinter.Point)
52 printer.setOrientation(orientation(opts.orientation))
53- printer.setOutputFormat(QPrinter.PdfFormat)
54 printer.setFullPage(for_comic)
55 if output_file_name:
56 printer.setOutputFileName(output_file_name)
57- if isosx and not for_comic:
58- # Ensure we are not generating enormous image based PDFs
59+ if isosx and not custom_size:
60 printer.setOutputFormat(QPrinter.NativeFormat)
61+ else:
62+ printer.setOutputFormat(QPrinter.PdfFormat)
63
64 return printer
65

Subscribers

People subscribed via source and target branches

to status/vote changes: