Home / Products / Platforms: Java, .NET, Python / PDFTextStream.NET

PDFTextStream.NET

PDFTextStream.NET is produced by translating the standard PDFTextStream for Java JAR file into a pure .NET assembly. This translation process is complete, and does not entail any side effects that impair PDFTextStream.NET's functionality, robustness, API's, or performance.

This kind of translation is possible because the Java Virtual Machine (JVM) and the .NET Common Language Runtime (CLR) are very similar architecturally, and the Java and .NET object models are virtually analogous. The actual translation is performed by IKVM's static compilation process. IKVM is an open source toolkit that makes it possible to run Java applications and libraries within the .NET environment.

(IKVM and the included GNU Classpath library both use a license that makes it possible to redistribute them with commercial products. Therefore, licensing PDFTextStream.NET for inclusion in your own product on an OEM basis is perfectly straightforward and poses no threat to your product's license.)

Learn what makes PDFTextStream the best >>

See PDFTextStream in action >>

Download PDFTextStream.NET >>

Requirements

PDFTextStream.NET requires v1.1 or higher of the .NET framework. The library itself consists of three DLL files, all of which are found in the lib directory of the PDFTextStream.NET distribution:

  • PDFTextStream.dll
  • IKVM.GNU.Classpath.dll
  • IKVM.Runtime.dll

The IKVM DLL files are PDFTextStream.NET's only dependencies. They provide the implementation of Java's standard library in .NET, as well as some runtime components that are required by any Java JAR that has been translated into a .NET assembly. No configuration or special initialization of these DLL files are necessary.

Installation

Using PDFTextStream.NET within your .NET project is as simple as adding references to each of the three DLL files indicated in the previous section.

Typical Usage

Using PDFTextStream.NET is very straightforward, and mirrors typical PDFTextStream for Java usage. Here's a sample text extraction function in C#:

using com.snowtide.pdf; namespace DotNetExampleFunction { class ExampleFunction { static string extractPDFText (string pdfFilePath) { java.lang.StringBuffer sb = new java.lang.StringBuffer(1024); OutputTarget tgt = new OutputTarget(sb); PDFTextStream stream = new PDFTextStream(java.io.File(pdfFilePath)); stream.pipe(tgt); stream.close(); return sb.toString(); } } }

All of the PDFTextStream API is available in .NET, including support for extracting bookmarks, annotations and hyperlinks, interactive form data, and document properties. As was mentioned previously, the PDFTextStream javadoc is the authoritative reference for PDFTextStream.NET usage.

What's your PDF problem?