A web application that converts Markdown text to PDF files using Spring Boot backend and a simple HTML/JavaScript frontend.
- Convert Markdown to beautifully formatted PDF documents
- Real-time conversion with user-friendly interface
- Support for common Markdown elements:
- Headers (H1-H6)
- Bold and italic text
- Lists (ordered and unordered)
- Code blocks and inline code
- Blockquotes
- Tables
- Responsive web design
- Download PDF directly from browser
- Java 17+ with Spring Boot
- Spring Web for REST API
- Apache PDFBox or similar library for PDF generation
- CORS configured for cross-origin requests
- HTML5 with modern CSS
- Vanilla JavaScript for API interaction
- Fetch API for HTTP requests
/
├── backend/
│ ├── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ └── com/
│ └── example/
│ └── markdownconverter/
│ ├── MarkdownConverterApplication.java
│ └── PdfController.java
├── frontend/
│ └── index.html
├── ci.yml
└── README.md
Converts Markdown text to PDF.
Request Body:
{
"markdown": "# Your Markdown Content\n\nThis will be converted to PDF."
}Response:
- Content-Type:
application/pdf - Content-Disposition:
attachment; filename="document.pdf" - Body: PDF file bytes
- Java 17 or higher
- Maven 3.6+
- Modern web browser
cd backend
mvn clean install
mvn spring-boot:runThe backend will start on http://localhost:8080
cd frontend
python3 -m http.server 3000The frontend will be available at http://localhost:3000
This project is configured for Codesphere deployment using the ci.yml configuration file. Codesphere will automatically:
- Install dependencies for both frontend and backend
- Run tests
- Start both services with proper networking configuration
- Route frontend requests to
/and API requests to/api
- Open the web application
- Enter your Markdown content in the textarea
- Click "Convert to PDF"
- The PDF will be automatically downloaded
Ctrl + Enter: Convert to PDF
# Sample Document
This is a **bold** text and this is *italic*.
## Features
- Convert Markdown to PDF
- Beautiful styling
- Easy to use
```javascript
console.log('Hello, World!');This is a blockquote example.
| Feature | Status |
|---|---|
| Markdown Support | ✅ |
| PDF Generation | ✅ |
| Styling | ✅ |
## Dependencies
### Backend Dependencies
- `spring-boot-starter-web`: Web framework and REST API
- `spring-boot-starter`: Core Spring Boot features
- Markdown parsing library (configured in pom.xml)
- PDF generation library (configured in pom.xml)
### Frontend Dependencies
- No external dependencies - uses vanilla JavaScript
## License
This project is a template for Codesphere applications.