Introduction
PDF export is one of the most powerful features of Markdown Magic. Whether you're creating reports, documentation, or professional documents, the ability to generate high-quality PDFs from markdown can save you countless hours.
In this guide, we'll explore the design principles and techniques for creating professional PDF documents that look great and are easy to read.
Design Principles
1. Typography Hierarchy
Establish clear visual hierarchy with consistent typography:
# Main Title (32px, Bold)
## Section Header (24px, Bold)
### Subsection (20px, Semibold)
#### Sub-subsection (18px, Medium)
Body text (16px, Regular)
- Bullet points (16px, Regular)
> Blockquotes (16px, Italic)
Code blocks (14px, Monospace)
Footnotes (12px, Regular)2. Color Scheme
Use a consistent color palette for professional appearance:
Minimal Theme
Black text on white
Gray accents
Blue links
Modern Theme
Dark gray text
Teal accents
Underlined links
Dark Theme
Light gray text
Blue accents
Cyan highlights
3. Spacing and Layout
Proper spacing improves readability significantly:
Page margins: 1 inch (2.54cm)
Line height: 1.5x font size
Paragraph spacing: 12pt
Section spacing: 24pt
Header/footer margin: 0.5 inchAdvanced Configuration
1. Page Setup
{
"pageSize": "A4",
"orientation": "portrait",
"margins": {
"top": "2.54cm",
"bottom": "2.54cm",
"left": "2.54cm",
"right": "2.54cm"
},
"bleed": "0.25cm"
}2. Headers and Footers
{
"header": {
"center": "Document Title",
"fontSize": "10pt",
"fontStyle": "italic"
},
"footer": {
"left": "Company Name",
"center": "Page {pageNumber}",
"right": "{date}",
"fontSize": "9pt"
}
}3. Table of Contents
Auto-generate a professional table of contents:
# Table of Contents
{{toc}}
## Chapter 1
Content here...
## Chapter 2
More content...
<!-- Table of contents will be automatically generated -->Content Optimization
1. Images and Graphics
Optimize images for PDF output:
2. Tables and Data
Create professional tables with proper formatting:
| Feature | Description | Status |
|---------|-------------|--------|
| Export | PDF generation | ✅ Complete |
| Themes | Multiple styles | 🚧 In Progress |
| API | REST interface | 📋 Planned |
<!-- Use emojis for visual interest -->3. Code Blocks
Format code for maximum readability:
```javascript
// Example with syntax highlighting
function generatePDF(content) {
const options = {
theme: 'minimal',
pageSize: 'A4'
};
return pdfGenerator.create(content, options);
}
```Quality Assurance
Proofreading
Always review the generated PDF for formatting issues and typos.
Cross-Platform Testing
Test PDFs on different devices and PDF readers.
File Size Optimization
Balance quality with file size for easy sharing.
Conclusion
Creating professional PDFs from markdown is both an art and a science. By following these design principles and best practices, you can create documents that are not only informative but also visually appealing and professional.
Remember that the goal is to enhance your content, not distract from it. Use these techniques thoughtfully and always prioritize readability and user experience.