Skip to content

fix the issue of dowloading badge as PDF#8043

Open
Alishaa-987 wants to merge 1 commit into
JhaSourav07:mainfrom
Alishaa-987:fix/pdf-isometric-rendering
Open

fix the issue of dowloading badge as PDF#8043
Alishaa-987 wants to merge 1 commit into
JhaSourav07:mainfrom
Alishaa-987:fix/pdf-isometric-rendering

Conversation

@Alishaa-987

Copy link
Copy Markdown

Description

Fixes #7981

What changed:
Implemented the complete "Download PDF" functionality for the CommitPulse badge.

Previously, downloading the badge as a PDF was either broken or not implemented. I built out the full export pipeline to ensure users can export their 3D isometric stats seamlessly into a high-quality PDF.

Implementation details:

  • Created a robust SVG-to-Canvas rendering pipeline using standard DOM APIs.
  • Handled the complex CSS extraction for the .cp-bg-fill, .cp-text-fill, and .cp-accent-fill classes so the PDF matches the chosen theme perfectly.
  • Injected animation overrides (animation: none !important, transform: scaleY(1)) into the capture process so the HTML Canvas doesn't accidentally capture an invisible frame at 0s during the 3D tower entrance animation.
  • Integrated jspdf to properly dimension and export the final canvas output into a downloadable .pdf file.

Pillar

  • 🎨 Pillar 1 — New Theme Design
  • 📐 Pillar 2 — Geometric SVG Improvement
  • 🕐 Pillar 3 — Timezone Logic Optimization
  • 🛠️ Other (Feature / Core Functionality)

Visual Preview

image

Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally (localhost:3000/api/streak?user=YOUR_USERNAME).
  • I have run npm run format and npm run lint locally and resolved all errors (CI will fail otherwise).
  • My commits follow the Conventional Commits format (e.g., feat(export): ..., feat(pdf): ...).
  • I have updated README.md if I added a new theme or URL parameter.
  • I have started the repo.
  • I have made sure that i have only one commit to merge in this PR.
  • The SVG output matches the CommitPulse "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts).
  • (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.

@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

@Alishaa-987 is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Size Report (Gzipped Sizes)

Asset PR Size Base Size Difference Status
static/chunks/1144-[hash].js 2.15 KB - +2.15 KB (++100%) 🆕 New
static/chunks/2705-[hash].js 5.87 KB - +5.87 KB (++100%) 🆕 New
static/chunks/6420-[hash].js - 7.82 KB -7.82 KB (-100.00%) 🗑️ Deleted
static/chunks/app/page-[hash].js 20.60 KB 19.64 KB +0.96 KB (+4.89%) 🔴 Regression

📊 Summary of Totals

Category PR Size Base Size Difference
Total JS 3913.18 KB 3910.49 KB +2.69 KB (+0.07%)
Total CSS 326.92 KB 326.92 KB 0 B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PDF download fails for generated badge in dashboard

1 participant