關於 IronPDF for .NET

創建、編輯和匯出 PDF 文件。

IronPDF for .NET allows developers to create PDF documents easily in C#, F#, and VB.Net for .NET Core and .NET Framework. You can choose simple HTML, or incorporate CSS, images and JavaScript. IronPDF rendering closely follows Google Chrome.

IronPDF Features

Create PDF documents using:

  • HTML Strings and Templates.
  • ASPX WebForms.
  • MVC Views.
  • HTML documents.
  • or from any URL.

HTML to PDF Supports:

  • Full and high fidelity HTML 4 and HTML 5 rendering.
  • CSS 3.
  • JavaScript.
  • Image assets.
  • SVG assets.
  • Icon Fonts (Fontello, Bootstrap, FontAwesome).
  • Responsive layouts.
  • External stylesheets and assets (http https or filesystem).
  • Static and multithreaded rendering.
  • Loading URLS using with custom:
    • Network login credentials.
    • UserAgents.
    • Proxies.
    • Cookies.
    • HTTP headers.
    • Form variables allowing login behind HTML login forms.

HTML to PDF Settings

  • Set custom “base URL” or file paths allowing asset files to be easily loaded from file system or across the web.
  • Virtual View port (Width and Height) allowing for responsive layouts to be used.
  • Screen or Print CSS media types.
  • Convert HTML Forms to PDF forms.
    • Read only or editable.
  • Load custom stylesheets programmatically.
  • Set output PDF resolution in DPI.
  • Set JPEG image quality.
  • Enable JavaScript support including optional Render delays.
  • Custom page numbering.
  • Automatically scale HTML content to fit paper dimensions.
    • Preserving text rendering quality.
  • Full Color and Grayscale PDF.
  • Accept HTML encoded in any major file encoding. Default to UTF-8.
  • Set PDF paper margins.
    • Set in mm or inches.
    • Supports zero margin PDFs.
  • Create PDFs using any standard international paper size.
    • Support for custom sizing in mm or inches.
    • Paper orientations in landscape or portrait.
  • Enable or Disable HTML backgrounds from showing in PDFs.
  • Custom zoom.

Utilities

  • ImagetoDataURI utility makes it easy to embed System.Drawing image objects into HTML strings.

ASPX to PDF (.NET Framework only)

  • Automatically render an ASPX webform as PDF in 3 lines of code. PDF documents may be set to download or display in the browser.

PDF Imaging

  • IronPDF makes it easy to work to convert PDF documents to and from Images.

Image To PDF

  • Convert any number of image files or System.Daring objects into a PDF in 1 line of code.

PDF to Image

  • Rasterize any or all PDF pages to Images.

Image Extraction

  • Extract embedded images an existing PDF.

Image Support

  • BMP, JPEG, GIF, ONG and TIFF Files.
  • System.Drawing Bitmap and Image Objects.

PDF Printing

  • Turn any PDF into a PrintDocument object.
  • Programmatically send PDFs to a Printer without Adobe.

PDF FIle IO

  • PDFs can be loaded or saved from Files, Binary Data or MemoryStreams including:
    • Load and save PDFs.
    • Support save and load using user and administrator passwords with 128 bit encryption.

PDF Signatures

  • Digitally sign a PDF or add additional signatures after editing.
    • Set Signature Images, Location, Metadata, Contact information and Timestamps.
    • Verify PDF signatures.

Editing PDFs

  • Add, Edit and Remove PDF Outlines / Bookmarks.
  • Add text annotations (sticky notes) programmatically to any PDF page.
  • Add foreground or background overlays from HTML or PDF assets.
  • Add HTML watermarks with opacity to any PDF.
  • Stamp new HTML Content onto any existing PDF page.
  • Add logical or HTML headers and footers to any PDF.
  • Merge and Join PDF pages.
  • Copy, Add, and Remove pages.
  • Rotate pages.
  • Edit MetaData, user permissions & PDF passwords.

PDF Content Extraction

  • Extract plain Text and Images from existing PDFs.

Headers and Footers

  • Headers and Footers can be added when a PDF is created, or added to existing PDFs

Logical Headers and Footers

  • Fonts size and Font Family.
  • Divider Lines.
  • Simple API using Center, Left, and Right text fields.

HTML Header Footers

  • Supports CSS, Images and even JavaScript.
  • BaseUrl for loading assets from http, https or file system.
  • Load or ignore CSS from parent HTML document.

Headers and Footers support merged data including:

  • Page numbers.
  • Page count.
  • Titles.
  • URL.
  • Time and date.

Generating PDFs

  • HTML to PDF:
    • HTML File to PDF
    • HTML String to PDF
    • URL to PDF
  • Content Pages to PDF:
    • Razor to PDF (Blazor Server)
    • CSHTML to PDF (MVC, Razor)
    • ASPX to PDF (WebForms)
    • XAML to PDF (MAUI)
  • PDF File Conversion:
    • Images to / from PDF
    • DOCX to PDF (Microsoft Word)
    • RTF to PDF (Rich Text Format)
    • MD to PDF (Markdown)
    • PDF to HTML
  • Supports:
    • UTF-8 Character Encoding
    • Base URLs and Asset Encoding
    • TLS Website and System Logins
    • Async and Multithreading
    • Custom Logging
    • Cookies

Formatting PDFs

  • Use HTML Assets:
    • HTML (5 and below)
    • CSS (Screen and Print)
    • Images (jpg, png, gif, tiff, svg, bmp)
    • JavaScript (Custom Render Delays)
    • Fonts (Web and Icon)
  • Apply Page Templates:
    • Add Headers and Footers
    • Add Page Numbers
    • Add Page Breaks
    • Fit to Paper and Zoom
    • Custom Margins
  • Apply Page Settings:
    • Responsive Layouts
    • Custom Paper Size
    • Orientation and Rotation
    • Color
  • Supports PDF Standards:
    • PDF Versions (1.2 - 1.7)
    • PDF/UA (PDF/UA-1)
    • PDF/A (PDF/A-3b)

Editing PDFs

  • Set Properties and Security:
    • Set Password and Permissions
    • Digital Signatures (.pfx, .p12)
    • PDF File Compression
    • Edit PDF Metadata
    • Edit and Sign Revision History
  • Edit Document Structure:
    • Add, Copy, and Delete Pages
    • Merge and Split PDFs
    • Annotations
    • Attachments
    • Bookmarks and Outline
  • Edit Page Content:
    • Draw Text and Bitmap
    • Find and Replace Text
    • Headers and Footers
    • Stamp Text and Images
    • Custom Watermarks
    • Backgrounds and Foregrounds
  • Use PDF Forms:
    • Create and Edit Forms
    • Fill Existing Forms
  • View, Read, and Print PDFs:
    • IronPDF Viewer
    • Print to a Physical Printer
    • Extract PDF Text and Images