LinkedIn Carousel Skill
Convert slides into LinkedIn-ready carousel PDFs.
Workflow Overview
- Choose input method: HTML slides (recommended), image folder, or PPTX
- Select format: Square (1080×1080) or Vertical (1080×1350)
- Generate PDF: Run script or use code pattern below
- Upload to LinkedIn: As document post
Quick Start
Option 1: HTML Slides to Carousel (Recommended)
const { chromium } = require('playwright');
const { PDFDocument } = require('pdf-lib');
const fs = require('fs');
const WIDTH = 1080, HEIGHT = 1080;
const slides = [`<html>...</html>`, `<html>...</html>`]; // Your HTML slides
async function createCarousel(outputPath) {
const browser = await chromium.launch({ headless: true });
const page = await browser.newPage();
await page.setViewportSize({ width: WIDTH, height: HEIGHT });
const pdfDoc = await PDFDocument.create();
for (const html of slides) {
await page.setContent(html, { waitUntil: 'networkidle' });
const img = await pdfDoc.embedPng(await page.screenshot({ type: 'png' }));
const p = pdfDoc.addPage([WIDTH * 0.75, HEIGHT * 0.75]);
p.drawImage(img, { x: 0, y: 0, width: p.getWidth(), height: p.getHeight() });
}
await browser.close();
fs.writeFileSync(outputPath, await pdfDoc.save());
}
createCarousel('carousel.pdf');
Option 2: Image Folder or PPTX
# From images
node scripts/pptx-to-carousel.js ./my-slides/ output.pdf --format square
# From PowerPoint (requires LibreOffice)
node scripts/pptx-to-carousel.js presentation.pptx carousel.pdf
Scripts Reference
| Script |
Usage |
pptx-to-carousel.js |
node scripts/pptx-to-carousel.js <input> [output.pdf] [--format square|vertical] |
render-slides.js |
renderSlidesToImages(htmlSlides, outputDir, width, height) |
LinkedIn Requirements
| Spec |
Value |
| Square |
1080×1080 px (recommended) |
| Vertical |
1080×1350 px |
| Safe zone |
960×960 px centered |
| Slides |
2-20 per carousel |
| Format |
Multi-page PDF |
Best Practices
- Hook slide first - Compelling title to drive swipes
- One idea per slide - Don't overcrowd
- CTA on final slide - Clear call to action
- Min 24pt font - Readable on mobile
- Consistent branding - Colors/style across slides
Dependencies
npm install playwright sharp pdf-lib adm-zip
npx playwright install chromium
References
- Detailed specs:
references/linkedin-specs.md
- Full examples:
references/examples.md