Discuss this help topic in SecureBlackbox Forum


TElPDFDocument     See also     

Filter: C#  VB.NET  Pascal  C++  PHP  Java  

This event is fired when temporary stream is needed.


    event TSBPDFCreateTemporaryStreamEvent OnCreateTemporaryStream;
    delegate void TSBPDFCreateTemporaryStreamEvent(Object Sender, ref System.IO.Stream Stream, ref bool FreeOnClose);

    Event OnCreateTemporaryStream As TSBPDFCreateTemporaryStreamEvent
    Delegate Sub TSBPDFCreateTemporaryStreamEvent(ByVal Sender As Object, ByRef Stream As System.IO.Stream, ByRef FreeOnClose As Boolean)

    property OnCreateTemporaryStream : TSBPDFCreateTemporaryStreamEvent;
    TSBPDFCreateTemporaryStreamEvent = procedure(Sender: TObject; var Stream: TStream; var FreeOnClose : boolean) of object;

    void get_OnCreateTemporaryStream(TSBPDFCreateTemporaryStreamEvent &pMethodOutResult, void * &pDataOutResult);
    void set_OnCreateTemporaryStream(TSBPDFCreateTemporaryStreamEvent pMethodValue, void * pDataValue);
    typedef void (SB_CALLBACK *TSBPDFCreateTemporaryStreamEvent)(void * _ObjectData, TObjectHandle Sender, TStreamHandle &Stream, int8_t &FreeOnClose);

    TSBPDFCreateTemporaryStreamEvent|callable|NULL get_OnCreateTemporaryStream()
    void set_OnCreateTemporaryStream(TSBPDFCreateTemporaryStreamEvent|callable|NULL $Value)
    callable TSBPDFCreateTemporaryStreamEvent(TObject $Sender, TStream &$Stream, bool &$FreeOnClose)

    TSBPDFCreateTemporaryStreamEvent getOnCreateTemporaryStream();
    void setOnCreateTemporaryStream(TSBPDFCreateTemporaryStreamEvent Value);
    TSBPDFCreateTemporaryStreamEvent.Callback OnCreateTemporaryStream = new TSBPDFCreateTemporaryStreamEvent.Callback() {
        public void TSBPDFCreateTemporaryStreamEventCallback(TObject arg0, TElPDFCreateTemporaryStreamEventParams arg1) {


  • Stream - newly created stream to be used by the document.
  • FreeOnClose - If True - Stream will be destroyed by TElPDFDocument automatically.
    False - Stream will be freed manually by the application.


    Sometimes document needs a temporary buffer for processing. To make memory management more effective, instead of creating it's own temporary stream, PDFDocument fires this event.
    You should create new stream yourself and return it as Stream parameter. The stream will not be disposed of automatically when it's no longer needed, so you can use one stream for many operations. Stream size is set to 0 when the stream is no longer used.
    If the application doesn't handle this event or returns nil (null, Nothing) in Stream parameter, then temporary in-memory stream is created and automatically disposed later.

See also:     OnProgress    

Discuss this help topic in SecureBlackbox Forum