DynaPDF Manual - Page 220

Previous Page 219   Index   Next Page 221

Function Reference
Page 220 of 821
Flag
Description
spcFlushPages
If set, the function writes every page directly to the output file to reduce the
memory usage. This flag is meaningful only if the PDF file is not created in
memory. Note also that it is not possible to access already flushed pages again
with EditPage().
Spool files contain sometimes subset fonts and corresponding delta fonts which must be merged
and converted back to regular TrueType fonts. DynaPDF supports these font formats natively.
Microsoft's fontsub.dll is not used for the conversion. This makes it possible to use the function also
on non-Windows operating systems like Linux, Unix, or Mac OS X.
Remarks:
This function is implemented in an Ansi and Unicode compatible version. Unicode paths are
converted to UTF-8 on non-Windows operating systems.
Please note that spool files can be very large. Since the dynapdfm.dll comes without 64 bit file
support, the spool file cannot exceet the 2 GB limit. C or C++ developers should use the regular
dynapdf.dll instead. Customers with a DynaPDF Enterprise license can compile the Multithreaded
DLL variant with Visual Studio 2005 or higher to enable 64 bit file support. Note that the library
depends then on the Visual Studio Redistributable package of the used VS version.
Return values:
The return value depends on the flag spcLoadSpoolFontsOnly. If the flag is set, the function returns
the number of processed font records on success, or the number of converted pages otherwise. If the
function fails, the return value is a negative error code.
Example (C++):
SI32 PDF_CALL PDFError(const void* Data, SI32 ErrCode,
const char* ErrMessage, SI32 ErrType)
{
printf("%s\n", ErrMessage);
return 0; // We try to continue
}
SI32 ConvertSpoolFile(const void* PDF, const char* FileName,
const char* OutFile)
{
if (pdfCreateNewPDF(PDF, OutFile) < 0) return -3;
// In this example we don't need to access the converted pages.
// We can set the flag spcFlushPages to reduce the memory usage.
pdfConvertEMFSpool(PDF, FileName, 0.0, 0.0, spcFlushPages);
// The output intent represents the destination color space for which
// the file was created. It makes sure that we get consistent color
// results in different PDF viewers and when printing the PDF file.
pdfAddOutputIntent(PDF, "../icc/sRGB.icc"); // Optional but recommended
pdfCloseFile(PDF);
 

Previous topic: ConvertEMFSpool

Next topic: ConvToUnicode


Start Chat