Discuss this help topic in SecureBlackbox Forum

TElPDFDocument.OnCreateTemporaryStream

TElPDFDocument     See also     


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


This event is fired when temporary stream is needed.

Declaration

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

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

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

[C++]
    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);

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

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

Parameters

  • 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.

Description

    Sometimes document needs a temporary buffer for processing. To make memory management more effective, instead of creating its 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 is 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