DocStructure Planner
User Manual Outline CreatorProduct & Document Identification
Chapter 2: Setup & Installation
Chapter 3: Core Operation
Chapter 4: Maintenance & Troubleshooting
Product: ${data.product} | Version: ${data.version}
`; // --- CHAPTER 1: INTRODUCTION & SAFETY --- html += `CHAPTER 1: INTRODUCTION & SAFETY
`;
// A. Welcome
html += `1.1. Welcome and Document Scope
`;
html += `Brief summary of the product and manual purpose.
`;
// B. Safety
html += `1.2. Safety Warnings and Conventions
`;
html += `1.2.1. General Safety Precautions
`;
html += `1.2.2. Symbol and Icon Definitions
`;
// --- CHAPTER 2: SETUP AND INSTALLATION ---
html += `CHAPTER 2: SETUP AND INSTALLATION
`;
// A. Requirements
html += `2.1. System and Environmental Requirements
`;
html += `${data.reqs}
`;
// B. Procedure
html += `2.2. Installation Procedure
`;
html += `2.2.1. Unpacking and Component Check
`;
html += `2.2.2. Physical Mounting and Placement
`;
html += `2.2.3. Electrical and Network Connections
`;
html += `${data.install}
`;
// --- CHAPTER 3: CORE OPERATION ---
html += `CHAPTER 3: CORE OPERATION
`;
// A. Primary Functions
html += `3.1. Basic Operation and Primary Functions
`;
html += `${data.operation}
`;
// B. Advanced
html += `3.2. Advanced Features and Configuration
`;
html += `${data.advanced}
`;
// --- CHAPTER 4: MAINTENANCE AND TROUBLESHOOTING ---
html += `CHAPTER 4: MAINTENANCE AND TROUBLESHOOTING
`;
// A. Maintenance
html += `4.1. Routine Maintenance and Calibration
`;
html += `${data.maint}
`;
// B. Troubleshooting
html += `4.2. Troubleshooting Guide
`;
html += `${data.trouble}
`;
// --- CHAPTER 5: APPENDIX ---
html += `CHAPTER 5: APPENDIX
`;
html += `5.1. Technical Specifications Table
`;
html += `5.2. Warranty and Contact Information
`;
paper.innerHTML = html;
}
function umocSwitchTab(tabId) {
document.querySelectorAll('.umoc-tab-btn').forEach(b => b.classList.remove('active'));
document.querySelectorAll('.umoc-content').forEach(c => c.classList.remove('active'));
const idx = tabId === 'builder' ? 0 : 1;
document.querySelectorAll('.umoc-tab-btn')[idx].classList.add('active');
document.getElementById('umoc-' + tabId).classList.add('active');
if (tabId === 'preview') {
umocRenderOutline();
}
}
function umocLoadExample() {
if(!confirm("Overwrite current inputs with example data?")) return;
document.getElementById('inp-product').value = "Aero-Drone X-Wing Mk.II";
document.getElementById('inp-version').value = "v3.0 - 2026-Q1";
document.getElementById('inp-reqs').value = "Requires Windows 10/Mac OS 11+; GPS signal lock is mandatory for takeoff. Maintain a minimum of 200m clear radius for testing.";
document.getElementById('inp-install').value = "Attach rotors (ensure correct direction). Connect battery pack. Calibrate compass using the 8-point rotation procedure.";
document.getElementById('inp-operation').value = "Basic takeoff/landing controls. How to switch between manual and automated flight paths. Logging telemetry data.";
document.getElementById('inp-advanced').value = "Customizing PID settings for specialized payloads. Configuring geofencing parameters. Enabling API access for third-party control software.";
document.getElementById('inp-maint').value = "Rotor inspection checklist (every 50 flight hours). Cleaning camera lens. Performing firmware updates via USB-C.";
document.getElementById('inp-trouble').value = "Error Code 301: GPS Lock Failure (Solution: Move device to an open area). Drone drift during hover (Solution: Re-run IMU calibration).";
umocRenderOutline();
umocSwitchTab('preview');
}
/* --- PDF Generation --- */
async function umocGeneratePDF() {
umocRenderOutline(); // Final render
const { jsPDF } = window.jspdf;
const doc = new jsPDF('p', 'mm', 'a4');
const data = {
product: document.getElementById('inp-product').value || "PRODUCT NAME",
version: document.getElementById('inp-version').value || "VERSION",
reqs: document.getElementById('inp-reqs').value || "Hardware, software, and environmental requirements.",
install: document.getElementById('inp-install').value || "Detailed steps for mounting and electrical connection.",
operation: document.getElementById('inp-operation').value || "Step-by-step instructions for primary use cases.",
advanced: document.getElementById('inp-advanced').value || "Guidance on calibration and custom settings.",
maint: document.getElementById('inp-maint').value || "Cleaning procedures and update schedules.",
trouble: document.getElementById('inp-trouble').value || "Common error codes and user-level corrective actions."
};
const blue = [0, 119, 182];
let y = 20;
// Header
doc.setFillColor(...blue);
doc.rect(0, 0, 210, 20, 'F');
doc.setTextColor(255, 255, 255);
doc.setFontSize(16);
doc.text(`User Manual Outline: ${data.product}`, 14, 13);
doc.setTextColor(0, 0, 0);
doc.setFontSize(10);
doc.text(`Version: ${data.version}`, 14, 25);
y = 35;
// Helper function to add sections and content
function addSection(title, level, startY, content = null) {
if (startY > 270) { doc.addPage(); startY = 20; }
let color = [0, 0, 0];
let size = 12;
let margin = 14;
if (level === 1) { color = [52, 73, 94]; size = 14; margin = 14; }
else if (level === 2) { color = blue; size = 11; margin = 20; }
else if (level === 3) { color = [100, 100, 100]; size = 10; margin = 25; }
doc.setFontSize(size);
doc.setFont("helvetica", "bold");
doc.setTextColor(...color);
doc.text(title, margin, startY);
startY += size / 2 + 3;
if (content) {
doc.setFont("times", "normal");
doc.setTextColor(80, 80, 80);
doc.setFontSize(9);
const splitContent = doc.splitTextToSize(content, 180 - margin);
doc.text(splitContent, margin, startY);
startY += (splitContent.length * 4) + 5;
}
return startY;
}
// --- CHAPTER 1: INTRODUCTION & SAFETY ---
y = addSection("CHAPTER 1: INTRODUCTION & SAFETY", 1, y);
y = addSection("1.1. Welcome and Document Scope", 2, y, null);
y = addSection("1.2. Safety Warnings and Conventions", 2, y, null);
// --- CHAPTER 2: SETUP AND INSTALLATION ---
y = addSection("CHAPTER 2: SETUP AND INSTALLATION", 1, y);
y = addSection("2.1. System and Environmental Requirements", 2, y, data.reqs);
y = addSection("2.2. Installation Procedure", 2, y, data.install);
// --- CHAPTER 3: CORE OPERATION ---
y = addSection("CHAPTER 3: CORE OPERATION", 1, y);
y = addSection("3.1. Basic Operation and Primary Functions", 2, y, data.operation);
y = addSection("3.2. Advanced Features and Configuration", 2, y, data.advanced);
// --- CHAPTER 4: MAINTENANCE AND TROUBLESHOOTING ---
y = addSection("CHAPTER 4: MAINTENANCE AND TROUBLESHOOTING", 1, y);
y = addSection("4.1. Routine Maintenance and Calibration", 2, y, data.maint);
y = addSection("4.2. Troubleshooting Guide", 2, y, data.trouble);
// --- CHAPTER 5: APPENDIX ---
y = addSection("CHAPTER 5: APPENDIX", 1, y);
y = addSection("5.1. Technical Specifications Table", 2, y, null);
y = addSection("5.2. Warranty and Contact Information", 2, y, null);
doc.save(`Manual_Outline_${data.product.replace(/\s/g, '_')}.pdf`);
}
