Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Created October 30, 2019 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/1c37f098e8961eba75acefd8a6a98b84 to your computer and use it in GitHub Desktop.
Save GroupDocsGists/1c37f098e8961eba75acefd8a6a98b84 to your computer and use it in GitHub Desktop.
string outputFileTemplate = Path.Combine("c:\output", "converted-page-{0}.png");
SavePageStream getPageStream = page => new FileStream(string.Format(outputFileTemplate, page), FileMode.Create);
using (Converter converter = new Converter("sample.pdf"))
{
ImageConvertOptions options = new ImageConvertOptions
{
Format = ImageFileType.Png,
FlipMode = ImageFlipModes.FlipY,
Brightness = 50,
Contrast = 50,
Gamma = 0.5F,
Grayscale = true,
HorizontalResolution = 300,
VerticalResolution = 100
};
converter.Convert(getPageStream, options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment