crewai - ✅(Solved) Fix Export as PDF [1 pull requests, 2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
crewAIInc/crewAI#4546Fetched 2026-04-08 00:41:32
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Timeline (top)
commented ×2labeled ×2closed ×1cross-referenced ×1

Fix Action

Fixed

PR fix notes

PR #4728: feat: support real PDF task exports (#4546)

Description (problem / solution / changelog)

Summary

This PR implements issue #4546.

  • Scope: Export as PDF
  • Source branch: yuweuii:codex/issue-4546
  • Commit: 5feda191

Linked Issue

Closes #4546

<!-- CURSOR_SUMMARY -->

[!NOTE] Medium Risk Touches core Task output persistence logic and adds a custom PDF byte generator, which could affect file-writing behavior and PDF correctness (though only for .pdf targets).

Overview Adds real PDF exports for task outputs. When Task.output_file ends with .pdf, _save_file now writes a generated %PDF-1.4 document containing the task output (stringified or pretty-printed JSON for dict results) instead of plain text.

Updates the Tasks docs to advertise the .pdf behavior, and adds tests asserting PDF headers/content and directory creation for PDF outputs.

<sup>Written by Cursor Bugbot for commit b09607bc28334867ef90f6f5987da1ce67980738. This will update automatically on new commits. Configure here.</sup>

<!-- /CURSOR_SUMMARY -->

Changed files

  • docs/en/concepts/tasks.mdx (modified, +1/-1)
  • lib/crewai/src/crewai/task.py (modified, +105/-7)
  • lib/crewai/tests/test_task.py (modified, +37/-0)
RAW_BUFFERClick to expand / collapse

Feature Area

Core functionality

Is your feature request related to a an existing bug? Please link it here.

No

Describe the solution you'd like

Please add an option to export as PDF as it could be very helpul.

Describe alternatives you've considered

No response

Additional context

No response

Willingness to Contribute

No, I'm just suggesting the idea

extent analysis

Fix Plan

To add an option to export as PDF, we can utilize a library like jsPDF in JavaScript. Here are the steps:

  • Install the jsPDF library using npm or yarn:
npm install jspdf
  • Import the library in your JavaScript file:
const jsPDF = require('jspdf');
  • Create a function to generate the PDF:
function generatePDF(data) {
  const doc = new jsPDF();
  doc.text('Your content here', 10, 10);
  doc.save('filename.pdf');
}
  • Replace 'Your content here' with the actual content you want to export.
  • Call the generatePDF function when the export button is clicked.

Verification

To verify that the fix worked, click the export button and check if a PDF file is generated with the expected content.

Extra Tips

  • You can customize the PDF content and layout using various jsPDF methods, such as doc.addPage(), doc.setFont(), and doc.setFontSize().
  • Make sure to handle errors and exceptions properly when generating the PDF.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

crewai - ✅(Solved) Fix Export as PDF [1 pull requests, 2 comments, 2 participants]