DynaPDF Manual - Page 321

Previous Page 320   Index   Next Page 322

Function Reference
Page 321 of 770
FlushPageContent
Syntax:
SI32 pdfFlushPageContent(
const PPDF* IPDF,
// Instance pointer
struct TPDFStack* Stack) // Operation stack
The function replaces the content stream of a page or template that was changed with the function
ReplacePageText() or ReplacePageTextEx() beforehand.
The function must be called after all changes are made. See GetPageText() for an example
application.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
FlushPages
Syntax:
LBOOL pdfFlushPages(
const PPDF* IPDF,
// Instance pointer
TFlushPageFlags Flags) // see below
typedef enum
{
fpfDefault
= 0, // Write anything to the file that is possible
fpfImagesOnly
= 1, // If set, only images are written to the PDF
// file. All pages are still kept in memory and
// can be modified with EditPage(). Flushed images
// can still be referenced in other pages. The
// image handles remain valid.
fpfExclLastPage = 2
// If set, the last page is not flushed
}TFlushPageFlags;
The function writes the pages in memory to the PDF file. The function can be called every time a new
page was created or whenever the pages in memory are no longer required.
Calling the function on a memory based PDF file is not meaningful. The output file must already be
open before the function can be called. If no output file was set in CreateNewPDF() then open the
output file with OpenOutputFile() or OpenOutputFileEncrypted() beforehand. The latter one can be
used to create an encrypted PDF file.
Flushed pages can no longer be accessed with EditPage() but it is of course possible to add further
pages to the file.
By default, the function writes the content streams of all pages and referenced templates, patterns,
and images to the output file. The content streams of these objects will be released but the objects
remain in memory. So, all handles remain valid and it is still possible to use already flushed objects
in subsequent pages. For example, a flushed image or template can still be inserted in other pages
 

Previous topic: FlattenForm

Next topic: FreeImageBuffer, FreeImageObj, FreeImageObjEx