Convert Properties to FB2
Max file size 100mb.
Properties vs FB2 Format Comparison
| Aspect | Properties (Source Format) | FB2 (Target Format) |
|---|---|---|
| Format Overview |
Properties
Java Properties File
Plain text configuration format using key=value pairs, central to the Java platform. Used by Spring Boot, Maven, Gradle, and Java resource bundles for application settings, localization, and build configurations. Employs dotted notation for hierarchical namespaces. Key-Value Pairs Java Ecosystem |
FB2
FictionBook 2
XML-based e-book format popular in Russia and Eastern Europe. FB2 stores content with rich semantic structure including sections, paragraphs, emphasis, tables, and embedded images encoded as base64. The format separates content from presentation, relying on reading applications for rendering. XML-Based E-Book Format |
| Technical Specifications |
Structure: Line-oriented key=value pairs
Encoding: ISO 8859-1 (Latin-1) / UTF-8 Format: java.util.Properties specification Compression: None Extensions: .properties |
Structure: Well-formed XML document
Encoding: UTF-8 Format: FictionBook 2.0 XSD schema Compression: None (often distributed as .fb2.zip) Extensions: .fb2 |
| Syntax Examples |
Spring Boot application properties: # Mail Server Config spring.mail.host=smtp.example.com spring.mail.port=587 [email protected] spring.mail.properties.mail.smtp.auth=true # JPA Settings spring.jpa.hibernate.ddl-auto=validate spring.jpa.show-sql=false |
FB2 XML with semantic sections: <FictionBook>
<description>
<title-info>
<book-title>Mail Configuration</book-title>
</title-info>
</description>
<body>
<section>
<title><p>Mail Server</p></title>
<p>Host: smtp.example.com</p>
<p>Port: 587</p>
</section>
</body>
</FictionBook>
|
| Content Support |
|
|
| Advantages |
|
|
| Disadvantages |
|
|
| Common Uses |
|
|
| Best For |
|
|
| Version History |
Introduced: JDK 1.0 (1996)
Current Version: Part of java.util since Java 1.0 Status: Stable, widely used Evolution: XML properties variant added in Java 5 |
Introduced: 2004 (Dmitry Gribov)
Current Version: FictionBook 2.0 Status: Stable, maintained Evolution: FB2 -> FB3 (partial adoption) |
| Software Support |
Java: java.util.Properties (native)
Spring: @Value, @ConfigurationProperties IDEs: IntelliJ, Eclipse, VS Code Other: Apache Commons Configuration |
Readers: FBReader, CoolReader, AlReader
Conversion: Calibre, fb2edit, pandoc Libraries: lxml (Python), SAX/DOM (Java) Other: PocketBook, ONYX Boox devices |
Why Convert Properties to FB2?
Converting Java Properties files to FictionBook (FB2) format creates a self-contained, XML-based document that can be read on popular e-readers throughout Russia and Eastern Europe. While EPUB dominates Western markets, FB2 remains the preferred format on PocketBook, ONYX Boox, and applications like FBReader and CoolReader, making this conversion valuable for teams working in these regions.
FB2's XML structure provides a natural mapping for properties file content. Each property namespace becomes a section element, keys become paragraphs with emphasized labels, and comments transform into annotations. The format's strict XML schema ensures the document is well-formed and can be processed by any XML-aware tool, making it ideal for automated documentation pipelines.
One of FB2's unique strengths is its rich metadata system. The description element supports detailed cataloging information including title, author, genre, annotation, keywords, and publication date. When converting a Spring Boot application.properties file, this metadata can capture the application name, version, team, and deployment environment, making the configuration document easily searchable in digital library systems.
The self-contained nature of FB2 is particularly valuable for configuration documentation. Unlike EPUB, which is a ZIP archive of multiple files, FB2 is a single XML file that can be emailed, stored in document management systems, or version-controlled as a single artifact. Binary resources like diagrams are embedded as base64 within the XML, ensuring nothing gets lost during distribution.
Key Benefits of Converting Properties to FB2:
- Single-File Format: Self-contained XML document with no external dependencies
- Rich Metadata: Detailed cataloging with title, author, genre, and keywords
- XML Foundation: Parseable and transformable with standard XML tools (XSLT, XPath)
- Regional Compatibility: Widely supported on Eastern European e-readers and apps
- Structured Sections: Property namespaces map to FB2 sections with titles
- DRM-Free: No restrictions on sharing or distributing configuration docs
- Archival Quality: XML format ensures long-term readability and data preservation
Practical Examples
Example 1: Database Configuration to FB2 Document
Input Properties file (database.properties):
# Primary Database db.primary.driver=org.postgresql.Driver db.primary.url=jdbc:postgresql://master:5432/appdb db.primary.username=app_user db.primary.pool.max=25 db.primary.pool.min=5 # Read Replica db.replica.url=jdbc:postgresql://replica:5432/appdb db.replica.pool.max=50 db.replica.read-only=true
Output FB2 file (database.fb2):
<?xml version="1.0" encoding="UTF-8"?>
<FictionBook xmlns="http://www.gribuser.ru/xml/fictionbook/2.0">
<description>
<title-info>
<book-title>Database Configuration Reference</book-title>
<annotation><p>Configuration for primary and replica databases</p></annotation>
<lang>en</lang>
</title-info>
</description>
<body>
<section>
<title><p>Primary Database</p></title>
<p><strong>Driver:</strong> org.postgresql.Driver</p>
<p><strong>URL:</strong> jdbc:postgresql://master:5432/appdb</p>
<p><strong>Username:</strong> app_user</p>
<p><strong>Pool Max:</strong> 25 | <strong>Pool Min:</strong> 5</p>
</section>
<section>
<title><p>Read Replica</p></title>
<p><strong>URL:</strong> jdbc:postgresql://replica:5432/appdb</p>
<p><strong>Pool Max:</strong> 50 | <strong>Read-Only:</strong> true</p>
</section>
</body>
</FictionBook>
Example 2: Security Properties to FB2 Audit Document
Input Properties file (security.properties):
# Authentication security.auth.type=oauth2 security.auth.provider=keycloak security.auth.realm=production # Session Management security.session.timeout=1800 security.session.max-per-user=3 security.session.cookie.secure=true # CORS Policy security.cors.allowed-origins=https://app.example.com security.cors.allowed-methods=GET,POST,PUT,DELETE
Output FB2 file (security.fb2):
<body>
<title><p>Security Configuration Audit</p></title>
<section>
<title><p>Authentication</p></title>
<p><strong>Type:</strong> OAuth 2.0</p>
<p><strong>Provider:</strong> Keycloak</p>
<p><strong>Realm:</strong> production</p>
</section>
<section>
<title><p>Session Management</p></title>
<p><strong>Timeout:</strong> 1800 seconds (30 minutes)</p>
<p><strong>Max Sessions Per User:</strong> 3</p>
<p><strong>Secure Cookie:</strong> true</p>
</section>
<section>
<title><p>CORS Policy</p></title>
<p><strong>Allowed Origins:</strong> https://app.example.com</p>
<p><strong>Allowed Methods:</strong> GET, POST, PUT, DELETE</p>
</section>
</body>
Example 3: Localization Bundle to FB2 Translation Reference
Input Properties file (messages_ru.properties):
# Russian Translations app.name=\u041C\u043E\u0451 \u041F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435 menu.home=\u0413\u043B\u0430\u0432\u043D\u0430\u044F menu.settings=\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 button.save=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C button.cancel=\u041E\u0442\u043C\u0435\u043D\u0430 button.delete=\u0423\u0434\u0430\u043B\u0438\u0442\u044C
Output FB2 file (messages_ru.fb2):
<FictionBook xmlns="http://www.gribuser.ru/xml/fictionbook/2.0">
<description>
<title-info>
<book-title>Russian Translation Bundle</book-title>
<lang>ru</lang>
</title-info>
</description>
<body>
<section>
<title><p>Application Labels</p></title>
<table>
<tr><th>Key</th><th>Russian</th></tr>
<tr><td>app.name</td><td>Моё Приложение</td></tr>
<tr><td>menu.home</td><td>Главная</td></tr>
<tr><td>menu.settings</td><td>Настройки</td></tr>
</table>
</section>
<section>
<title><p>Button Labels</p></title>
<table>
<tr><th>Key</th><th>Russian</th></tr>
<tr><td>button.save</td><td>Сохранить</td></tr>
<tr><td>button.cancel</td><td>Отмена</td></tr>
<tr><td>button.delete</td><td>Удалить</td></tr>
</table>
</section>
</body>
</FictionBook>
Frequently Asked Questions (FAQ)
Q: What is the FB2 (FictionBook) format?
A: FictionBook 2 (FB2) is an XML-based e-book format created in Russia. It uses a strict XML schema to define document structure including sections, paragraphs, tables, footnotes, and embedded images. FB2 is the dominant e-book format in Russia and Eastern Europe, supported by readers like FBReader, CoolReader, and hardware devices from PocketBook and ONYX Boox.
Q: How does FB2 handle properties with Unicode escape sequences?
A: Java Properties files use \uXXXX escape sequences for non-ASCII characters. The converter decodes these into proper Unicode characters and stores them in the FB2 file using UTF-8 encoding. Since FB2 is XML-based, all Unicode characters are natively supported, making this conversion particularly useful for i18n bundles containing Cyrillic, Asian, or other non-Latin scripts.
Q: Can I read the converted FB2 file on a PocketBook device?
A: Yes. PocketBook e-readers have native FB2 support and are one of the best platforms for reading FB2 files. The converted configuration document will display with proper section navigation, formatted tables, and full Unicode character support. PocketBook devices also support bookmarking and text search for quick reference.
Q: Why choose FB2 over EPUB for configuration documentation?
A: FB2 offers several advantages: it is a single XML file (not a ZIP archive), making it easier to version control and parse with XML tools. The strict schema ensures structural consistency. FB2's metadata system is excellent for cataloging. If your team uses PocketBook or ONYX Boox devices, or if your audience is in Eastern Europe, FB2 is the natural choice.
Q: How are property namespaces organized in the FB2 document?
A: The converter analyzes dotted property names and groups them by top-level namespace. Each namespace (e.g., "spring.datasource", "security.cors") becomes a section element with a title. Individual properties within each section are displayed as labeled paragraphs or table rows, creating a clear hierarchical structure that mirrors the original namespace organization.
Q: Are comments preserved in the FB2 output?
A: Yes, comment lines (# and !) from the properties file are preserved as descriptive paragraphs within the corresponding FB2 sections. They appear as italicized text before the property groups they annotate, maintaining the documentation context that developers included in the original configuration file.
Q: Can I convert the FB2 output to other formats?
A: Absolutely. Since FB2 is well-structured XML, it can be easily transformed using XSLT stylesheets. Calibre can convert FB2 to EPUB, MOBI, PDF, and many other formats. This makes FB2 a useful intermediate format: convert your properties to FB2 once, then generate any other format you need from the FB2 source.
Q: Does the FB2 include metadata about the properties file?
A: Yes, the FB2 description element is populated with relevant metadata: the original filename becomes the book title, the property count and namespace summary appear in the annotation, and keywords are extracted from the configuration domain (e.g., "database", "security", "cache"). This metadata enables efficient cataloging in FB2 library management tools.