Use Pega’s built-in HTMLToPDF capability (and, where applicable, pyViewAsPDF) to turn controlled HTML or a Pega HTML stream into PDF bytes. You then decide whether to display/download those bytes or attach them to a case. The exact activity parameters and supported options vary by Pega release, so verify them in the documentation and activity definition for your deployed version rather than copying an old example unchanged.
What Pega’s HTML-to-PDF path does
Pega renders an HTML source, stream, or HTML rule through its PDF-generation capability. The result is a PDF document that can be returned to a browser, presented through a PDF-viewing flow, or persisted as an attachment on a work object. Creating the bytes and delivering them are separate concerns: first produce a valid PDF, then choose the user experience and storage lifecycle.
This is a print layout, not a guarantee of pixel-for-pixel reproduction of the interactive browser UI. Responsive behavior, dynamic layouts, JavaScript-driven widgets, and screen-only controls may need a purpose-built printable representation.
Choose the input and delivery model
| Approach | Best fit | Checks and trade-offs |
|---|---|---|
Built-in HTMLToPDF or pyViewAsPDF |
Controlled HTML or a Pega HTML stream that must become a PDF | Confirm parameter names, source-property expectations, and output handling in the deployed release. |
| Generate from selected section content | A document assembled from case data and selected application sections | Reuse can be convenient, but screen CSS and dynamic behavior may not transfer cleanly. Validate HTML-rule includes and printable styles in your application. |
| View or download | A user needs an immediate document | Use the viewing/download flow appropriate to your release and security model. |
| Attach to a case | The PDF must become part of the work-object record | Choose attachment activity and persistence behavior deliberately; confirm permissions, file naming, and retention. |
Prepare printable HTML
- Define the document contract. Decide which fields, tables, headers, footers, page numbers, and legal text belong in the PDF. Do not assume every control visible on the screen belongs in the document.
- Create a print-oriented source. Use an HTML stream/rule or another controlled HTML string. Keep semantic structure explicit: headings, tables, paragraphs, and lists are more reliable than deeply nested screen-layout markup.
- Resolve application data first. Populate the source in the correct case and user context before calling the conversion activity. Verify that authorization rules do not hide required values or expose values the recipient should not see.
- Design for pagination. Set sensible widths, avoid oversized fixed-position elements, and test long text, wide tables, empty values, and page breaks. A print stylesheet is usually easier to control than trying to reuse every interactive skin rule.
Step-by-step Pega implementation
1. Identify the deployed release
Record the exact Pega Platform version and the application’s UI and ruleset configuration. The names and supported parameters documented for one release may not be valid in another. Older support material, for example, labels some parameter tables as applying only to Pega Platform 8.2 and earlier and points readers to newer guidance for later releases.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
2. Build or resolve the HTML source
Use a purpose-built HTML rule/stream or generate the HTML in the application context. Community examples show section includes inside an HTML rule, but that is a technique to validate—not a universal recipe. Confirm that included sections resolve correctly when rendered outside the interactive screen and that their CSS is available to the PDF renderer.
3. Invoke the built-in conversion activity
Open the HTMLToPDF activity available in your environment and inspect its parameter form and output properties. Supply the HTML content or stream using the names shown by that activity in your release. Capture the resulting PDF bytes or file reference. Do not hard-code parameter names from a forum post without checking the activity definition.
4. Deliver the result
For an immediate result, send the generated PDF through the supported view/download path, commonly described with pyViewAsPDF in Pega documentation. For persistence, use the attachment workflow suitable for your case type and release. Set a meaningful filename, enforce authorization, and verify that the attachment is committed with the intended case transaction.
5. Test with production-shaped data
Render short and long cases, multiple pages, tables that cross page boundaries, rich text, missing values, non-ASCII characters, and user-specific visibility. Compare the output against the intended print design, not merely the browser screen.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
CSS, layouts, and pagination limits
Pega documentation for the 8.5 user-experience guide says the application skin CSS is applied by default and describes enabling CSS use and supplying a stylesheet for customization. Check how your target release loads styles before relying on application-wide skin rules.
That same guidance identifies dynamic layout groups as unsupported for HTMLToPDF and recommends free-form or smart layouts for printable forms. If a screen depends on dynamic layout behavior, create a print-specific structure instead of expecting the renderer to reproduce it.
- Prefer ordinary block flow, explicit table markup, and predictable widths.
- Keep print-only CSS small and scoped so it cannot change the interactive view.
- Use tested page-break rules and allow long text to wrap.
- Check images, fonts, borders, and background colors under the renderer used by your release.
- Do not treat a successful HTTP response as proof that every visual element rendered correctly.
Common failures and how to troubleshoot them
Missing line breaks or collapsed rich text
Support troubleshooting material describes missing line breaks in rich-text output and points to defective custom CSS as one possible cause. Temporarily remove custom rules, render a minimal known-good fragment, and reintroduce styles in small groups. Confirm that the HTML contains real paragraph or break elements rather than visual spacing created only by the browser.
Missing table borders or empty cells
Support guidance discusses missing borders and empty cells and includes compact styling and HTML-preprocessing settings among the options to investigate. These are release-specific troubleshooting leads, not universal fixes. Reproduce the issue with a small table, inspect the generated HTML, and verify which options your release supports before changing production settings.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Sections render blank
Check that the section is resolved in the same application and data context as the case, that required properties are populated, and that the HTML stream actually contains markup before conversion. A section that relies on client-side JavaScript may need server-rendered print HTML.
Styles appear to be ignored
Confirm that the stylesheet is available to the PDF renderer, that selectors are scoped to the generated document, and that your release supports the CSS features you use. Start with simple selectors and inline or explicitly supplied print CSS, then add complexity.
Output works in one environment but not another
Compare Pega versions, application skins, ruleset versions, fonts, image accessibility, and security headers. Recheck the activity parameter form in the target environment; historical examples may use options that were renamed, removed, or replaced.
PDF is created but cannot be downloaded or attached
Separate conversion from delivery while diagnosing. Log whether PDF bytes were produced, then inspect the view/download or attachment step, authorization, transaction status, file size limits, and filename handling. Older Pega help describes separate activities for viewing and attaching PDFs, so do not assume generation automatically persists a file.
Recommended Free Tools
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Performance, reliability, and security considerations
- Control input size: very large HTML, high-resolution images, and long tables increase rendering time and memory use. Generate only the content required for the document.
- Make retries safe: if a conversion is retried, avoid creating duplicate case attachments unless your process deliberately versions them.
- Use representative tests: pagination defects often appear only with realistic text lengths, data volume, and locale-specific characters.
- Protect sensitive data: apply the same authorization and masking rules used for the case. Do not expose a PDF endpoint that accepts arbitrary HTML or an arbitrary case identifier.
- Validate external resources: images, fonts, and stylesheets must be reachable by the renderer under the environment’s network and authentication rules.
- Track release changes: keep the Pega version, activity configuration, CSS source, and test fixtures together so upgrades can be regression-tested.
Or skip the browser setup
If your actual need is a clean image or PDF of a rendered Pega page rather than a server-generated case document, ScreenshotNeo provides a single HTTP call. It accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients.
See the ScreenshotNeo documentation for all options, including full-page capture, lazy-image loading, CSS-selector element capture, device and retina settings, PDF paper size and page ranges, custom CSS and JavaScript, clicks, waits, request blocking, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, caching, signed links, asynchronous webhooks, bulk capture, usage reporting, and OpenAPI compatibility.
cURL
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://screenshotneo.com -o shot.webp
Python
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://screenshotneo.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
Node.js
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://screenshotneo.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
The Free plan includes 1,000 screenshots each month with no card required. Paid plans start at $5 for 3,000 shots; every feature is available on every plan, and yearly billing provides two months free. Sign up free for ScreenshotNeo.
FAQ
Does HTMLToPDF reproduce the browser UI exactly?
No. It produces a print-oriented PDF, and unsupported dynamic layouts or screen-only behavior can differ from the interactive page.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteShould I attach every generated PDF to the case?
Only when the document is part of the case record. For transient previews or downloads, avoid unnecessary persistence and define an explicit retention policy for attachments.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Can I copy parameters from an older Pega example?
Use older examples as clues only. Inspect the activity and current documentation for your deployed release, especially when an example targets Pega Platform 8.2 or earlier.
Frequently Asked Questions
What is the safest first test?
Render a small, static HTML fragment through the activity, verify the PDF bytes, and then add real sections, styles, images, and pagination one category at a time.
Why create separate printable HTML instead of reusing a section?
A print template gives you control over pagination, visibility, and CSS when the interactive section depends on dynamic layouts or client-side behavior.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

