[NTLK] Converting NewtonBooks to ePub

Matthias Melcher m.melcher at robowerk.de
Wed Feb 25 05:11:07 PST 2026


Just to give a little technical overview. The file header looks like this:

  signature: 'package0,
  id: "xxxx",
  flags: {},
  version: 1,
  copyright: "\uFFA9\u1995 Cortland Publishing. All rights reserved.",
  name: "Midsummer Night:JonC",
  size: 242188,
  creationdate: -1411759343,
  modifyDate: -1411759343,
  reserved3: 0,
  directorySize: 284,
  info: "Newton\u2122\u ToolKit Package \u00A9\u 1992-1994, Apple Computer, Inc.\u0000\u",
  part: [
    {
      offset: 0,
      size: 241904,
      type: "book",
      flags: {type: 'nos, Notify: true},
      info: "book",
      data: {
        book: {
          version: 1,
          isbn: "Co9505122133",
          title: "A Midsummer Night's Dream",
          shortTitle: "MND",
          copyright: "\u00A9\u 1995 Cortland Publishing",
          author: "William Shakespeare",
          publisher: "Cortland Publishing",
          data: {},
          contents: [
            Ref_23,
            Ref_25,
            :
            : ... and many more

where Ref_23 for example is

{data: "Title Page", layout: 2048}

and Ref_25 is 

{
  data: "\n\nA Midsummer Night's Dream\nby William Shakespeare\n\n1596\n",
  styles: [
    2, {family: 'espy, face: 0, size: 10},
    25, {family: 'newyork, face: 0, size: 18},
    24, {family: 'espy, face: 0, size: 10},
    1, {family: 'newyork, face: 0, size: 12},
    4, {family: 'espy, face: 0, size: 10},
    2, {family: 'newyork, face: 0, size: 12}
  ],
  layout: 4,
  viewJustify: 2
}


So there is a lot of plain text, and the formatting is defined by the "style" tag. Here in the title, we have two characters in the Epsy font with 10 pixel height ('\n\n' are two "carriage return/new line" characters, just like on the type writer.

Then we have 25 characters in NewYaork forny an 18 pixels high: "A Midsummer Night's Dream", and so on.

"viewJustify: 2" means centered on the page. This information can be found in the Newton Programmers Guide. 

So all in all, this is a pretty readable format. No compression, no encryption - at least not in the files that I looked at.

Newton Books can in theory become quite complex. The format allows embedding scripts and entire applications. You can have forms for the user to fill out, and so much more. But I doubt that this has been used very often. Extracting pure text, attributes, and maybe embedded images is not too complicated. How big is the interest by the commuity to have a book-to-ePub converter?

 - Matthias





More information about the NewtonTalk mailing list