Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 06-15-2011, 01:52 PM   #1
jhsrennie
Member
jhsrennie began at the beginning.
 
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."
}
If I open this in Word it shows the page break before the chapter as expected. If I convert it to MOBI or PDF using:

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
jhsrennie is offline   Reply With Quote
Old 06-15-2011, 02:04 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
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.
kovidgoyal is offline   Reply With Quote
Advert
Old 06-16-2011, 03:32 AM   #3
jhsrennie
Member
jhsrennie began at the beginning.
 
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
jhsrennie is offline   Reply With Quote
Old 06-16-2011, 04:04 AM   #4
jhsrennie
Member
jhsrennie began at the beginning.
 
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
jhsrennie is offline   Reply With Quote
Old 06-16-2011, 10:43 AM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
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.
kovidgoyal is offline   Reply With Quote
Advert
Old 06-16-2011, 01:08 PM   #6
jhsrennie
Member
jhsrennie began at the beginning.
 
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."
}
The only difference is using:

{\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?
jhsrennie is offline   Reply With Quote
Old 06-16-2011, 01:11 PM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
http://manual.calibre-ebook.com/conv...ture-detection
kovidgoyal is offline   Reply With Quote
Old 06-16-2011, 01:29 PM   #8
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
@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.
jackie_w is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 06:02 PM.


MobileRead.com is a privately owned, operated and funded community.