Generate PDF Skill
Overview
Use the Generate PDF skill when your agent needs to turn its final answer into a polished document. This is a strong fit for summaries, reports, proposals, one-page briefs, customer handouts, and internal review packets.
The skill can work on its own, or it can be paired with Render Chart so your agent can create a chart first and then place that chart inside a PDF report.
Who This Is For
Salesforce admins, solution architects, and operations teams who are extending custom agents with document-generation skills.
What The Skill Does
- Creates a PDF from agent-authored HTML or Markdown.
- Returns a download link for the finished document.
- Can attach the PDF to a Salesforce record when record context is available.
- Works well for both simple one-page outputs and more structured multi-section documents.
Best Use Cases
- Executive summaries
- Opportunity briefs
- Proposal cover sheets
- Project status reports
- QBR and monthly review packets
- Customer-facing reports that include charts or branded sections
Input Style
This skill works best when your prompt tells the agent to produce:
- raw HTML when layout matters
- raw Markdown when the document is mostly headings, lists, and tables
For most branded or chart-heavy documents, HTML is the better choice.
Page Margins And Image Sizing
When a PDF includes charts, logos, or screenshots, layout instructions matter.
Charts created by Render Chart are PNG images, so they should be embedded like normal images inside the HTML report. Ask the agent to:
- use modest page margins so the content has room
- keep chart images full-width within the content area
- keep image height automatic
- avoid oversized body padding when the goal is a chart-first report
Simple prompt language works well:
Create the PDF in HTML. Use a letter-sized page with margins of about 0.45in. Make the chart image use the full content width and keep the height automatic.
Pairing With Render Chart
Generate PDF is especially useful when paired with Render Chart:
- The agent gathers or receives the labels and numeric values.
- The agent calls
render_chartto create a chart image. - The agent calls
generate_pdfand places that chart inside the HTML document. - The user receives a downloadable PDF report with the chart already embedded.
This pairing is ideal for:
- monthly revenue trend reports
- pipeline stage summaries
- by-region performance comparisons
- quota attainment snapshots
- activity reports with simple business charts
Admin Setup Checklist
- Add the
generate_pdfskill to the agent. - If you want chart-based reports, also add the
render_chartskill. - Set the agent model to a GPT-5 family model that supports tool use.
- Update the system prompt so the agent knows when to create a PDF and when to create a chart first.
- If you want record attachment behavior, make sure the request includes record context and the user can create Salesforce Files.
Prompt Guidance Snippets
Use snippets like these in your custom agent system prompt.
General PDF Output
When the user asks for a downloadable document, call generate_pdf.
Create a clean, business-ready document with a title, sections, and a short summary.
Use HTML when layout matters.
Include a clear PDF filename in the document head.
Chart-Based PDF Report
When the user asks for a report with a chart, first call render_chart using the exact labels and values available in context.
Then call generate_pdf and embed the chart image returned by render_chart into the HTML report.
Use a line chart for trends over time and a bar chart for category comparisons.
Use page margins of about half an inch.
Make each chart image fill the available content width and keep the height automatic.
Short One-Page Brief
When the user asks for a one-page brief, create a concise PDF with a title, a short summary paragraph, and 3 to 5 bullet points.
Keep the tone business-ready and easy to scan.
Example Agent Behaviors
Example: Monthly Revenue Report
User request:
Create a PDF report showing monthly revenue from January through April and include a trend chart.
Good agent behavior:
- call
render_chartwith the months and revenue values - create an HTML report
- call
generate_pdf - return the PDF download link
Example: Opportunity Summary
User request:
Create a PDF summary for this opportunity with the key details, next steps, and pricing summary.
Good agent behavior:
- skip chart generation if no chart is needed
- create a concise HTML or Markdown summary
- call
generate_pdf
Tips For Better Results
- Tell the agent what kind of document to create: report, summary, proposal, handout, or brief.
- Tell the agent whether the output should be one page or multi-page.
- Use HTML when you care about layout, spacing, section styling, or chart placement.
- If charts are involved, tell the agent to render the chart first and then build the PDF.
- For chart-heavy PDFs, tell the agent to use modest page margins and full-width chart images.
- Give the agent a clear filename pattern when your team needs consistent outputs.
Troubleshooting
- No PDF was created: check that the agent actually has the
generate_pdfskill enabled. - The chart is missing: add prompt guidance telling the agent to call
render_chartfirst and then embed the returned chart image in the PDF. - The layout is plain: steer the agent toward HTML rather than Markdown.
- The chart is clipped or too small: tell the agent to use a letter-sized page, margins of about 0.45in, and a full-width chart image with automatic height.
- The file was not attached to Salesforce: make sure the request included record context and the user can create Files.