Sample Files: OPF, NCX, OPF

Copy this sample text to create flat text OPF, NCX, and CSS files.
There’s also a snippet of an HTML file showing a header and a formatted Table of Contents.
These examples are for use in conjunction with the methods described in Ebook and Print Production from Word.

.OPF Sample File

/* Sample OPF File – REPLACE GENERIC TEXT SHOWN IN ALL CAPS
 – REPLACEMENT TEXT SHOULD BE uppercase/lowercase
*/
<?xml version="1.0" encoding="utf-8"?>
<package unique-identifier="uid">
<metadata>
    <dc-metadata xmlns:dc=
        "http://purl.org/metadata/dublin_core" 
        xmlns:oebpackage="http://openebook.org/namespaces/oeb-package/1.0/">
    <dc:Title>BOOK TITLE</dc:Title>
    <dc:Language>en-us</dc:Language>
    <dc:Creator>AUTHOR_LASTNAME, AUTHOR_FIRSTNAME</dc:Creator>
    <dc:rights>Copyright (C) YEAR BY COPYRIGHT OWNER NAME. 
         All rights reserved.</dc:rights>
    <dc:Publisher>PUBLISHER_NAME</dc:Publisher>
    <dc:Subject BASICCode="CODE#">STRING FROM BISAC CODE TABLE </dc:Subject>
    <dc:identifier id="BookId" opf:scheme="ISBN">ID_ISBN-OR-ASIN
         </dc:identifier>
    <dc:Description>TEXT_STRING_DESCRIPTION</dc:Description>
    <dc:Date>DATE_IN_MM/YYYY_FORMAT</dc:Date>
</dc-metadata>
<meta name="cover" content="my-cover-image" />
</metadata>
<manifest>
    <item id="ncx" media-type="application/x-dtbncx+xml" 
         href="NCX_FILENAME.ncx" />
    <item id="bkfile" media-type="application/xhtml+xml" 
         href="BOOK_HTML_FILENAME.htm" />
    <item id="my-cover-image" media-type="image/jpeg" 
         href="COVER-ART_FILENAME.jpg" />
</manifest>
<spine toc="ncx">
    <itemref idref="bkfile" />
</spine>
<guide>
     <reference type="toc" title="Table of Contents" 
         href="BOOK_HTML_FILENAME.htm#toc" />
     <reference type="start" title="Start" 
         href="BOOK_HTML_FILENAME.htm#start" />
</guide>
</package>

.NCX Sample File

/* SAMPLE NCX FILE – REPLACE GENERIC TEXT SHOWN IN ALL CAPS 
– REPLACEMENT TEXT SHOULD BE uppercase/lowercase
*/
/* BOOKMARK NAMES MUST MATCH BOOKMARKS IN THE HTML FILE 
*/
/* ADD OR DELETE <navpoint> ENTRIES TO MATCH YOUR BOOK 
*/
/* MAKE SURE "ncx_point_###" playOrder="###" ARE IN NUMERICAL ORDER
*/
<?xml version="1.0" encoding="utf-8"?>
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1"> 
<head>
<meta name="dtb:uid" content="uid"/>
<meta name="dtb:depth" content="1"/>
<meta name="dtb:totalPageCount" content="0"/>
<meta name="dtb:maxPageNumber" content="0"/>
</head> 
<docTitle><text>BOOK TITLE</text></docTitle>
<docAuthor><text>AUTHOR_LASTNAME, AUTHOR_FIRSTNAME</text></docAuthor>
<navMap>
   <navPoint id="ncx_point_0" playOrder="0">
      <navLabel><text>COVER</text></navLabel>
      <content src="BOOKTITLE.htm#cover" />
   </navPoint/>
   <navPoint id="start" playOrder="1">
      <navLabel><text>START-PAGE_HEADLINE</text></navLabel>
    <content src="BOOK_TITLE.htm#start"/>
   </navPoint/>
   <navPoint id="ncx_point_2" playOrder="2">
      <navLabel><text>CHAPTER_1</text></navLabel>
    <content src="BOOK_TITLE.htm#CH1"/>
   </navPoint/>              
                          . . . < snip> . . .
  <navPoint id="ncx_point_108" playOrder="108">
      <navLabel><text>About the Author</text></navLabel>
    <content src="BOOK_TITLE.htm#AboutAuthor"/>
   </navPoint/>
   <navPoint id="ncx_point_109" playOrder="109">
      <navLabel><text>Copyright</text></navLabel>
    <content src="BOOK_TITLE.htm#Copyright"/>
   </navPoint/>
  <navPoint id="ncx_point_111" playOrder="111">
      <navLabel><text>TABLE OF CONTENTS</text></navLabel>
      <content src="BOOK_TITLE.htm#toc" />
   </navPoint/>
</navMap>
</ncx>

.CSS Sample Files

/* SAMPLE CSS FILE – STYLE DEFINITIONS MATCH STYLE NAMES 
   IN "POD-PRINTTEMPLATE.DOCX"
*/
/* NORMAL STYLE*/
p
 {margin-top:0em;
 margin-right:0em;
 margin-bottom:0em;
 margin-left:0em;
 text-indent:1.5em;
 font-size:1.0em;}
/* NORMAL STYLE FROM WORD-TO-HTML CONVERSION */
p.MsoNormal
 {margin-top:0em;
 margin-right:0em;
 margin-bottom:0em;
 margin-left:0em;
 text-indent:1.5em;
 font-size:1.0em;}
/* NO-INDENT FIRST-PARAGRAPH-CHAPTER STYLE*/
p.FirstParagraph 
 {
 margin-top:1.0em;
 margin-left:0.0em;
 text-indent:0.0em;}
/* BLOCKQUOTE PARAGRAPH */
p.Blockquote 
 {
 margin-top:0em;
 margin-right:1.0em;
 margin-bottom:0em;
 margin-left:1.75em;
 margin-bottom:1.0em;
 text-indent:0.1em;
 font-size:1.0em;}
/* CENTERED PARAGRAPH */
p.Centered 
 {
 margin-top:0.5em;
 margin-right:0em;
 margin-bottom:0em;
 margin-left:0em;
 text-indent:0.1em;
 font-size:1.0em;
 text-align:center;}
/* HEADING 1 PARAGRAPH WITH PAGE-BREAK-BEFORE */
h1
 {
 margin-top:5.0em;
 page-break-before:always;
 text-align:center;
 font-weight:normal;
 text-indent:0.0em;
 font-size:1.5em}
/* TABLE OF CONTENTS PARAGRAPH STYLE */
p.MsoToc1, li.MsoToc1, div.MsoToc1
 {font-size:1.0em
 margin-top:1.0em;
 margin-left:0.0em;
 text-indent:0.0em;}
/* BOLD CHARACTER STYLE */
span.Bold
 {
 font-weight:bold;}
/* ITALIC CHARACTER STYLE */
span.Italic
 {
 font-style:italic;
 text-decoration:none;}
/* BOLDITALIC CHARACTER STYLE */
span.Bolditalic
 {
 font-weight:bold;
 font-style:italic;
 text-decoration:none;}
/* CUSTOM LARGE-INITIAL-CAP CHARACTER STYLE */
span.BigLetter
 {
 font-size:1.5em;}
/* CUSTOM CHARACTER STYLE TO IMITATE SMALL CAPS */
span.SmallHead
 {
 font-size:0.9em;
 font-family:"serif";}

 .HTML Example Header and Table of Contents

/* EXAMPLE HTML HEADER AND TABLE OF CONTENTS LIST */
<html>
<head>
   <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
   <title>BOOK TITLE</title>
   <link type="text/css" rel="stylesheet" href="CSS_FILENAME.css" />
</head> 

<body>
<h1 ID="my-cover-image"> <a name=cover></a> </h1>
<p class=MsoNormal>&nbsp;</p>
<p class=Title>BOOK TITLE</p>

/* REST OF BODY TEXT GOES HERE */

/* TABLE OF CONTENTS */
<p class=Centered><a href="#cover">Cover</a><br>
<a href="#start">One</a><br>
<a href="#Ch2">Two</a><br>
<a href="#Ch3">Three</a><br>
<a href="#Ch4">Four</a><br>
<a href="#Ch5">Five</a><br>
<a href="#Ch6">Six</a><br>
<a href="#Ch7">Seven</a><br>
<a href="#Ch8">Eight</a><br>
<a href="#Ch9">Nine</a><br>
<a href="#Ch10">Ten</a><br>
<a href="#Ch11">Eleven</a><br>
<a href="#Ch12">Twelve</a><br>
<a href="#Ch13">Thirteen</a><br>
<a href="#Ch14">Fourteen</a><br>
<a href="#Ch15">Fifteen</a><br>
<a href="#Ch16">Sixteen</a><br>
<a href="#Ch17">Seventeen</a><br>
<a href="#Ch18">Eighteen</a><br>
<a href="#Ch19">Nineteen</a><br>
<a href="#Ch20">Twenty</a><br>
<a href="#author">About the Author</a><br>
<a href="#ack">Acknowledgments</a><br>
<a href="#Copyright">Copyright</a><br>
<a href="#Dedication">Dedication</a></p>
</body>
</head>

 

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s