PDFRasterizer.NET 4.0 is now available. Supports .NET Core. Renders pixel-perfectly.

Relevant products

Draw interactively on a PDF page

This code sample allows users to interactively draw lines on PDF pages and save the resulting document.

Running the sample.

To run the Draw.zip sample, please download and unzip it and open the project file in Visual Studio. After starting the application, you can open a PDF file via the file menu. Then, in the same menu click on “Toggle Pencil Mode”. This will allow you to draw lines on the shown PDF page. While drawing you will not be able to navigate to other pages. When you click on “Toggle Pencil Mode” again, the lines will become slightly thinner. At that point they are part of the page, and if you save the document the lines will be saved as well.

PictureBox

In principle, one can draw anything on a PDF page by means of shapes. Shapes however, are somewhat inefficient when drawing interactively. This is because each shape needs to be converted into actual PDF graphics before it can be shown to the user, and this is relatively costly. The sample below will use a WinForms PictureBox to perform the interactive drawing, and when the user is done, it will convert this into PDF shapes.

This is implemented via a special PagesViewer instance that defines a PencilMode. When the PencilMode is set to true, the PictureBox becomes active and the user can draw lines. When the PencilMode is set to false, the lines in the PictureBox are converted to PDF shapes.

When the PictureBox gets activated, a number of things happen:

  • If no PictureBox exists yet, it will be created and added to the parent.
  • Events handlers are installed for the MouseDown, MouseMove, MouseUp and Paint event. These handlers implement the actual drawing. We will discuss these later
  • The PictureBox gets a copy of the PDF page image.
  • The PictureBox is made visible and put to the front. The PagesViewer on the other hand is made invisible and disabled. The latter makes sure that the PagesViewer stops handling events while the user is Painting. Amongst others this makes sure that the same page stays in view.

When the PictureBox gets deactivated the following happens:

  • The lines that were drawn in the PictureBox get converted to PDF shapes. This is done in the WriteToPDF method.
  • The PictureBox is made invisible and sent to the back. The PagesViewer is made visible, and enabled, so that it handles events again.
internal class StandardPagesViewerWithPencilTool : 
                       TallComponents.Interaction.WinForms.Controls.StandardPagesViewer
{
  public bool PencilMode
  {
    get { return _pencilMode; }
    set
    {
       _pencilMode = value;

       if (value)
       {
         if (_pictureBox == null)
         {
            _pictureBox = new PictureBox();
            (_pictureBox as ISupportInitialize).BeginInit();
            _pencilCursor = new Cursor(Properties.Resources.PencilTool.Handle);
            _pictureBox.Cursor = _pencilCursor;
            _pictureBox.Location = Location;
            _pictureBox.Name = "picPencil";
            _pictureBox.BorderStyle = BorderStyle.None;
            _pictureBox.TabStop = false;
            _pictureBox.BackColor = System.Drawing.Color.White;

            _pictureBox.MouseDown += picPencil_MouseDown;
            _pictureBox.MouseUp += picPencil_MouseUp;
            _pictureBox.MouseMove += picPencil_MouseMove;
            _pictureBox.Paint += picPencil_Paint;

            (_pictureBox as ISupportInitialize).EndInit();

            Parent.Controls.Add(_pictureBox);
          }
          _paintedPaths = new List<GraphicsPath>();

          Bitmap bmp = new Bitmap(ClientSize.Width, ClientSize.Height);
          DrawToBitmap(bmp, ClientRectangle);

          _pictureBox.Image = bmp;
          _pictureBox.Size = ClientSize;
          _pictureBox.Visible = true;
          _pictureBox.BringToFront();
        }
        else
        {
          if (_pictureBox == null)
            return;

          WriteToPDF();

          _pictureBox.Visible = false;
          _pictureBox.SendToBack();
        }

        // While drawing, do not enable PagesViewer, nor redrawing of the PagesViewer.

        Enabled = !value;
        Visible = !value;
      }
    }
  }
}

## Interactive Drawing

The actual drawing is implemented via a number of handlers that are defined on the PictureBox instance. The lines that are drawn are maintained in the _paintedPaths collection. This a collection of GraphicsPath instances.

The paint handler simply draws all paths that are present in the _paintedPaths collection. The mouse handlers add new lines to the collection and they call Invalidate so that the new lines are drawn by the paint handler.

``` csharp
private void picPencil_Paint(object sender, PaintEventArgs e)
{
  try
  {
    using (Pen p = new Pen(System.Drawing.Color.Black, 3))
    {
      foreach (GraphicsPath gp in _paintedPaths)
      {
        e.Graphics.DrawPath(p, gp);
      }
    }
  }
  catch
  {
    /* Ignore errors during painting. */
  }
}

private void picPencil_MouseDown(object sender, MouseEventArgs e)
{
  if (!PencilMode)
    return;

  if (e.Button != MouseButtons.Left)
    return;

  _paintedPaths.Add(new GraphicsPath(FillMode.Winding));
  _paintedPaths[_paintedPaths.Count - 1].StartFigure();
  _paintedPaths[_paintedPaths.Count - 1].AddLine(e.X, e.Y, e.X, e.Y);
}

private void picPencil_MouseMove(object sender, MouseEventArgs e)
{
  if (!PencilMode)
    return;

  if (e.Button != MouseButtons.Left)
    return;

  _paintedPaths[_paintedPaths.Count - 1].AddLine(e.X, e.Y, e.X, e.Y);
  _pictureBox.Invalidate();
}     

private void picPencil_MouseUp(object sender, MouseEventArgs e)
{
  if (!PencilMode)
    return;

  if (e.Button != MouseButtons.Left)
    return;

  _paintedPaths[_paintedPaths.Count - 1].AddLine(e.X, e.Y, e.X, e.Y);
}

Creating shapes

When the user turns off the PencilMode, the WriteToPDF method gets called. This method is shown below. The sample basically connects all shapes to be page that drawing started in. Basically, each path in the _paintedPaths collection gets converted to a FreeHandShape, and each line in a path gets converted to a FreeHandLineSegment.

For each such a line segment we need to transform the PictureBox coordinates to PDF page coordinates. This is needed because in WinForms the coordinate origin of each graphical element is at its top left, while in PDF it is at the bottom left of each page.

We add each FreeHandShape to the Overlay of the page, and finally, we invalidate the Overlay. The latter is needed to tell PDFControls.NET to redraw the Overlay.

private void WriteToPDF()
{
  if (_paintedPaths.Count <= 0)
    return;

  try
  {
    Application.UseWaitCursor = true;
    Application.DoEvents();
    Parent.Enabled = false;

    // We try to find the page that drawing started in.
    MatrixTransform docTransform = new MatrixTransform(DocumentToClientTransform).Inverse;
    TallComponents.Interaction.Point documentPoint =
      new TallComponents.Interaction.Point(_paintedPaths[0].PathPoints[0].X,
                                           _paintedPaths[0].PathPoints[0].Y, docTransform);

    TallComponents.PDF.Page page = FindPage(documentPoint);

    if (page != null)
    {
      PageInteractor pageInteractor = DocumentInteractor.FindPageInteractor(page);
      if (pageInteractor != null)
      {
        MatrixTransform pageTransform = new MatrixTransform(GetPageToDocumentTransform(page)).Inverse;
        FreeHandShape shape = null;
        foreach (GraphicsPath gp in _paintedPaths)
        {
          TallComponents.Interaction.Point point = new TallComponents.Interaction.Point(
          gp.PathPoints[0].X, gp.PathPoints[0].Y, docTransform);
          point = new TallComponents.Interaction.Point(point, pageTransform);
          point = new TallComponents.Interaction.Point(point, pageInteractor.PdfPageTransform);

          shape = new FreeHandShape();
          shape.Dock = TallComponents.PDF.Shapes.DockStyle.None;
          shape.BlendMode = BlendMode.Normal;
          shape.ID = "PencilTool_" + Guid.NewGuid();
          shape.Pen = new TallComponents.PDF.Pens.Pen(RgbColor.Black);
          shape.Pen.Width = 1;

          FreeHandPath path = new FreeHandPath();
          path.Segments.Add(new FreeHandStartSegment(point.X, point.Y));

          for (int i = 1; i < gp.PathPoints.Length; i++)
          {
            point = new TallComponents.Interaction.Point(gp.PathPoints[i].X, gp.PathPoints[i].Y,
                                                            docTransform);
            point = new TallComponents.Interaction.Point(point, pageTransform);
            point = new TallComponents.Interaction.Point(point, pageInteractor.PdfPageTransform);

            path.Segments.Add(new FreeHandLineSegment(point.X, point.Y));
          }
          shape.Paths.Add(path);
          page.Overlay.Add(shape);
        }

        // This will tell PDFControls.NET to draw the overlay.
        page.Overlay.Invalidate();
      }
    }
  }
  finally
  {
    Application.UseWaitCursor = false;
    Parent.Enabled = true;
  }
}

After conversion, one can write the PDF document to a file. The drawn lines will then be visible in any PDF viewer that shows this document.

No results

Render PDF to multipage color TIFF
Render PDF page to Skia surface
Render PDF page as PNG
How to downscale all images in a PDF
This code sample shows how to downscale images in a PDF file. Read this Tall Components code sample or search our code sample base.
How to generate and export certificates
In this Tall Components code sample we will show you how you can create an RSA 2048-bit PEM certificate and how you can export it.
How to downscale all images in a PDF
This code sample shows how to downscale images in a PDF file. Read this Tall Components code sample or search our code sample base.
Add Stamp to PDF
This code sample shows how to stamp a PDF in C#. You can stamp images and watermarks to your PDF for example.
How to use a system font for rendering text
This code sample shows how you can render text using a system font. Read this Tall Components code sample or search our code sample base.
Customize the GUI interaction of a radio button
This sample shows how one can create a custom radio button interactor that responds to other key strokes than just the space bar.
Customize the UI interaction of a check box
This sample shows how one can create a custom check box interactor that responds to other key strokes than just the space bar.
PDF to grayscale TIFF
In the .NET framework the support for grayscale bitmaps is a bit puzzling. There is a way to convert PDF to grayscale Tiff in C#.
How to reduce PDF file size
Adobe Acrobat has an option to save a document with a reduced size. This article shows how to reduce pdf file size with PDFKit.NET.
How do I create graphics with Icc based colors
This article explains how one creates graphics that use Icc based colors. Read this code sample or search our code sample base.
Highlight fields in PDF
This code sample shows how to mark all fields in a PDF document. Read this Tall Components code sample or search our code sample base.
Add a note to PDF
This code sample shows how to add a note to a PDF document. Read this Tall Components code sample or search our code sample base.
Display PDF in a WPF app and stay responsive – the code
This article helps how to stay responsive while rendering a a PDF document in a WPF application. Read this or search our code sample base.
Draw interactively on a PDF page
This article allows users to interactively draw lines on PDF pages and save the resulting document. Read this or search our code sample base.
Resize PDF pages
This sample demonstrates how to change the size of pages in the PDF file. Read this code sample or search our code sample base.
Verify a custom digital PDF signature
In the article we explain how to verify a custom digital PDF signature. Read this Tall Components code sample or search our code sample base.
C# Print PDF documents from a WPF application
This code sample shows how to print PDF documents from a WPF application using C#. Read this code sample or search our code sample base.
Extract glyph boxes from PDF
This sample creates a bitmap for each page and draws boxes for each glyph. Read this code sample or search our code sample base.
Use TrueType font collections
This article describes how to select a font from a font collection and how this is embedded in a PDF document. Read or search our base.
Layout text with MultilineTextShape
This sample demonstrates how to format and layout text with MultilineTextShape. Read this code sample or search our code sample base.
Calculate the height of a paragraph in PDF
This code sample demonstrates how to use the event mechanism to calculate the height of a paragraph in a PDF.
Merge PDF files in C# .NET
In the following code sample you can see how you can easily merge PDF files into one. Read this code sample or search our code sample base.
How do I extract page destinations from bookmarks?
This article explains how one can determine which page a particular bookmark refers to. Read this code sample or search our code sample base.
Clip PDF page content in C#
This sample demonstrates how to mask out a rectangular area on a PDF page using a clip shape in C#. Read this or search our code sample base.
How do I use PDFControls.NET in a WPF application
This code sample shows you how PDFControls.NET can be used in a WPF application. Read this code sample or search our code sample base.
Fill PDF form
This code sample shows how to assign values to various types of PDF form fields. Read this code sample or search our code sample base.
Extract glyphs and sort by reading order
This code sample shows how to extract glyphs from PDF and sort. Read this Tall Components code sample or search our code sample base.
Add bookmarks to PDF
This code sample shows how to create bookmarks in an existing PDF document. Read this code sample or search our code sample base.
How to scale content of PDF
This code sample creates a copy of a PDF document but the content in the output PDF is scaled. Read this or search our code sample base.
Create rectangles with rounded corners
A Rectangle with rounded corners is not a standard shape. However it is easy to create these. Read this or search our code sample base.
Create text with decorations
Create a document with text with decorations like gradient color, shadow, emboss and glow. Read this or search our code sample base.
Create layers in PDF and draw on each layer
This code sample shows how to create a document and adds two new layers. Read this code sample or search our code sample base.
Multipage TIFF to PDF
This article shows you how to convert a multipage TIFF to PDF using TallPDF.NET. Read this code sample or search our code sample base.
TIFF to PDF C#
This article shows you how to convert a multipage TIFF to PDF using PDFKit.NET. Read this code sample or search our code sample base.
Crop content on a PDF page
This code sample shows how to remove all content that is outside a crop rectangle. Read this code sample or search our code sample base.
How to embed files in a PDF document
This code sample shows how to add embedded files (attachments) to a PDF document. Read this code sample or search our code sample base.
Remove graphics from PDF
This code sample shows how to partly erase images from a PDF under an explicitly specified rectangle. Read or search our code sample base.
Change the color inside a PDF
This code sample shows how to change color in a PDF using C# and VB.NET. Read this code sample or search our code sample base.
Create PDF in C#
This simple code sample shows you how to create a PDF using C# and print "Hello World" to it. Read or search our code sample base.
Text formatting
This code sample shows how to format your text. Read this Tall Components code sample or search our code sample base.
Import FDF into PDF
In this code sample we will show how you can easily import an FDF file and populate the form fields in a PDF.
Flatten PDF form
This code sample shows how to fill out a form and then flatten it. Read this code sample or search our code sample base.
Digitally sign a PDF form in C# or VB.NET
This code sample shows you how you can import a digital signature and use it to sign a PDF document in C# or VB.NET.
Vector graphics in PDF
This code sample shows how to draw different vector graphics such as line, ellipses and bezier curves. Read code sample or search our base.
Translate PDF page content
This code sample shows how to apply a single translation to all the content on a PDF page. Read or search our code sample base.
Extract graphics from PDF
This c# code sample shows how to extract text, images and curves as shapes from a PDF document. Read or search our code sample base.
Determine the content bounding box
This article shows how to determine the content bounding of a page. Read this Tall Components code sample or search our code sample base.
How to add page numbers to your PDF
This article shows how to add page numbers to PDF using TallPDF built-in features. Read or search our code sample base.
Create / impose PDF 2-up
This code sample shows how to do 2-up imposition using the PageShape class. Read this code sample or search our code sample base.
Search text in PDF
This article shows how to search a PDF for text in C# using the Document. Read this code sample or search our code sample base.
Append multiple PDF documents
This code sample illustrates to loop through a given folder and append each PDF documents found into a new generated PDF document.
Convert PDF to plain text
The following code sample shows how to convert the collection of glyphs on a PDF page to a text string. Read or search our code sample base.
Flatten Markup Annotation
This article illustrate how to turn markups to images by flatten markups. Read this code sample or search our code sample base.
Add text field to PDF
This code sample illustrates how you can add TextFields to your PDF. Read this Tall Components code sample or search our code sample base.
Extract embedded files from PDF
This code sample illustrates how to loop through embedded files in an existing PDF document and extract those attachments. Read more.
Extract images from PDF
This code sample illustrates how to iterate through existing content in a PDF document and save each images found as a new Image file.
Add a Diagonal Watermark to PDF in C#
This code sample shows how to add a diagonal watermark to an existing PDF in C#. Read this code sample or search our code sample base.
Fit image to PDF page
This code sample shows how to stamp an image on a PDF page and have the image fit to the size of the page. Read this code sample.
Add simple html text to PDF
The SimpleXhtmlShape lets you add text with simple HTML mark-up to a PDF document. Read or search our code sample base.
Add multiline text to a PDF document
The MultilineTextShape lets you add multiline text to PDF with mixed formatting and line-breaking. Read this code sample or search our code sample base.
Add single-line text to PDF
TextShape allows you to add single-line text to a PDF document. Read this Tall Components code sample or search our code sample base.
Create a new digitally signed PDF document
This code sample creates a new PDF document, adds a signature fields, and then digitally signs it. Read or search our code sample base.
PDF Viewer Preferences
The following code sample shows how to set the viewer preferences of a PDF document. Read or search our code sample base.
Change page orientation PDF
Code sample to change the page orientation PDF. Read this Tall Components code sample or search our code sample base.
Split PDF pages in C# and VB.NET
The following code sample shows how to split PDF pages in C# and VB.NET. Read this code sample or search our code sample base.
Append two or more existing PDF files
The following code sample shows how to append PDF files. Read this Tall Components code sample or search our code sample base.
Change colors of black-and-white TIFF after converting from PDF
In this article, we will demonstrate how to change the color palette after converting a PDF document to 1bpp TIFF in C#.
Determine if a PDF only contains images
The following sample code determines whether a PDF document only contains images (and not other shapes such as text fragments).
Add footer to PDF
This code sample shows how to add a footer in a PDF document. Read this Tall Components code sample or search our code sample base.
Convert SVG to PDF
This article explains how to use these text and fonts in SVG documents. Read this code sample or search our code sample base.
Fill in a PDF form using MVC
In this sample we will create a small ASP.NET application to fill in pdf forms, using a webform. Read or search our code sample base.
C# render pdf in browser using MVC
In this code sample we will be using the PDF Rasterizer package in a MVC context to render specific PDF pages in a browser.
Convert XHTML to PDF
This code sample shows how to add a note to a PDF document C#. Read this code sample or search our code sample base.
Add hyperlink to PDF
This code samples draws a hyperlink on an existing PDF page. Read this code sample or search our code sample base.
Rotate a PDF page
This code sample creates a copy of a PDF document with each page rotated 90 degrees. Read or search our code sample base.
Change the formatting of a numeric field
This code sample changes the format by changing the JavaScript of the action. Read or search our code sample base.
How to mirror PDF pages and other shapes
In this code sample we will mirror the pages in an existing PDF document. Read this code sample or search our code sample base.
Fill in a template PDF document
This code sample shows you how you can import a template document and fill it in with data from a database.
How to add autosized text to PDF
This code sample shows you how you can add a piece of auto-sized text to your PDF document. Read or search our code sample base.
Create formfields in PDF documents
This codesample shows how you can create different types of formfields in PDF. Read this code sample or search our code sample base.
Export FDF from PDF form
This code sample helps to exports FDF from PDF. Read this Tall Components code sample or search our code sample base.
Add a link with an internal destination to PDF
This code sample helps with internal links in a PDF. Read this Tall Components code sample or search our code sample base.
Remove PDF security settings
This code sample shows how you can remove the security setting of a PDF quite easily; just set the security attribute to null.
Add a link to PDF with an external destination
This code sample helps adding an external link to your PDF. Read this code sample or search our code sample base.
How to sign and verify updates to a PDF document
This code sample shows how you can sign PDF documents and how to handle updates to form data. Read or search our code sample base.
Convert PDF to PNG using WPF
In this code sample we take a look how you can create PNG images from a PDF using the Windows Presentation Foundation.
Embed TrueType font
This code sample shows how to draw text on a page using a TrueType font and embed this font in the PDF. Read or search our code sample base.
Override MouseWheel event
This code sample helps to override MouseWheel event. Read this Tall Components code sample or search our code sample base.
Convert PDF to an image using a dither matrix
This code sample shows how to convert a PDF page to a bitmap image, while applying a dither matrix to the generated image.
Font mapping
If you have a PDF document which uses non-embedded fonts, you can specify your font substitution map to specify which fonts need to be used.
Convert PDF with layers to image
In the code sample below you see how you can incorporate multiple layers into your rendering process. Read or search our code sample base.
C# Print PDF Document
C# Print PDF? With this sample you can get an impression of how to print a PDF in C#. Read this code sample or search our code sample base!
Render PDF with ResolveFont event handler
When you try to render a PDF which uses non-system fonts, you can add your own specified fonts to make sure it is rendered correctly.
Render PDF to EMF
This code sample helps render PDF to EMF. Read this Tall Components code sample or search our code sample base.
Convert PDF to XPS
In this sample you can see how you convert your PDF document to an XPS format (which is Microsoft Windows' version of PDF).
How to create a thumbnail viewer
This sample shows how you can create a thumbnail viewer for your PDF application and it builds on the SimpleViewer code sample.
How to create a tiling for shapes in PDF
In this code sample we will show you how you can create a rectangle and fill it using a TilingBrush containing dots.
Add footer with left and right aligned text on same line
Add a footer to a PDF document that has left aligned text with a page number and right aligned text on the same line.
Convert PDF to JPG in C#
This code sample shows how to convert PDF to JPG or JPEG in C#. Read this Tall Components code sample or search our code sample base.
EMF to PDF as vector image
EMF is the Windows Meta file file format for images. Read this Tall Components code sample or search our code sample base.
EMF to PDF as raster image
This code sample helps to create a Bitmap (PDF) from an EMF file in C#. Read this Tall Components code sample or search our code sample base.
Replace field with image
This code sample opens a PDF with a textfield and replaces this textfield with an image. Read or search our code sample base.
Add a rubber stamp annotation with a custom icon
This article shows how to create a customized rubber stamp annotation. Read this code sample or search our code sample base.
Create a text annotation in PDF with rich text
This sample shows how to create annotations in PDF that use a rich text for their appearance. Read or search our code sample base.
XhtmlParagraph and TrueType fonts
The following code converts XHTML to PDF using the XhtmlParagraph. Read this code sample or search our code sample base.
What is the resulting fontsize in PDF for rich text used in a SimpleXhtmlShape
TallPDF supports the SimpleXhtmlShape. This shape accepts PDF rich text as its Text attribute. Read or search our code sample base.
Read and write meta data from PDF
This article shows a sample for reading and writing meta data from PDF using C#. Read this code sample or search our code sample base.
Create a custom signature handler to sign and verify PDF documents
This code sample shows how to create your own signature handler. Read this code sample or search our code sample base.
Merge PDF
In this code sample we will create a new PDF by stitching two existing PDF documents. Read or search our code sample base.
Stitch PDF documents
This code sample shows how to stich PDF pages from an existing PDF document to a newly generated PDF using TallPDF.NET.
Download and convert image to PDF
This article shows how to download an image on a web page as a PDF document. Read this code sample or search our code sample base.
Convert TXT to PDF
This code sample helpt converting TXT to PDF. Read this Tall Components code sample or search our code sample base.
Add barcodes to PDF
This article demonstrates how to add barcodes to a PDF document. Read this code sample or search our code sample base.
Convert PDF to multipage TIFF in C# .NET
This article shows how to convert PDF to multipage TIFF in C# using PDFRasterizer.NET 3.0. Read or search our code sample base.
Convert multiple PDF pages to bitmap
In this article, we will convert multple pages of a PDF to a single bitmap. Read this code sample or search our code sample base.
Render a PDF to bitmap
This article explains the most basic way to convert PDF to bitmap. Read this code sample or search our code sample base.
Bulleted list from XML and XSL
This code sample helps getting a bulleted list from XML and XSL. Read this code sample or search our code sample base.
Tagged PDF
This code sample helps create and consume tagged PDF documents. Read this code sample or search our code sample base.
PDFKit.NET 5.0 – detailed changes to the API
This article compares the builds that 4.0 and 5.0 have in common: net20, net40, net40-client and net40-wpf.
Create tagged PDF
This code sample demonstrate how to create a new tagged PDF. Read this Tall Components code sample or search our code sample base.
PDFKit.NET 5.0 and .NET Core
PDFKit.NET 5.0 includes a build targeting .NET Standard 1.5. According to the following table, it supports .NET Core 1.0 and higher.
PDFKit.NET 5.0 and Xamarin
This code samples helps with PDFKit.NET 5.0 and Xamarin. Read this Tall Components code sample or search our code sample base.
Dynamic XFA
The new dynamic XFA API of PDFKit.NET 5.0 allows populating and consuming dynamic XFA documents. Read or search our code sample base.
PDFKit.NET 5.0 .NET Standard API
This code sample helps with PDFKit.NET 5.0 .NET Standard API. Read this Tall Components code sample or search our code sample base.
.NET Core console app on MacOS
In this article we create step by step a simple .NET Core console application on MacOS. Read or search our code sample base.
Add tags to existing PDF
This article demonstrates how to open existing PDF document, read visual content and tag the visual content based on its type and content.
Read PDF tags
This code sample enumerates the tags in an existing PDF document. Read this code sample or search our code sample base.
Merge XDP data with dynamic XFA form
The following code imports XDP data into a dynamic XFA form. Read this Tall Components code sample or search our code sample base.
Fill XFA form and export XDP data
The following code opens an XFA form and programmatically fills text field and selects items from drop-down lists and exports data as XDP.
Fill and save dynamic XFA form
The following code opens a XFA form and programmatically fills text fields, selects an item from a drop-down list and 'clicks' a button.
Use PDFKit.NET 5.0 with a Xamarin.Forms app
This article demonstrates a simple Xamrin.Forms app that runs on Android, iOS and UWP. Read or search our code sample base.
Use multiple licenses
This code sample explains how to register multiple license keys with a single application. Read or search our code sample base.
Licensing and .NET Standard
This code sample helps with licensing and .NET Standard. Read this Tall Components code sample or search our code sample base.
Reduce PDF size
PDFKit5 includes support for non-desctructive PDF compresssion. Read this code sample or search our code sample base.
Generate PDF form from XML
The following code sample shows how to generate a PDF form from XML. Read this code sample or search our code sample base.
Generate PDF with local images from XML with Xamarin.iOS
This code sample generates a PDF from XML with an image that is included as resource. Read or search our code sample base.
Disable submit button after submitting
The following code adds a JavaScript action to a submit button that will disable the button after submitting.
Write Document to HttpResponse
In PDFKit.NET 5.0 we decided to remove the Document.Write(HttpResponse) because it required the client to add a reference to System.