15 September 2026
Converting Apple RTFD Bundles to Markdown: Rich Text & Attachment Extraction
Converting Apple RTFD Bundles to Markdown: Rich Text & Attachment Extraction
In macOS and NeXTSTEP, Apple TextEdit, Pages, and Apple Mail utilize a document format known as RTFD (Rich Text Format Directory). When users insert images, diagrams, or file attachments into a rich text document on a Mac, TextEdit converts the document from a single .rtf file into an .rtfd package folder.
Because non-Apple operating systems (Windows, Linux, Android) and web browsers cannot open or parse RTFD directory packages directly, converting them into clean GitHub Flavored Markdown (GFM) with linked attachments is essential for cross-platform sharing and publishing.
1. The Anatomy of an RTFD Bundle
On macOS filesystems, an .rtfd document appears as a single unified document icon, but it is actually a directory package:
Document.rtfd/
├── TXT.rtf # Core styled rich text stream
├── figure1.png # Embedded raster illustration
├── chart.pdf # Vector graphic attachment
└── diagram.tiff # Legacy image scan
When uploaded or shared outside macOS, the folder is typically zipped into an archive. convrtr transparently unpacks both zipped archives and raw streams in browser memory.
2. Parsing Rich Text Streams (TXT.rtf)
The primary text content resides in TXT.rtf. convrtr parses the RTF control words using a stack-based state machine:
- Typography: Bold (
\b), italic (\i), strikethrough (\strike), and monospace fonts (\f0) map to standard Markdown markdown tokens (**,*,~~,`). - Headings: Font sizes scaled above standard body text (such as 18pt or 24pt) are promoted to ATX headings (
#,##,###). - Lists & Paragraphs: Control words like
\parand bullet lists format into clean semantic paragraph blocks and list items.
3. Resolving and Linking Graphic Attachments
In RTFD documents, embedded images are referenced either via NeXT graphic control words (\NeXTGraphic filename) or by inspecting the bundle directory for attached image assets.
convrtr catalogs all media files within the archive:
- Images (
.png,.jpg,.webp,.svg,.tiff): Inserted into the Markdown flow as standard Markdown images: - Other Attachments: Listed in an appendix section as downloadable hyperlinks.
- YAML Frontmatter: Attachment filenames and document metadata are cataloged in clean YAML headers.
4. Complete Client-Side Confidentiality
All RTFD package extraction, RTF parsing, and Markdown generation occur strictly inside your web browser. Confidential notes, legal agreements, and proprietary diagrams never leave your machine.
Related reading
Converting Emacs Org Mode to Markdown: Outlines, Tables, and Checklists
Explore the syntax and semantics of Emacs Org Mode (.org). Learn how asterisk headings, TODO states, priority tags, Org Calc tables, and code blocks translate to GitHub Flavored Markdown.
Converting FictionBook 2.0 (FB2) E-Books to Markdown: XML Structure and Semantics
Explore the FictionBook 2.0 (.fb2) architecture. Learn how semantic XML e-book structures, epigraphs, poems, footnotes, and metadata are converted into clean GitHub Flavored Markdown.
Converting AbiWord (.abw, .zabw) to Markdown: Open-Source Word Processing Recovery
Examine AbiWord's native AWML XML document architecture. Learn how Dublin Core metadata, 2D table grids, styled character spans, GZIP compression, and base64 illustrations convert into clean Markdown.
Converting Hangul Word Processor (HWP) to Markdown: OLE CFB & Deflate Forensics
Unpack Hancom Hangul HWP 5.x compound documents. Discover how OLE 2.0 CFB directory tables, Deflate stream decompression, and HWPTAG_PARA_TEXT record parsers extract clean Markdown in browser memory.
Converting ClarisWorks and AppleWorks CWK to Markdown: Recovering Vintage Mac Documents
Learn how to extract text, paragraphs, and headings from vintage ClarisWorks and AppleWorks (.cwk) MacBinary files into clean GitHub Flavored Markdown with 100% private in-browser decoding.
Converting OpenOffice SXW to Markdown: Unpacking Pre-ODF XML Document Archives
Learn how OpenOffice.org 1.x and StarOffice Writer (.sxw) XML packages work. Discover how to extract text, tables, and lists into clean Markdown directly in your browser.
Converting StarOffice & StarWriter (SDW) to Markdown: OLE Compound Binary Forensics
Recover text, headings, bullet lists, and metadata from vintage StarOffice 3.x–5.x (.sdw) word processing documents. Learn how OLE CFB streams unpack to GitHub Flavored Markdown.
Converting Compressed AbiWord (ZABW) to Markdown: Gzip XML Document Extraction
Learn how AbiWord's compressed .zabw document format packages rich word processing XML inside Gzip containers, and how to convert it to clean GitHub Flavored Markdown.
Converting Wolfram Mathematica Notebooks (.nb) to Markdown: Hierarchical Expression Tree Extraction
Learn how Wolfram Mathematica (.nb) computational notebooks store hierarchical expression trees and 2D box formulas, and how convrtr translates them to clean GitHub Flavored Markdown.