Using PDFNet in a Delphi / Pascal application.

Q: What is the best way to use PDFNet from a Delphi application? I am
taking a look at your API and the first thing that struck me was the
daunting task it would be to convert all your C header files into
Pascal units so that we could use your DLL with Delphi (there are
hundreds of methods). I also looked at yout PDF2Image SDK
( and it seems to be much easier to
A: You are right, PDF2Image ( would much
simpler to use from Delphi since you only need to provide two function
declarations (PDF2ImageInit and PDF2ImageRun). The downside is that
going through PDF2Image may be slower because you would need to save
and compress the output image to disk (e.g. a temporary file) before
passing it to OCR. With PDFNet you can render and access the image in
memory which is much faster. Also PDFNet is a general purpose PDF
library that can be used for many other things besides PDF to Image

For quick porting of C headers (e.g. 'PDFNetC\Headers\C', PDF2Image
\headers etc) to Delphi you may want to use HeadConv utility. For more
info, please see:

Using C DLLs with Delphi

HeadConv - C DLL Header Converter

I also wanted to mention that instead of creating a wrapper for the
entire PDFNet API, you could implement a small DLL in C/C++ which
would use PDFNet directly to implement custom functionality and then
expose only a small number of custom API-s that can be accessed from

Also, more recent Delphi versions can interop with .NET Framewrok.
Since PDFNet is also available as a .NET component, you may also want
to consider this option.