Emm.DotnetPdf 1.4.0

dotnet tool install --global Emm.DotnetPdf --version 1.4.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local Emm.DotnetPdf --version 1.4.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Emm.DotnetPdf&version=1.4.0
                    
nuke :add-package Emm.DotnetPdf --version 1.4.0
                    

dotnet.pdf

A .NET-based tool for PDF processing, dotnetpdf draws inspiration from PDFtk server.

Features

dotnetpdf commands

  • split: Split a single PDF into multiple files.
  • merge: Combine multiple PDFs into one file.
  • convert: Convert PDF pages to images.
  • imagetopdf: Convert images to a PDF file.
  • text: Extract text from a PDF.
  • bookmarks: Extract PDF bookmarks (outlines).
  • info: Retrieves PDF metadata.
  • rotate: Rotate PDF pages by 90, 180, or 270 degrees.
  • remove: Remove specific pages from a PDF.
  • insert: Insert blank pages into a PDF at specified positions.
  • reorder: Reorder PDF pages according to a specified sequence.
  • list-attachments: List PDF attachments with metadata information.
  • extract-attachments: Extract PDF attachments to disk.
  • list-objects: List all graphical objects on a given page.
  • list-forms: List all interactive form fields in a document.
  • watermark: Add a text or image watermark to all pages of a document.

Installation

Install dotnetpdf as a .NET global tool:

dotnet tool install --global Emm.DotnetPdf

Usage

# Split a PDF using autogenerated names
dotnetpdf split --input <input.pdf>

# Split a PDF specifying output name
dotnetpdf split --input <input.pdf> -names '{page}_{original}_pdf'
 [README.md](..%2FREADME.md)
# Split a PDF using bookmarks as output names, specifying range
dotnetpdf split --input <input.pdf> --use-bookmarks --range 1-5

# You can also create a text file to specify the output filenames, one filename per pdf page
dotnetpdf split --input <input.pdf> --output-script <script.txt>

# Merge PDFs
dotnetpdf merge --output <output> --input <input1> --input <input2> 

# Merge Directory PDF's
dotnetpdf merge --output <output> --input-directory <directory> --recursive false

# Convert PDF to images
dotnetpdf convert --input <input.pdf> --output <directory> --range 1-5 --encoder .png --dpi 100

# Convert image to PDF
dotnetpdf imagetopdf --input <input.png> --output <output.pdf>

# Print PDF text to stdout
dotnetpdf text --input <input.pdf> --format text

# Print PDF text to stdout as json
dotnetpdf text --input <input.pdf> --format json

# Print PDF Bookmarks to stdout
dotnetpdf bookmarks --input <input.pdf>

# Extract PDF Information
dotnetpdf info --input <input.pdf> --format json

# Rotate PDF pages (90, 180, or 270 degrees)
dotnetpdf rotate --input <input.pdf> --output <rotated.pdf> --rotation 180

# Rotate specific pages only
dotnetpdf rotate --input <input.pdf> --output <rotated.pdf> --range 1-3 --rotation 90

# Remove specific pages from PDF
dotnetpdf remove --input <input.pdf> --output <cleaned.pdf> --pages 2,4,6

# Insert blank pages at specified positions
dotnetpdf insert --input <input.pdf> --output <expanded.pdf> --positions 1:2,5:1

# Insert blank pages with custom dimensions (in points)
dotnetpdf insert --input <input.pdf> --output <expanded.pdf> --positions 3:1 --width 595 --height 842

# Reorder PDF pages
dotnetpdf reorder --input <input.pdf> --output <reordered.pdf> --order 3,1,2,4

# List PDF attachments
dotnetpdf list-attachments --input <input.pdf>

# List PDF attachments in JSON format
dotnetpdf list-attachments --input <input.pdf> --format json

# Extract all PDF attachments
dotnetpdf extract-attachments --input <input.pdf> --output <output-directory>

# Extract specific attachment by index
dotnetpdf extract-attachments --input <input.pdf> --output <output-directory> --index 0

# List all objects on page 1
dotnetpdf list-objects --input <input.pdf> --page 1

# List all form fields in a document as JSON
dotnetpdf list-forms --input <input.pdf> --format json

# Add a text watermark
dotnetpdf watermark --input <input.pdf> --output <watermarked.pdf> --text "CONFIDENTIAL"

# Add an image watermark with custom options
dotnetpdf watermark --input <input.pdf> --output <watermarked.pdf> --image <logo.png> --scale 0.5 --opacity 128

# Print Help
dotnetpdf --help
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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 is compatible.  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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.4.0 182 8/1/2025
1.0.0 1,085 12/12/2023

A wide range of new commands have been added to the CLI, including watermarking, listing page objects, and form fields.