IronSoftware
  • Products
    for .NET Java Python
    Create, read, and edit PDFs
    for .NET
    Image to text in 127 languages
    for .NET
    Read and write QR & Barcodes
    for .NET
    Edit Excel & CSV Files.
    No Office Interop required
    for .NET
    Extract structured data from websites
    5 for the Price of 2 All 5 .NET product licenses from $1498 Save 60% with Iron Suite Iron Suites - Donate $50
  • Open Source
    for .NET
    System.Drawing.Common Replacement
    Free Software Development Tools
  • About Us

    Our Company

    • About Us 
    • Company News 
    • Environmental Commitments 
    • Beta Program 
    • Year in Review: 2022 

    Sales Partners

    • Global Resellers 

    Contact Us

    • Live Chat 
    • Send an Email 
    +1 (312) 500-3060
    205 N. Michigan Ave.
    Chicago, IL 60611, USA

    Careers at Iron

    Join our teamJoin our team
    We're hiring
  • Contact Us

205 N. Michigan Ave. Chicago, IL 60611, USA +1 (312) 500-3060

Join Iron Slack

  • Home
  • Licensing
  • EULA
  • Support & Update Extensions
  • License Upgrades
  • Start 30-Day Trial
  • Features
  • Get Started
  • Demos
  • Code Examples
  • Tutorials
  • How-Tos
  • Troubleshooting
  • Product Updates
  • API Reference
  • Search
  • Free NuGet Download
IronPDF Library for C# IronPDF Library for C#
  • IronPDF for Java
  • IronPDF for Python
  • Home
  • Licensing
    • Licensing
    • EULA
    • Support & Update Extensions
    • License Upgrades
    • Start 30-Day Trial
  • Features
  • Docs
    • Search
    • Get Started
    • Demos
    • Code Examples
    • Tutorials
    • How-Tos
    • Troubleshooting
    • Product Updates
    • API Reference
    • Search
  • Search CtrlK
  • Free NuGet Download Total downloads: 6,997,908
Message's icon
IronPDF
IronPDF
Iron Software Product Iron Software Documents

Search

CtrlK
  • Get Started
  • Demos
  • Code Examples
    • HTML to PDF
    • Generating PDFs in C#
    • Editing PDFs in C#
    • Viewing PDFs in MAUI
    • Compatibility
      • Install & Deploy IronPDF
      • License Keys
      • Setup on macOS
      • Setup on Docker
      • Setup on Linux
      • Setup on Azure
      • Setup on AWS
      • Coding with VB.NET
      • Coding with F#
      • Platform-Specific NuGet Packages
      • Use Windows Installer
      • Host your own IronPDF Container
    • Generating PDFs
      • PDF from HTML File
      • PDF from HTML String
      • PDF from URL
      • PDF from ASPX Pages
      • PDF from Razor View
      • PDF from ASP.NET MVC
      • XAML to PDF (MAUI)
      • Razor to PDF (Blazor Server)
      • CSHTML to PDF (Razor Pages)
      • CSHTML to PDF (MVC Core)
      • CSHTML to PDF (MVC Framework)
      • Convert DOCX to PDF
      • Convert RTF to PDF
      • Convert MD to PDF
      • Convert XML to PDF
      • PDF to Image
      • PDF to HTML
      • Generate PDF Reports
      • Work with PDF Images and CSS
      • Website & System Logins
      • Create PDFs in MAUI
      • Create PDFs in Blazor Servers
      • Support UTF-8 and International Languages
      • Async and Multithreading
      • Chrome PDF Rendering Engine
      • Use WaitFor to Delay PDF Render
    • Formatting PDFs
      • Debug HTML with Chrome
      • Custom and Responsive CSS
      • Use JavaScript with HTML to PDF
      • Set Fonts
      • Use SVG Graphics
      • Page Breaks
      • Add Page Numbers
      • Grayscale
      • Embed Images with DataURIs
      • Embed Images from Azure Blob Storage
      • Export PDF/A Format Docs in C#
      • Export PDF/UA Format Docs in C#
    • Editing PDFs
      • Merge or Split PDFs
      • Save & Export PDF Documents
      • Load & Export PDFs to Memory
      • Rotate Text and Pages
      • Signing PDFs
      • Print PDFs Programmatically
      • View PDFs in a .NET Application
      • Read PDF Documents in C#
      • Parse PDFs in C#
      • Add Cover Page to PDF
      • Flatten PDF Images
      • Add Stamp to PDFs in C#
      • Split Multipage PDF
      • Outlines & Bookmarks
      • Add & Edit Annotations
      • Set & Edit Metadata
      • Add Headers & Footers
      • Create PDF Forms
      • Draw Text & Bitmap
      • Add & Remove Attachments
      • Set PDF Passwords and Permissions
    • Contacting Technical Support
      • How to Make an Engineering Support Request for IronPDF
      • Getting the Best Support for IronPDF
    • Deployment
      • Visual C++ Redistributable for Visual Studio
      • AWS Lambda / Amazon Linux 2
      • IronCefSubprocess
      • Debugging Azure Functions Project on Local Machine
      • Windows Nano Server / Servercore in .Net6 do not support System.Drawing
      • IronPDF Runtimes Folder
      • Adding IronPDF to a software program installer
      • Red Hat Enterprise Linux (RHEL) support
    • Common Questions
      • Bootstrap / Flex / CSS
      • Azure Plans and Tiers
      • Initial render is slow
      • Font Kerning
      • Pixel Perfect HTML Formatting
      • What version of IronPDF should I use?
      • IronPDF Package Size
      • Fonts
      • Quick IronPDF Troubleshooting
      • IronPDF Performance Assistance
      • Azure Log Files
      • AWS Log Files
      • Render Delay & Timeout
      • Large Output Files Using ImageToPDF
      • Memory Leak in IronPDF
      • Log4j
      • Convert PDF to Base64
      • IronPDF - Security CVE
      • IronPDF 'using' Declaration
      • IronPDF - _blank hyperlinks in a PDF open in same browser tab
      • PDF File Versions
      • IronPdf.Slim
      • IronPdf.Linux
    • Troubleshooting Guides
      • Apply a license key in IronPDF
      • Azure Blob Storage
      • Blazor Server / WebAssembly (WASM)
      • Digital Signatures
      • Headers/Footers and Page Breaks
      • International Languages and CMJK
      • IronPdf and IIS
      • Kerberos
      • MetaData Visibility
      • PDF Viewer
      • Print From Network Printer
      • Rasterize to Image using MemoryStream
      • Render view to string
      • System.Drawing.Common Alternatives (.NET 7 & Non-Windows)
      • Table Headers
    • Exception Messages
      • Access to the path 'Global-IronSoftwareDeploymentGlobal' is denied
      • Error while deploying Chrome dependencies
      • Error while deploying Pdfium dependencies
      • Error while opening document from bytes: 'bad allocation'
      • Failed to deploy NuGet package
      • GPU process isn't usable
      • Invalid CefExecuteProcess return code of 0
      • IronPDF can not open / parse a specific PDF file
      • IronPDF Native Exception
      • IronPdfAssemblyVersionMismatchException
      • Network service crashed, restarting service
      • No function was found with the name SetLogEvent with error code (127)
      • Registry is not supported on this platform
      • Timeout while rendering PDF
      • Unhandled case for AdaptiveRenderEngine
    • Changelog
    • Milestones
    • Milestone: Chrome Rendering
    • Milestone: PDFium DOM
    • Milestone: Compatibility
    • Milestone: Stability & Performance
  • API Reference
Free for development from NuGet

Install with NuGet nuget.org/packages/IronPdf

PM > Install-Package IronPdf

  1. IronPDF
  2. Troubleshooting
  3. Render view to string

Render view to string

How do I render a view to a string?

View -> String -> PDF

First you render the View to string.

A great example for this is shown here - https://stackoverflow.com/questions/40912375/return-view-as-string-in-net-core

Then simply render the string to PDF

On This Page

  • How do I render a view to a string?

Ready to get started?

Get a free 30-day Trial Key

No limitations, no watermarks.
No credit card required.

Start free trial

Ready to get started? Version: 2023.9 just released

Start for Free Total downloads: 6,997,908
Start for Free Total downloads: 6,997,908
View Licenses >
Try IronPDF for Free
Get Set Up in 5 Minutes
C# NuGet Library for PDF
Install with NuGet
Version: 2023.9
Install-Package IronPdf
nuget.org/packages/IronPdf/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronPdf"
  3. Select the package and install
C# PDF DLL
Download DLL
Version: 2023.9
Download Now
or download Windows Installer here.
  1. Download and unzip IronPDF to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronPdf.dll"
Licenses from $749

Have a question? Get in touch with our development team.

15 1000 1
Now that you’ve downloaded IronPDF
Want to deploy IronPDF to a live project for FREE?
Not ready to buy?

Want to deploy IronPDF to a live project for FREE?

What’s included?
30 days of fully-functional product
Test and share in a live environment
No watermarks in production
Get your free 30-day Trial Key instantly.
Thank you.
If you'd like to speak to our licensing team:

badge_greencheck_in_yellowcircle

The trial form was submitted
successfully.

Your trial key should be in the email.
If it is not, please contact
support@ironsoftware.com

Schedule a call
Have a question? Get in touch with our development team.
No credit card or account creation required
15 1000 1
Your Trial License Key has been emailed to you.
Not ready to buy?
Thank you.
View your license options:
Thank you.
If you'd like to speak to our licensing team:
View Licensing
Schedule a call
Have a question? Get in touch with our development team.
Have a question? Get in touch with our development team.
15 1000 1
Want to deploy IronPDF to a live project for FREE?
Not ready to buy?

Want to deploy IronPDF to a live project for FREE?

What’s included?
30 days of fully-functional product
Test and share in a live environment
No watermarks in production
Get your free 30-day Trial Key instantly.
Thank you.
If you'd like to speak to our licensing team:

badge_greencheck_in_yellowcircle

The trial form was submitted
successfully.

Your trial key should be in the email.
If it is not, please contact
support@ironsoftware.com

Schedule a call
Have a question? Get in touch with our development team.
No credit card or account creation required
15 1000 1
Your Trial License Key has been emailed to you.
Not ready to buy?
Download IronPDF free to apply
your Trial Licenses Key
Thank you.
If you'd like to speak to our licensing team:
Install with NuGet View Licensing
Schedule a call
Licenses from $749. Have a question? Get in touch.
Have a question? Get in touch with our development team.
ironpdf_for_dotnet_log2o

Get started for FREE

No credit card required

Fully-functional product

Get 30 days of fully-functional product.
Have it up and running in minutes.

bullet_calendar

Test in a live environment

Test and share in a live environment.
Works wherever you need it to.

bullet_test

No watermarks

No watermarks in production.
No limits.

bullet_watermark
ironpdf_for_dotnet_log2o

Get your free 30-day Trial Key instantly.

bullet_checkedNo credit card or account creation required

badge_greencheck_in_yellowcircle

The trial form was submitted
successfully.

Your trial key should be in the email.
If it is not, please contact
support@ironsoftware.com

Trusted by Over 2 Million Engineers Worldwide

  • aetna_logo
  • wwf_logo
  • nasa_logo
  • usda_logo
  • 3m_logo
  • tesla_logo
ironpdf_for_dotnet_log2o

Get started for FREE

No credit card required

Fully-functional product

Get 30 days of fully-functional product.
Have it up and running in minutes.

bullet_calendar

Test in a live environment

Test and share in a live environment.
Works wherever you need it to.

bullet_test

No watermarks

No watermarks in production.
No limits.

bullet_watermark
ironpdf_for_dotnet_log2o

Your Trial License Key has been emailed to you.

Install with NuGet
View Licensing

Licenses from $749. Have a question? Get in touch.

Trusted by Over 2 Million Engineers Worldwide

  • aetna_logo
  • wwf_logo
  • nasa_logo
  • usda_logo
  • 3m_logo
  • tesla_logo
Free 30-Day Trial Key Start for Free Start Free Trial Start Free 30-Day Trial Free 30-Day Trial Key Start for Free Start Free Trial Start Free 30-Day Trial

Fully-functional product, get the key instantly

IronPDF for .NET

When you need your PDF to look like HTML, fast.

Search

CtrlK

Documentation

  • Code Examples
  • API Reference
  • How-Tos
  • Features
  • Blog
  • Credits
  • Product Brochure

Tutorials

  • Get Started
  • HTML to PDF
  • Editing PDFs in C#
  • Debug HTML with Chrome
  • ASPX to PDF
  • VB.NET to PDF

Licensing

  • Buy a License
  • Support Extensions
  • Resellers
  • License Keys
  • EULA

Try IronPDF Free

  • Download on NuGet
  • Download DLL

  • Download Windows Installer

  • 30-Day Trial License

When you need your PDF to look like HTML, fast.

Tesseract 5 OCR in the languages you need, We support 127+.

When you need to read, write, and style, QR & Barcodes, fast.

The Excel API you need, without the Office Interop hassle.

The power you need to scrape & output clean, structured data.

The complete .NET Suite for your office.

  • IRONSUITE
  • |
  • IRONPDF
  • IRONOCR
  • IRONBARCODE
  • IRONXL
  • IRONWEBSCRAPER
IronSoftware
205 N. Michigan Ave. Chicago, IL 60611 USA +1 (312) 500-3060
  • About Us
  • News
  • Careers
  • Contact Us
  • Join Iron Slack

Supporting Teamseas

Copyright © Iron Software LLC 2013-2023

  • Terms
  • Privacy

Thank you!

Your license key has been delivered to the email provided. Contact us

24-Hour Upgrade Offer:

Save 50% on a
Professional Upgrade

Go Professional to cover 10 developers
and unlimited projects.

hours

:

minutes

:

seconds

Upgrade to Professional

Upgrade

Professional

$600 USD

$299 USD


  • 10 developers
  • 10 locations
  • 10 projects
TODAY ONLY
Iron Suite

5 .NET Products for the Price of 2

IronPDF IronOCR IronXL IronBarcode IronWebscraper

Total Suite Value:

$7,192 USD

Upgrade price

TODAY
ONLY

$499 USD

After 24 Hrs

$1,098 USD