![]() |
#1 |
Member
![]() Posts: 12
Karma: 10
Join Date: Jun 2011
Device: Android
|
RTF conversion problem - no page breaks
I have the following RTF (hand written for this test!) saved as test.rtf:
Code:
{\rtf1\ansi {\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}} {\colortbl ;\red0\green0\blue0;} \viewkind4\uc1\pard\sa200\cf1\lang2057\f0 \fs28 Citizen of the Galaxy\fs24 \par Robert A. Heinlein \par Copyright 1957 \page\par\fs28 Chapter 1\fs24 \par "Lot ninety-seven," the auctioneer announced. "A boy." } ebook-convert test.rtf .mobi or ebook-convert test.rtf .pdf then the resulting output file does not have a page break before the chapter. ebook-convert --version gives me: ebook-convert.exe (calibre 0.7.23) Created by: Kovid Goyal <kovid@kovidgoyal.net> Thanks, John Rennie |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,219
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Your version of calibre is ancient. Though, IIRC, the RTF input plugin doesn;t support page breaks. Use one of the many page break insertion options for ebook-convert instead.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Member
![]() Posts: 12
Karma: 10
Join Date: Jun 2011
Device: Android
|
Hi Kovid, thanks for the reply. I've upgraded to 0.8.5 but as you say the \page still does nothing.
If I use Word to create an RTF file the page breaks do work; well they work when creating .mobi files though curiously not when creating .pdf files. However Word creates very convoluted RTF and I haven't yet worked out what the significant difference is. What page break insertion options for ebook-convert should I look at? Possibly --page-breaks-before? Thanks, John Rennie |
![]() |
![]() |
![]() |
#4 |
Member
![]() Posts: 12
Karma: 10
Join Date: Jun 2011
Device: Android
|
PS given the RTF I posted above, can anyone suggest what the argument to --page-breaks-before should be to put the page break where the \page is? I'm struggling to understand the XPath syntax.
Thanks, John Rennie |
![]() |
![]() |
![]() |
#5 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,219
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Try opening your word produced rtf in wordpad and saving it, that should simplify it a little.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Member
![]() Posts: 12
Karma: 10
Join Date: Jun 2011
Device: Android
|
I worked through the RTF generated by Word, and this does cause ebook-convert to generate a page break if it's converting to .mobi, but strangely I still get no page break when converting to .pdf:
Code:
{\rtf1\ansi {\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}} {\colortbl ;\red0\green0\blue0;} \viewkind4\uc1\pard\sa200\cf1\lang2057\f0 \fs28 Citizen of the Galaxy\fs24 \par Robert A. Heinlein \par Copyright 1957 {\par \page } \fs28 Chapter 1\fs24 \par "Lot ninety-seven," the auctioneer announced. "A boy." } {\par \page } \fs28 Chapter 1\fs24 instead of: \page\par\fs28 Chapter 1\fs24 though why that should make a difference I don't know. I read up on XPath, but as far as I can see it's a method for identifying nodes in XML. If I wanted to use --page-breaks-before would I have to convert to XML then convert to PDF? |
![]() |
![]() |
![]() |
#7 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,219
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
![]() |
#8 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,249
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
@jhsrennie,
You could try the following approach: Open your RTF in Word and style every chapter heading with one of Word's built-in Heading styles 'Heading 1' or 'Heading 2'. Save the RTF and try again. If you set the --chapter-mark option to "pagebreak" then Calibre's default --chapter option should put pagebreaks before each chapter. I would post a sample CLI command for you but I'm afraid I always use the Calibre GUI. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
PDF to MOBI Conversion Problem with Page Heading | gtbeagle | Conversion | 1 | 06-09-2011 02:10 AM |
Adding page breaks in Calibre breaks ePubcheck validation | bookraft | Conversion | 16 | 03-01-2011 01:23 PM |
conversion RTF to EPUB problem; small fonts | tscamera | Calibre | 9 | 01-03-2011 08:46 PM |
Problem with --page-breaks-before | pepak | Calibre | 5 | 10-24-2009 04:50 PM |
Problem with conversion from RTF to PDF | julius | Calibre | 3 | 09-24-2009 12:01 PM |