Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 26

Previous Page 25   Index   Next Page 27

Language Bindings
Page 26 of 750
Embarcadero C++ Builder
To use DynaPDF with Embarcadero's C++ Builder, proceed as follows:
1. Open a new project or your favourite project in C++ Builder.
2. Include the header file /include/C_CPP/dynapdf.h into the units which will use
DynaPDF functions.
3. Add the import library /borland_lib/dynapdf.lib to your project.
4. Copy the dynapdf.dll into a Windows search path (e.g. Windows/System32) or into the
output directory.
5. Finished!
If you want to use DynaPDF with a C++ project, add the line "using namespace DynaPDF;" after
including the header file dynapdf.h.
The usage in C is essentially the same as in C++, with the exception that the namespace
DynaPDF must not be declared.
A PDF instance can be used to create an arbitrary count of PDF files. All used resources are
automatically freed when the PDF file is closed (except when the PDF file was created in
memory). To improve processing speed, use one instance as long as possible.
If you want to use DynaPDF with an older version of C++ Builder, you may rebuild the lib file
by using implib.exe. Implib is delivered with C++ Builder; you find it in the Bin directory of
your C++ Builder installation directory.
To create a new import library run implib from the command line as follows:
implib dynapdf.lib dynapdf.dll
DynaPDF uses standard call as calling convention. C++ Builder requires for that calling
convention no underscores before function names. Because of this the option -a must not be
used to build the import library (see your C++ Builder help for further information).
Copy implib and the dynapdf.dll into the same directory and execute the command above.
Example (C++ Builder):
// Standard includes by all C++ Builder projects
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#pragma package(smart_init)
#pragma resource "*.dfm"

Previous topic: Differences between DynaPDF interfaces

Next topic: Microsoft Visual C++