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
<PackageReference Include="IRI.Maptor.Core.Pdf" Version="3.0.0" />
<PackageVersion Include="IRI.Maptor.Core.Pdf" Version="3.0.0" />
<PackageReference Include="IRI.Maptor.Core.Pdf" />
paket add IRI.Maptor.Core.Pdf --version 3.0.0
#r "nuget: IRI.Maptor.Core.Pdf, 3.0.0"
#:package IRI.Maptor.Core.Pdf@3.0.0
#addin nuget:?package=IRI.Maptor.Core.Pdf&version=3.0.0
#tool nuget:?package=IRI.Maptor.Core.Pdf&version=3.0.0
IRI.Maptor.Core.Pdf
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 theirMulti*/GeometryCollectionforms - 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.PreserveFeatureAttributesistrue - 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.ComputeDecoratedMapExtentreturns 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
PdfSharpCoreIRI.Maptor.Core.Spatial
Limitations
- Text is Latin-only — PdfSharpCore has no bidi/RTL shaping. For Persian/Arabic titles, supply a pre-rendered
TitlePngBytesimage. - 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
DrawImagelimitation); vector opacity works. PdfOptions.PointMarkeronly takes effect on theWriteLayersmap-export path; the simpleToPdf/Writepath always draws a circle ofPointCircleRadius.PdfOptions.CoordinatePrecisionis currently unused (no coordinate rounding is applied).- Output is a single page; units are PDF points (1/72 inch) with no DPI setting. Set
PreserveMapScaleplusPreservedWebMercatorScaleto size the page so the printed map keeps a given scale. - Embedded decoration fonts are registered process-globally (first registration wins).
| Product | Versions 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. |
-
.NETStandard 2.1
- IRI.Maptor.Core.Spatial (>= 3.0.0)
- PdfSharpCore (>= 1.3.0)
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 |