Skip to content

StoneFin/xps2img

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Convert xps documents to a .NET bitmap. Supports both single and multi-paged xps documents.

This code is mostly derived from xps2img@sourceforge by Ivan Ivon.

Installing via Nuget

Install-Package xps2img

Supported frameworks

  1. .NET Framework 4.0
  2. .NET Framework 4.5
  3. .NET Framework 4.5.1

Usage

Additional examples

Convert a xps document to png from disk

using (var xpsConverter = new Xps2Image("multipage.xps"))
{
	var images = xpsConverter.ToBitmap(new Parameters
	{
		ImageType = ImageType.Png,
		Dpi = 300
	});
}

Convert a xps document to png from a byte array

using (var xpsConverter = new Xps2Image(File.ReadAllBytes("multipage.xps")))
{
	var images = xpsConverter.ToBitmap(new Parameters
	{
		ImageType = ImageType.Png,
		Dpi = 300
	});
}

Convert a xps document to png from stream

using (var xpsConverter = new Xps2Image(new MemoryStream(File.ReadAllBytes("multipage.xps"))))
{
	var images = xpsConverter.ToBitmap(new Parameters
	{
		ImageType = ImageType.Png,
		Dpi = 300
	});
}

License

GNU LESSER GENERAL PUBLIC LICENSE Version 3

About

Convert xps document to a .NET bitmap

Resources

License

Stars

Watchers

Forks

Packages

No packages published