A modern, powerful Markdown and HTML to PDF converter built with React and TypeScript.
- Dual Input Support: Process both Markdown (.md) and HTML (.html) files
- Dual Export Modes:
- Image PDF: Pixel-perfect visual match to preview (larger file size)
- Text PDF: Selectable text, smaller file size, faster export
- Live Preview: Real-time rendering with syntax highlighting
- Dark/Light Theme: Automatic theme switching with system preference
- Page Formats: A4, Letter, Legal
- Orientations: Portrait and Landscape
- Flexible Margins: Customizable margins in millimeters
- Typography Control:
- Adjustable font sizes for body, headings, and code
- Multiple font family options
- Advanced Markdown: GitHub Flavored Markdown with emoji support
- Drag & Drop Upload: Intuitive file upload interface
- Settings Panel: Comprehensive export configuration
- Progress Tracking: Real-time export progress indication
- Responsive Design: Works on desktop and mobile devices
- Keyboard Accessible: Full keyboard navigation support
- Draft Saving: Automatic local storage persistence
- Advanced Export Features: Table of Contents, Page Numbering styles
- Rich Typography: Custom fonts and premium table aesthetics
- Node.js 18.0 or higher
- npm or yarn package manager
-
Clone the repository
git clone https://github.com/heli-toon/docsculptor.git cd docsculptor -
Install dependencies
npm install # or yarn install -
Start development server
npm run dev # or yarn dev -
Open in browser Navigate to
http://localhost:5173
npm run build
# or
yarn build| Shortcut | Action |
|---|---|
Ctrl + E |
Export to PDF |
Ctrl + O |
Open File Dialog |
Ctrl + S |
Save Draft to Local Storage |
Ctrl + , |
Toggle Settings Panel |
- Upload Document: Drag and drop or click to select a Markdown or HTML file
- Preview: Review the rendered content in the live preview panel
- Configure: Adjust PDF settings in the settings panel (optional)
- Export: Click "Export PDF" to generate your document
.md- Markdown files.markdown- Markdown files.html- HTML files.htm- HTML files
.pdf- Portable Document Format
- Pros: Exact visual match to preview, preserves all styling
- Cons: Larger file size, text not selectable
- Best for: Documents with complex layouts, presentations
- Pros: Selectable text, smaller file size, faster generation
- Cons: Simplified styling, emojis removed
- Best for: Text-heavy documents, accessibility
| Setting | Options | Description |
|---|---|---|
| Export Mode | Image, Text | Choose between visual accuracy or text selectability |
| Page Format | A4, Letter, Legal | Standard paper sizes |
| Orientation | Portrait, Landscape | Page orientation |
| Margins | 0-50mm | Customizable page margins |
| Font Sizes | Adjustable | Separate controls for body, headings, and code |
| Font Families | Multiple options | Choose fonts for different text types |
| Table of Contents | Toggle | Auto-generate TOC from headings |
| Page Numbers | Style & Position | Customizable numbering (Simple, Total, Accent) |
DocSculptor supports GitHub Flavored Markdown including:
- Headers (H1-H6)
- Emphasis (bold, italic)
- Lists (ordered, unordered)
- Code blocks with syntax highlighting
- Inline code
- Links and images
- Tables
- Blockquotes
- Horizontal rules
- Emojis π (in Image PDF mode)
- Strikethrough
- Task lists
- Math equations (LaTeX/KaTeX syntax)
- Inline math:
$E = mc^2$ - Block math:
$$\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$$
- Inline math:
Inline equations: Use single dollar signs for inline math: $x^2 + y^2 = z^2$
Display equations: Use double dollar signs for block equations:
$$
\frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
$$Complex expressions:
$$
\begin{aligned}
\nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} &= \frac{4\pi}{c}\vec{\mathbf{j}} \\
\nabla \cdot \vec{\mathbf{E}} &= 4 \pi \rho \\
\nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} &= \vec{\mathbf{0}} \\
\nabla \cdot \vec{\mathbf{B}} &= 0
\end{aligned}
$$- Frontend Framework: React 18 with TypeScript
- Build Tool: Vite 5
- Styling: Tailwind CSS with Tailwind Typography
- Markdown Processing: Unified.js ecosystem
- remark-parse, remark-gfm, remark-emoji
- rehype-highlight for syntax highlighting
- PDF Generation:
- html2pdf.js (Image PDF)
- jsPDF (Text PDF)
- Theme Management: CSS variables with system preference detection
src/
βββ components/ # React components
β βββ FileUpload.tsx # File upload interface
β βββ Preview.tsx # Document preview
β βββ Settings.tsx # Configuration panel
β βββ Toolbar.tsx # Main toolbar
β βββ ThemeToggle.tsx # Theme switcher
βββ hooks/ # Custom React hooks
β βββ useMarkdown.ts # Markdown processing
β βββ usePdfExport.ts # PDF generation
β βββ useTextPdfExport.ts # Text PDF generation
β βββ useTheme.ts # Theme management
βββ types/ # TypeScript definitions
βββ App.tsx # Main application component
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Add tests if applicable
- Commit:
git commit -m 'Add amazing feature' - Push:
git push origin feature/amazing-feature - Open a Pull Request
- Use TypeScript for all new code
- Follow the existing code style
- Use meaningful component and variable names
- Add JSDoc comments for complex functions
- Ensure accessibility compliance
Found a bug? Please create an issue with:
- Description: Clear description of the issue
- Steps to Reproduce: Detailed steps to reproduce the bug
- Expected Behavior: What should happen
- Actual Behavior: What actually happens
- Environment: Browser, OS, file type
- Screenshots: If applicable
Have an idea? Check our ideas.txt file for planned features, or create an issue with:
- Feature Description: Clear description of the proposed feature
- Use Case: Why this feature would be useful
- Proposed Solution: How you envision it working
- Alternatives: Other solutions you've considered
This project is licensed under the MIT License - see the LICENSE file for details.
- Unified.js for excellent Markdown processing
- Tailwind CSS for utility-first styling
- React for the component framework
- Vite for lightning-fast development
- html2pdf.js for PDF generation
- All contributors and users of DocSculptor
If you find DocSculptor useful, please:
- β Star this repository
- π Report bugs
- π‘ Suggest new features
- π€ Contribute code
- π’ Share with others
- Project Link: https://github.com/heli-toon/docsculptor
- Issues: https://github.com/heli-toon/docsculptor/issues
Made with β€οΈ by the Salay Abdul Muhaimin Kanton
Transform your documents, sculpt your PDFs.