IRI.Maptor.Core.Pdf 3.0.0

dotnet add package IRI.Maptor.Core.Pdf --version 3.0.0
                    
NuGet\Install-Package IRI.Maptor.Core.Pdf -Version 3.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="IRI.Maptor.Core.Pdf" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IRI.Maptor.Core.Pdf" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="IRI.Maptor.Core.Pdf" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add IRI.Maptor.Core.Pdf --version 3.0.0
                    
#r "nuget: IRI.Maptor.Core.Pdf, 3.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package IRI.Maptor.Core.Pdf@3.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=IRI.Maptor.Core.Pdf&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=IRI.Maptor.Core.Pdf&version=3.0.0
                    
Install as a Cake Tool

IRI.Maptor.Core.Pdf

NuGet Target

Vector PDF export for the Maptor stack, built on PdfSharpCore. It offers two paths: simple export of a single Geometry<Point> or Feature<Point> to a one-page vector PDF, and decorated map export that composes a print-ready page from raster basemap tiles and vector layers with title, scale bar, graticule, neat line, logos, and toggleable PDF layers.

Installation

dotnet add package IRI.Maptor.Core.Pdf

Features

  • Vector rendering (not rasterized) of Point, LineString, Polygon (with holes), and their Multi*/GeometryCollection forms
  • Stroke/fill color, stroke width, and opacity; configurable point radius or custom point markers
  • Standard (A0–A5, B2–B4, Letter, Legal, Tabloid), custom, or auto (fit-to-bounds) page sizes in portrait/landscape
  • Feature attributes stored as PDF document metadata (Title, Author, Creator, Subject, Keywords) when PdfOptions.PreserveFeatureAttributes is true
  • Decorated map export (PdfWriter.WriteLayers): raster basemap plus stacked vector layers, title band, four-segment scale bar with representative fraction, dashed degree graticule with WGS84 labels, double-border neat line, powered-by and company logos, and optional-content (toggleable) PDF layers
  • PdfWriter.ComputeDecoratedMapExtent returns the map extent adjusted for decoration margins

Usage

Simple geometry/feature export via the extension methods in IRI.Maptor.Extensions:

using IRI.Maptor.Extensions;
using IRI.Maptor.Core.Pdf;
using IRI.Maptor.Core.Spatial.IO.Dxf;   // RgbColor
using IRI.Maptor.Core.Spatial.Primitives;

var polygon = Geometry<Point>.Create(points, GeometryType.Polygon, srid: 4326);

polygon.SaveAsPdf("plain.pdf");        // default styling

var options = new PdfOptions(
    strokeColor: new RgbColor(0, 100, 0),
    fillColor: new RgbColor(144, 238, 144),
    strokeWidth: 2.0)
{
    PageSize = PdfPageSize.A4,
    PageOrientation = PdfPageOrientation.Landscape,
    BoundingBoxPadding = 0.05,          // 5% around the geometry
};

byte[] bytes = polygon.ToPdf(options);
polygon.SaveAsPdf("styled.pdf", options);

Decorated map export — input coordinates for this path are expected in Web Mercator (EPSG:3857):

using IRI.Maptor.Core.Pdf;

var parcels = new PdfWriter.LayerPdfData
{
    LayerName = "Parcels",
    ZIndex = 1,
    Features = parcelFeatures,          // List<Feature<Point>> in Web Mercator
    Options = new PdfOptions(
        strokeColor: new RgbColor(0, 0, 0),
        fillColor: new RgbColor(255, 255, 0, 60),
        strokeWidth: 1.0),
};

var decorations = new PdfMapDecorations
{
    TitleText = "Site Plan",            // Latin text; use TitlePngBytes for RTL/Persian
    ShowScaleBar = true,
    ShowGraticule = true,
    GraticuleIntervalDegrees = 0.5,
};

byte[] pdf = PdfWriter.WriteLayers(
    layers: new List<PdfWriter.LayerPdfData> { parcels },
    mapExtent: extent,                  // BoundingBox in Web Mercator
    mapScale: 0,                        // advisory; derived from the page transform
    baseOptions: new PdfOptions { PageSize = PdfPageSize.A4 },
    rasterLayers: rasterLayers,         // List<PdfWriter.RasterLayerPdfData>
    supportPdfLayers: true,             // emit toggleable optional content groups
    decorations: decorations);

File.WriteAllBytes("map.pdf", pdf);

Dependencies

  • PdfSharpCore
  • IRI.Maptor.Core.Spatial

Limitations

  • Text is Latin-only — PdfSharpCore has no bidi/RTL shaping. For Persian/Arabic titles, supply a pre-rendered TitlePngBytes image.
  • The north arrow decoration is not implemented.
  • The legend column is fixed-width; content flows one column, then two, then shrinks (to a minimum) and is finally clipped with a "+N" indicator. Legend symbols are drawn as vector art (PdfLegendSwatch) and stay crisp at any zoom; a raster swatch is only used as a fallback for symbology the vector path can't express.
  • Raster/tile opacity is not applied to drawn images (a PdfSharpCore DrawImage limitation); vector opacity works.
  • PdfOptions.PointMarker only takes effect on the WriteLayers map-export path; the simple ToPdf/Write path always draws a circle of PointCircleRadius.
  • PdfOptions.CoordinatePrecision is currently unused (no coordinate rounding is applied).
  • Output is a single page; units are PDF points (1/72 inch) with no DPI setting. Set PreserveMapScale plus PreservedWebMercatorScale to size the page so the printed map keeps a given scale.
  • Embedded decoration fonts are registered process-globally (first registration wins).

NuGet package · Report issues · Back to IRI.Maptor.Core

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on IRI.Maptor.Core.Pdf:

Package Downloads
IRI.Maptor.Presentation.Wpf

The WPF map UI library: the central MapViewer control, MVVM building blocks, layer types (feature, raster, grid, group), cartographic rendering and symbology, tile-service providers, map markers, converters/behaviors, and Excel/Word export helpers.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 55 8/23/2026
3.0.0-alpha 55 8/22/2026