GetObjectPathStream

Document properties, Content extraction

Description

Resolves an object path to a stream and returns its decoded bytes, applying the stream filter chain

Syntax

Delphi

Function GetObjectPathStream(Const Path: WideString; MaxLength: Integer): AnsiString;

ActiveX

Function PDFlib::GetObjectPathStream(Path As String, MaxLength As Long) As Variant

DLL

const char* DLGetObjectPathStream(int InstanceID, const wchar_t* Path, int MaxLength);
const char* DLGetObjectPathStreamA(int InstanceID, const char* Path, int MaxLength);

Parameters

PathObject path selecting a stream, for example pages[0]/Contents[0] for the first content layer
MaxLengthByte cap for the returned data; MaxLength 0 or a non-stream leaf returns an empty string

Return values

Decoded stream bytes, truncated to MaxLength when longer

Remarks

Page content saved as multiple layers is an array, so index the layer explicitly; font programs, metadata and other stream objects resolve the same way

ASCII hexadecimal decoding stops at the first > end-of-data marker and pads an odd final digit with zero; bytes after the marker do not count toward decoded output or enter the next filter

ASCII85 decoding returns no decoded bytes for an invalid digit, a misplaced z, a one-digit final group, an overflowing group or a missing ~> terminator; valid whitespace is ignored

See also

GetObjectByPath, GetObjectPathStreamLength, GetObjectPathNumber