Sub topic 12
Export a Consistent Carousel PDF
Assume you know how to create slides in a design tool or write basic Python. You also need a PDF viewer so you can inspect the exported file before uploading it. This chapter focuses on the final production step: making every page behave like one LinkedIn document post.
Choose one page size
A LinkedIn carousel is uploaded as a multi-page PDF. Each PDF page becomes one swipe. The pages should share the same width, height, margins, and visual grid.
A portrait page usually works well because most readers view LinkedIn on a phone. A 4:5 ratio gives you room for readable text without creating an unusually tall page. The exact dimensions matter less than using the same dimensions everywhere.
| Setting | Practical choice | Reason |
|---|---|---|
| Page ratio | 4:5 portrait | Fits a mobile reading pattern |
| Page size | 8 × 10 inches | Simple, consistent canvas |
| Margins | At least 0.5 inch | Keeps text away from the edges |
| Body text | Large enough to read at phone size | Prevents zooming and abandonment |
Do not mix portrait and landscape pages. Do not export some slides as images and others as editable pages. Inconsistent dimensions can create awkward scaling or cropping during upload.
Use a fixed layout system
A layout system is a small set of rules that controls placement. Define the page size, margins, title position, body position, colors, and type sizes before laying out every page.
Keep one main idea on each page. A hook page can use a large title. Body pages can use a short heading and two or three supporting points. The final page can reserve space for the next step. These page roles may differ, but their alignment and style should remain recognizable.
from reportlab.pdfgen import canvas
from reportlab.lib.colors import HexColor
import textwrap
PAGE_WIDTH = 576 # 8 inches at 72 points per inch
PAGE_HEIGHT = 720 # 10 inches at 72 points per inch
MARGIN = 48
slides = [
("Three lessons from the report", "Swipe for the findings."),
("Lesson 1", "Teams reduced tool overlap by clarifying ownership."),
("Try this next", "Map each tool to one owner before adding another."),
]
pdf = canvas.Canvas("carousel.pdf", pagesize=(PAGE_WIDTH, PAGE_HEIGHT))
navy = HexColor("#102A43")
blue = HexColor("#1976D2")
for title, body in slides:
pdf.setFillColor(navy)
pdf.rect(0, 0, PAGE_WIDTH, PAGE_HEIGHT, fill=1, stroke=0)
pdf.setFillColor(blue)
pdf.rect(MARGIN, PAGE_HEIGHT - 100, 72, 8, fill=1, stroke=0)
pdf.setFillColor(HexColor("#FFFFFF"))
pdf.setFont("Helvetica-Bold", 34)
title_y = PAGE_HEIGHT - 180
for line in textwrap.wrap(title, width=24):
pdf.drawString(MARGIN, title_y, line)
title_y -= 42
pdf.setFont("Helvetica", 20)
body_y = title_y - 24
for line in textwrap.wrap(body, width=38):
pdf.drawString(MARGIN, body_y, line)
body_y -= 30
pdf.showPage()
pdf.save()
print("Wrote carousel.pdf")The example uses the same canvas and margin for every page. It also wraps long text so it does not run beyond the page boundary. If you use a design application, create one master page or template and duplicate it. Change only the content that belongs to each slide.
Validate before uploading
Open the exported PDF and inspect it at several zoom levels. Check that:
- Every page has the same dimensions and orientation.
- No title, footer, or logo touches the edge.
- Text is readable without extreme zooming.
- Fonts, colors, and spacing remain consistent.
- Page numbers or progress markers follow one pattern.
- Links and special characters render correctly.
- The file opens on both a computer and a phone.
A PDF can look correct in the source tool but fail after export because of missing fonts, flattened transparency, unexpected cropping, or altered line breaks. Review the exported file, not only the editable source.
Exercise
Why should you inspect the exported PDF instead of trusting the editable slide file?
Show answer
Export can change fonts, line breaks, transparency, cropping, or page dimensions. The PDF is the file readers and LinkedIn will actually receive.