PrintNowPrintNowDocs
PDF Engine

PDF Engine

Overview of PNPDF, PrintNow's custom PDF generation library built for print production workflows.

PNPDF is PrintNow's custom PDF generation library, purpose-built to replace the third-party PdfSharp 1.35 dependency. It is a write-only library designed for professional print production — generating press-ready PDFs with full CMYK support, spot colors, ICC profiles, and PDF/X-4 compliance. PNPDF has zero external dependencies, targets .NET Standard 2.0, and integrates seamlessly across the PrintNow platform.

Every PDF that PrintNow generates — customer proofs, merged order files, single-page exports, and print-ready output — flows through PNPDF.

Why PNPDF Was Built

PdfSharp 1.35 served as PrintNow's PDF library for years, but it lacked critical features for professional print production:

  • No native CMYK color space support
  • No spot color or Pantone support
  • No PDF/X-4 compliance for press-ready output
  • No ICC profile embedding
  • No font subsetting (embedded full fonts, inflating file sizes)
  • No transparency blend modes beyond basic opacity
  • Limited to PDF 1.4 output

PNPDF was built as a drop-in API replacement with matching class names and method signatures, while adding the advanced features print production demands.

Capabilities

Color Management

FeatureDescription
RGB colorsStandard RGB color space with 0-255 or 0.0-1.0 value ranges.
CMYK colorsNative DeviceCMYK color space for print-accurate color output.
GrayscaleDeviceGray color space for monochrome output.
Spot colorsNamed separation colors (e.g., Pantone) with tint support and CMYK/RGB alternates.
ICC profilesEmbed ICC profiles for color-managed workflows. Built-in profiles include FOGRA39, FOGRA51, GRACoL, SWOP, and Japan Color.
Rich blackUtilities for standard rich black formulations and ink coverage limits.

Graphics and Drawing

FeatureDescription
ShapesRectangles, ellipses, arcs, pies, lines, and complex paths with Bezier curves.
GradientsLinear and radial gradients with multi-stop support.
PatternsTiling patterns with rotation and scale transformations.
TransparencyIndependent fill and stroke opacity with 16 blend modes (Multiply, Screen, Overlay, etc.).
ClippingClipping paths with even-odd and winding fill modes.
TransformationsTranslate, rotate, scale, and custom matrix transforms with save/restore state.
OverprintSeparate fill and stroke overprint control for press-accurate ink behavior.

Text and Fonts

FeatureDescription
Font formatsTrueType (.ttf) and CFF/OpenType (.otf) with automatic format detection.
Font subsettingEmbeds only the glyphs used in the document, significantly reducing file size.
Font stylesRegular, Bold, Italic, BoldItalic, Underline, and Strikeout with combinations.
Text alignmentNine alignment positions (TopLeft, Center, BottomRight, etc.).
Text measurementAccurate width and height measurement for layout calculations.
Text to pathConvert text to vector outlines for effects and clipping.

Images

FeatureDescription
JPEGRGB and CMYK JPEG with passthrough (no re-encoding). ICC profile preservation.
PNGRGB, RGBA (alpha extracted as soft mask), Grayscale, and Indexed color. ICC profile preservation.
DeduplicationImages embedded once and referenced by content hash, even when drawn multiple times.
PDF templatesImport existing PDF pages as templates via XPdfForm for overlays and backgrounds.
FeatureDescription
PDF/X-4Full compliance with validation. Output intent embedding and XMP metadata generation.
Page boxesMediaBox, TrimBox, BleedBox, ArtBox, and CropBox for print preparation.
Print marksCrop marks, registration marks, and color bars.
PDF versionsOutput as PDF 1.0 through 2.0. Object streams and cross-reference streams for PDF 1.5+.
CompressionFlateDecode compression with optional object streams for compact file sizes.

How It Fits in the Platform

PNPDF sits at the foundation of PrintNow's PDF pipeline:

  1. PdfManager (Data layer) — the rendering engine that converts product designs into PDF pages. It processes text, images, and drawing spaces, calling PNPDF to compose the final output.
  2. PdfLibraryCompat — an abstraction layer between PdfManager and PNPDF, providing a stable interface during the migration from PdfSharp.
  3. MergeManager — the orchestration layer that coordinates order and product merges, calling PdfManager for each product and assembling the results.
Product Design (JSON)

PdfManager (rendering engine)

PdfLibraryCompat (abstraction)

PNPDF (PDF generation)

PDF file → Azure Blob Storage or Local File System

Every product ordered through the storefront, remerged by an admin, or triggered via the Enterprise API flows through this pipeline.

  • Merge Engine — how PDFs are assembled into final order output
  • Admin Remerge — trigger and monitor PDF remerges from the admin
  • Orders — order management where merged PDFs are accessed
  • Products — product configuration that feeds the PDF pipeline

On this page