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

DynaPDF Manual - Page 250

Previous Page 249   Index   Next Page 251

Function Reference
Page 250 of 750
Remarks:
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.
CreateNewPDF
Syntax:
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.
Remarks:
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