Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

18 Commits

Repository files navigation

GhostscriptSharp

GhostscriptSharp is a simple C# wrapper for the Ghostscript library.

Using GhostscriptSharp

The GhostscriptWrapper class contains 3 static methods that can be used to generate jpg images from a PDF file.

Generate an Image for a Single Page

This method will generate a single thumbnail for a single page at the given output path

GeneratePageThumb(string inputPath, string outputPath, int page, int width, int height)

Parameters

  • inputPatha path to the PDF file
  • outputPaththe path where you would like the output jpg
  • pagethe page number for the page you want to create an image from
  • widththe width of the image
  • heightthe height of the image

Generate Multiple Images for Multiple Pages

This method generates a collection of thumbnail jpgs for the PDF at the input path, starting with firstPage and ending with lastPage. Put "%d" somewhere in the output path to have each of the pages numbered.

GeneratePageThumbs(string inputPath, string outputPath, int firstPage, int lastPage, int width, int height)

Parameters

  • inputPatha path to the PDF file
  • ouputPaththe path where you would like the output jpgs to go (put '%d' somewhere in the path to have the jpgs numbered)
  • firstPagethe first page to start generating the thumbnails from
  • lastPagethe last page to end the thumbnail generator
  • widththe width of the image
  • heightthe height of the image

Generate Output Based on Settings

This method generates Ghostscript output at the given output path based on a collection of GhostscriptSettings. (See the source for a list of possible settings)

GenerateOutput(string inputPath, string outputPath, GhostscriptSettings settings)

Parameters

  • inputPatha path to the PDF file
  • outputPaththe path where you would like the output jpg
  • settingsa collection of settings for the output (see source for more details)

About

A C# wrapper for the Ghostscript library (1.1)

Resources

Stars

211 stars

Watchers

20 watching

Forks

Releases

Packages

Used by

Contributors

Languages