couple-repo/work_chinese/PPT04122025/_build/generate.js
StillHammer 1d1d42b8d9 Add PowerPoint generation improvements for Alimentari Piccolo
- Fix html2pptx Windows file path handling (file:/// URLs)
- Fix Italian flag diagonal (remove CSS rotation, use positioned rectangles)
- Add Chinese character background watermark (意)
- Add geometric pattern attempt (Art Deco style)
- Fix validation errors (text positioning, margins)
- Add backup slides directory
- Add build scripts and image resources

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 11:21:54 +08:00

33 lines
1016 B
JavaScript

const pptxgen = require('pptxgenjs');
const html2pptx = require('../../../.claude/skills/pptx/scripts/html2pptx.js');
const path = require('path');
async function generatePresentation() {
console.log('🍝 Génération Alimentari Piccolo PowerPoint...\n');
const pptx = new pptxgen();
pptx.layout = 'LAYOUT_16x9';
pptx.author = 'Alexis - Xiezuo Course';
pptx.title = 'Alimentari Piccolo - 意大利餐吧评价';
pptx.subject = '餐厅评价作业';
const htmlFile = path.join(__dirname, 'alimentari_piccolo.html');
try {
await html2pptx(htmlFile, pptx, { tmpDir: __dirname });
const outputPath = path.join(__dirname, '..', 'Alimentari_Piccolo.pptx');
await pptx.writeFile({ fileName: outputPath });
console.log(`✅ Présentation créée avec succès: ${outputPath}`);
} catch (error) {
console.error('❌ Erreur lors de la génération:', error.message);
if (error.stack) {
console.error(error.stack);
}
process.exit(1);
}
}
generatePresentation();