DynaPDF Manual - Page 41

Previous Page 40   Index   Next Page 42

Language Bindings
Page 41 of 839
Visual C#
The usage of DynaPDF with Visual C# is essentially the same as with C or C++ except that the
exported DLL functions are encapsulated in the wrapper class CPDF to make the usage easier.
The instance pointer IPDF that is used by every DynaPDF function is hidden for the user in C#.
The instance pointer is controlled by the wrapper class so that you must not create PDF
instances manually.
.Net Core compatibility
.Net Core applications can be compiled with Visual Studio for Windows, Linux, and macOS. In
order to use DynaPDF on these operating systems, copy the DynaPDF DLL or shared library
into the output folder. The library can be found in the dynapdf directory on Windows or
download the corresponding Linux or macOS archive respectively:
Windows 32 bit: /dynapdf/win32/dynapdf.dll
Windows 64 bit: /dynapdf/win64/dynapdf.dll
Linux 64 bit:
macOS 64 bit:
Using DynaPDF with Visual Studio
To use DynaPDF with Visual C# proceed as follows:
Add the file /include/Visual_C#/CPDF.cs to your project (menu Project/Add Existing
Make sure that the dynapdf.dll can be found. On the development machine execute the
msi installer (dynapdf.msi). The installer copies the the 32 and 64 bit library into
Windows/System32 and Windows/SysWow64. On Windows 7 or earlier it is also
possible to copy the library manually into the system folders but this is not possible on
Windows 10.
Note that an installation into the system folders is recommended on a development
machine only. On the target system the DLL should be copied into the application folder
to avoid issues with different DynaPDF versions which might be installed on the system.
64 Bit Applications
With C# you can develop 32 bit and 64 bit applications. One thing that must be considered is
that the target CPU type in Visual Studio must not be set to UseAny. This is impossible since
you can either link the 32 bit dynapdf.dll or the 64 bit version but not both.
So, a 32 bit and 64 bit version must be compiled separately. Another thing that is often
misunderstood is the right system directory for the dynapdf.dll. If you develop a 32 bit

Previous topic: Data types used by DynaPDF, Exception handling in VB .Net, The DoEvents problem

Next topic: General Note:, Data types in C#