PoDoFo 0.9.20
Static Public Member Functions | List of all members
PoDoFo::PdfFilterFactory Class Referencefinal

#include <PdfFilter.h>

Static Public Member Functions

static std::unique_ptr< PdfFilterCreate (PdfFilterType filterType)
 
static std::unique_ptr< OutputStreamCreateEncodeStream (const std::shared_ptr< OutputStream > &stream, const PdfFilterList &filters)
 
static std::unique_ptr< InputStreamCreateDecodeStream (const std::shared_ptr< InputStream > &stream, const PdfFilterList &filters, const std::vector< const PdfDictionary * > &decodeParms)
 
static PdfFilterList CreateFilterList (const PdfObject &filtersObj)
 

Detailed Description

A factory to create a filter object for a filter type (as GetType() gives) from the PdfFilterType enum. All filters should be created using this factory.

Member Function Documentation

◆ Create()

unique_ptr< PdfFilter > PdfFilterFactory::Create ( PdfFilterType  filterType)
static

Create a filter from an enum.

Ownership is transferred to the caller, who should let the unique_ptr the filter is returned in take care of freeing it when they're done with it.

Parameters
filterTypereturn value of GetType() for filter to be created
Returns
a new PdfFilter allocated using new, or nullptr if no filter is available for this type.

◆ CreateDecodeStream()

unique_ptr< InputStream > PdfFilterFactory::CreateDecodeStream ( const std::shared_ptr< InputStream > &  stream,
const PdfFilterList &  filters,
const std::vector< const PdfDictionary * > &  decodeParms 
)
static

Create an InputStream that applies a list of filters on all data written to it.

Parameters
filtersa list of filters
streamwrite all data to this OutputStream after it has been decoded.
decodeParmslist of additional parameters for stream decoding
Returns
a new OutputStream that has to be deleted by the caller.
See also
PdfFilterFactory::CreateFilterList

◆ CreateEncodeStream()

unique_ptr< OutputStream > PdfFilterFactory::CreateEncodeStream ( const std::shared_ptr< OutputStream > &  stream,
const PdfFilterList &  filters 
)
static

Create an OutputStream that applies a list of filters on all data written to it.

Parameters
filtersa list of filters
streamwrite all data to this OutputStream after it has been encoded
Returns
a new OutputStream that has to be deleted by the caller.
See also
PdfFilterFactory::CreateFilterList

◆ CreateFilterList()

PdfFilterList PdfFilterFactory::CreateFilterList ( const PdfObject filtersObj)
static

The passed PdfObject has to be a dictionary with a Filters key, a (possibly empty) array of filter names or a filter name.

Parameters
filtersObjmust define a filter or list of filters
Returns
a list of filters