Skip to content

Leadrive/mupdf-converter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a basic C# .NET 4.0 wrapper for part of the MuPDF library. This code allows you to get .NET 2.0 Bitmap images, WPF .NET 3.0 BitmapSource objects, and raw pixel data of Pdf pages. You can pass in page size parameters to get back custom image sizes.

If you want a .NET 2.0 version of this library all you have to do is strip out the post-.NET 2.0 WPF stuff (should work - haven't tested it).

Included is a sample of how to use this library. I included a MuPDFConverter class that will convert a Pdf document to a Tiff document with minimal input.

This library has been modified to add a monochrome color space. The focus of the monochrome color space is to make the best readable tiff documents for faxing. Some detail (shading, etc) might be lost in the conversion to monochrome tiff images, but that is typically not a concern.

The MuPDF code contained in this project is based off of the latest code checked in at http://git.ghostscript.com/?p=mupdf.git.

The MuPDF library itself is wrapped in a C++ object. Why? Debugging P/Invoke code in C# is not fun. By keeping the core of the library in C++, changes to MuPDF library are abstracted and the P/Invoke code rarely ever needs to change (unless adding functionality).

It was also a design decision to always build and make available 32-bit and 64-bit Dlls. Since mostly anywhere you may want to run this will probably have a mix of those machine types. Eventually 32-bit code will be dropped. There is a measurable performance increase running the 64-bit binaries on a 64-bit machine.

This project has been tested in a multi-threaded conversion environment and has already successfully converted millions of Pdf documents to Tiff format. This library is also used in a C# WPF Image Viewer application used to view documents of multiple types.

About

Automatically exported from code.google.com/p/mupdf-converter

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 86.9%
  • Java 6.5%
  • Objective-C 3.0%
  • C# 1.2%
  • C++ 0.7%
  • Makefile 0.6%
  • Other 1.1%