<?xml version="1.0" encoding="utf-8"?>
<FictionBook xmlns="http://www.gribuser.ru/xml/fictionbook/2.0" xmlns:l="http://www.w3.org/1999/xlink">
<description>
  <title-info>
    <genre>computers</genre>
    <author><first-name>web2fb2</first-name><last-name>net</last-name></author>
    <book-title>A Sample FB2, About FB2</book-title>
    <annotation>
      <p>A short book stored in the FB2 format, written so that a converter has something to convert. Free to use for any purpose.</p>
    </annotation>
    <date value="2026-10-23">2026</date>
    <coverpage><image l:href="#cover.png"/></coverpage>
    <lang>en</lang>
    <sequence name="web2fb2 samples" number="2"/>
  </title-info>
  <document-info>
    <author><nickname>web2fb2.net</nickname></author>
    <program-used>scripts/build_sample_fb2.mjs</program-used>
    <date value="2026-10-23">2026-10-23</date>
    <id>web2fb2-sample-fb2-0001</id>
    <version>1.0</version>
  </document-info>
</description>
<body>
  <title><p>A Sample FB2, About FB2</p></title>
  <epigraph>
    <p>A file format is a promise about where things are.</p>
    <text-author>Anonymous</text-author>
  </epigraph>
  <section id="ch1">
    <title><p>What you are holding</p></title>
    <p>This file is an FB2 book. Underneath it is one XML document: the description at the top, then a body of sections, and at the end any pictures, stored as text in base64.<a l:href="#n1" type="note">[1]</a></p>
    <p>That is the whole format. There is no archive to unpack and no separate file for the cover, which is why an FB2 file is easy to make and <emphasis>hard to open on most readers</emphasis>, because most readers expect an ePub.</p>
    <empty-line/>
    <p>Converting it means moving each part to where an ePub keeps it: the metadata into the package document, each top-level section into its own chapter file, the notes into a file of footnotes, and the pictures back into real image files.</p>
    <section id="ch1-parts">
      <title><p>The parts, side by side</p></title>
      <table>
        <tr><th>FB2</th><th>ePub</th></tr>
        <tr><td>description</td><td>content.opf</td></tr>
        <tr><td>body section</td><td>one XHTML file</td></tr>
        <tr><td>body name="notes"</td><td>footnotes</td></tr>
        <tr><td>binary</td><td>an image file</td></tr>
      </table>
      <p>Nothing is lost on the way. The converter keeps <strong>the text and its structure</strong>, the notes, the images, the cover and the metadata.<a l:href="#n2" type="note">[2]</a></p>
    </section>
  </section>
  <section id="ch2">
    <title><p>A short poem, so the converter has one</p></title>
    <p>FB2 has a poem element of its own, with stanzas and lines, and a converter that forgets it turns verse into prose. This one is here so that cannot happen unnoticed.</p>
    <poem>
      <title><p>Lines on a container</p></title>
      <stanza>
        <v>A book is a box with a label outside,</v>
        <v>and a list of its parts, and the parts.</v>
      </stanza>
      <stanza>
        <v>Change the label and the box is the same;</v>
        <v>change the list and the reader is lost.</v>
      </stanza>
      <text-author>web2fb2.net</text-author>
    </poem>
    <cite>
      <p>The sample ePub on this site says the same thing from the other direction.</p>
      <text-author>From the ePub inspector page</text-author>
    </cite>
    <p>That is the end of the sample. Open the converted file in the <emphasis>ePub inspector</emphasis> and you will see these two chapters, the notes file, the cover and one image.</p>
  </section>
</body>
<body name="notes">
  <title><p>Notes</p></title>
  <section id="n1">
    <title><p>1</p></title>
    <p>The format was designed in Russia in 2004, which is why most of the books in it are Russian.</p>
  </section>
  <section id="n2">
    <title><p>2</p></title>
    <p>What it cannot keep is anything FB2 never carried in the first place: fonts, page layout, colours.</p>
  </section>
</body>
<binary id="cover.png" content-type="image/png">
iVBORw0KGgoAAAANSUhEUgAAASwAAAHCCAIAAADaUWPQAAAFGklEQVR4nO3WsQnCUBSG0bdFQJwh
k9jbOZCbuY9NSOMEgk34iO/AGeAW/wd3vJ4rEBr5BTA5EUJMhBATIcRECDERQkyEEBMhxEQIMRFC
TIQQEyHERAixsW9vICRCiIkQYiKEmAghJkKIiRBiIoSYCCEmQoiJEGIihJgIISZCiIkQYiKEmAgh
JkKIiRBiIoSYCCEmQoiJEGIihJgIISZCiIkQYiKEmAghJkKIiRBiIoSYCCEmQoiJEGIihJgIISZC
iIkQYiKEmAghJkKIiRBiIoSYCCEmQoiJEGIihJgIISZCiIkQYiKEmAghJkKIiRBiIoSYCCEmQoiJ
EGIihJgIISZCiIkQYiKEmAghJkKIiRBiIoSYCCEmQoiJEGIihJgIISZCiIkQYiKEmAghJkKIiRBi
IoSYCCEmQoiJEGIihJg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