MCPcopy Create free account
hub / github.com/LibPDF-js/core / getDecodedData

Method getDecodedData

src/objects/pdf-stream.ts:108–125  ·  view source on GitHub ↗

* Get the decoded (decompressed) stream data. * * Applies any filters specified in /Filter in order. * Results are not cached - call once and store if needed. * * @returns Decoded data * @throws {Error} if a filter fails or is unknown

()

Source from the content-addressed store, hash-verified

106 * @throws {Error} if a filter fails or is unknown
107 */
108 getDecodedData(): Uint8Array {
109 const filterEntry = this.get("Filter");
110
111 // No filter - return raw data
112 if (!filterEntry) {
113 return this._data;
114 }
115
116 // Build filter specs
117 const filterSpecs = this.buildFilterSpecs(filterEntry);
118
119 if (filterSpecs.length === 0) {
120 return this._data;
121 }
122
123 // Decode through filter pipeline
124 return FilterPipeline.decode(this._data, filterSpecs);
125 }
126
127 /**
128 * Get the encoded (compressed) stream data.

Callers 15

loadExistingDataMethod · 0.80
extractRefHashesMethod · 0.80
parseFileSpecFunction · 0.80
parseStreamMethod · 0.80
parseMethod · 0.80
copyStreamRefMethod · 0.80
copyStreamMethod · 0.80
extractAppearanceStyleFunction · 0.80
parseToUnicodeMapFunction · 0.80

Calls 3

buildFilterSpecsMethod · 0.95
decodeMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected