Project

PSWritePDF

PowerShell Module to create, edit, split, merge PDF files on Windows / Linux and MacOS

Stars228
Forks23
Open issues20
PowerShell Gallery downloads545124
Releasev0.0.20
Language: C# Updated: 2026-04-11T10:19:10.0000000+00:00

Curated Examples

Create a simple PDF

Use PSWritePDF to create a small document from PowerShell.

This pattern is useful when a script needs to emit a compact PDF artifact.

It comes from the source example at Example/Example01.HelloWorld/Example01_Simple.ps1.

When to use this pattern

  • You need a generated PDF artifact.
  • The content can be authored directly in PowerShell.
  • You want to combine text and simple lists.

Example

Import-Module .\PSWritePDF.psd1 -Force

New-PDF {
    New-PDFText -Text 'Hello ', 'World' -Font HELVETICA, TIMES_ITALIC -FontColor GRAY, BLUE
    New-PDFText -Text 'Generated from PowerShell.' -Font HELVETICA -FontColor RED
    New-PDFList -Indent 3 {
        New-PDFListItem -Text 'First item'
        New-PDFListItem -Text 'Second item'
    }
} -FilePath "$PSScriptRoot\Example01_Simple.pdf" -Show

What this demonstrates

  • creating a document in a script block
  • combining text and list elements
  • writing the generated file to disk

Source