DynaPDF Manual - Page 257

Previous Page 256   Index   Next Page 258

Function Reference
Page 257 of 777
Make sure that the same string format is used in a named destination and in a go-to remote action
that tries to access it. Note that the destination cannot be found if the string format is different, e.g.
Ansi in the named destination and Unicode in the go-to remote action.
To avoid unnecessary problems it is usually best to use 7 bit Ansi strings for named destinations.
Return values:
If the function succeeds the return value is the destination handle, a value greater or equal zero. If
the function fails the return value is a negative error code.
LBOOL pdfCreateNewPDF(
const PPDF* IPDF,
// Instance pointer
const char* OutPDF) // File name of the output file or NULL
This function creates a new PDF file. If the parameter OutPDF is an empty string the PDF file is
created in memory. This function resets also the internal error flag if it was set before.
A memory based PDF file is available after CloseFile() or CloseFileEx() was called. To get the file
buffer call the function GetBuffer(). Note that the internal used resources must be freed manually if a
PDF was created in memory. See also GetBuffer().
It is also possible to open the output file with OpenOutputFile() right before CloseFile() is called. The
advantage is that the entire PDF file can be processed before opening the output file. If an error
occurred during processing, the creation of the output file can be discarded so that no empty file will
be left on disk.
This function is implemented in an Ansi and Unicode compatible version. On Windows operating
systems Unicode file names are supported on NT based systems only (Win NT, 2000, XP, and so on).
Non-Windows operating systems use the UTF-8 format to encode Unicode file paths. Therefore, the
Ansi version should be used to open the file. If the Unicode version is used instead the file path is
converted to UTF-8 and passed to the Ansi version of the function.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.

Previous topic: CreateNamedDest

Next topic: CreateOCG