: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
for (i = 0; i < rowBytes; ++i) {
buffer[j++] = rawBytes[i];
for (i = 0; i < pixBytes; ++i) {
buffer[j++] = rawBytes[i];
for (; i < rowBytes; ++i) {
buffer[j] = buffer[j - pixBytes] + rawBytes[i] & 0xff;
for (i = 0; i < rowBytes; ++i) {
buffer[j++] = prevRow[i] + rawBytes[i] & 0xff;
for (i = 0; i < pixBytes; ++i) {
buffer[j++] = (prevRow[i] >> 1) + rawBytes[i];
for (; i < rowBytes; ++i) {
buffer[j] = (prevRow[i] + buffer[j - pixBytes] >> 1) + rawBytes[i] & 0xff;
for (i = 0; i < pixBytes; ++i) {
for (; i < rowBytes; ++i) {
const upLeft = prevRow[i - pixBytes];
const left = buffer[j - pixBytes];
const p = left + up - upLeft;
if (pa <= pb && pa <= pc) {
buffer[j++] = upLeft + c;
throw new FormatError(`Unsupported predictor: ${predictor}`);
this.bufferLength += rowBytes;
;// CONCATENATED MODULE: ./src/core/run_length_stream.js
class RunLengthStream extends DecodeStream {
constructor(str, maybeLength) {
const repeatHeader = this.str.getBytes(2);
if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] === 128) {
let bufferLength = this.bufferLength;
buffer = this.ensureBuffer(bufferLength + n + 1);
buffer[bufferLength++] = repeatHeader[1];
const source = this.str.getBytes(n);
buffer.set(source, bufferLength);
const b = repeatHeader[1];
buffer = this.ensureBuffer(bufferLength + n + 1);
for (let i = 0; i < n; i++) {
buffer[bufferLength++] = b;
this.bufferLength = bufferLength;
;// CONCATENATED MODULE: ./src/core/parser.js
const MAX_LENGTH_TO_CACHE = 1000;
function getInlineImageCacheKey(bytes) {
strBuf.push(bytes[i++] << 8 | bytes[i++]);
return ii + "_" + String.fromCharCode.apply(null, strBuf);
this.allowStreams = allowStreams;
this.recoveryMode = recoveryMode;
this.imageCache = Object.create(null);
this.buf1 = this.lexer.getObj();
this.buf2 = this.lexer.getObj();
if (this.buf2 instanceof Cmd && this.buf2.cmd === "ID") {
this.buf2 = this.lexer.getObj();
if (e instanceof MissingDataException) {
getObj(cipherTransform = null) {
if (buf1 instanceof Cmd) {
return this.makeInlineImage(cipherTransform);
while (!isCmd(this.buf1, "]") && this.buf1 !== EOF) {
array.push(this.getObj(cipherTransform));
throw new ParserEOFException("End of file inside array.");
const dict = new Dict(this.xref);
while (!isCmd(this.buf1, ">>") && this.buf1 !== EOF) {
if (!(this.buf1 instanceof Name)) {
info("Malformed dictionary: key must be a name object");
const key = this.buf1.name;
dict.set(key, this.getObj(cipherTransform));
throw new ParserEOFException("End of file inside dictionary.");
if (isCmd(this.buf2, "stream")) {
return this.allowStreams ? this.makeStream(dict, cipherTransform) : dict;
if (Number.isInteger(buf1)) {
if (Number.isInteger(this.buf1) && isCmd(this.buf2, "R")) {
const ref = Ref.get(buf1, this.buf1);
if (typeof buf1 === "string") {
return cipherTransform.decryptString(buf1);
findDefaultInlineStreamEnd(stream) {
while ((ch = stream.getByte()) !== -1) {
state = ch === E ? 1 : 0;
} else if (state === 1) {
state = ch === I ? 2 : 0;
if (ch === SPACE || ch === LF || ch === CR) {
const followingBytes = stream.peekBytes(n);
const ii = followingBytes.length;
for (let i = 0; i < ii; i++) {
if (ch === NUL && followingBytes[i + 1] !== NUL) {
if (ch !== LF && ch !== CR && (ch < SPACE || ch > 0x7f)) {
warn("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined.");
const tmpLexer = new Lexer(new Stream(followingBytes.slice()), knownCommands);
tmpLexer._hexStringWarn = () => {};
const nextObj = tmpLexer.getObj();
if (nextObj instanceof Cmd) {
const knownCommand = knownCommands[nextObj.cmd];
} else if (knownCommand.variableArgs ? numArgs <= knownCommand.numArgs : numArgs === knownCommand.numArgs) {
warn("findDefaultInlineStreamEnd: " + "Reached the end of the stream without finding a valid EI marker");
warn('... trying to recover by using the last "EI" occurrence.');
stream.skip(-(stream.pos - maybeEIPos));
return stream.pos - endOffset - startPos;
findDCTDecodeInlineStreamEnd(stream) {
const startPos = stream.pos;
while ((b = stream.getByte()) !== -1) {
switch (stream.getByte()) {
markerLength = stream.getUint16();
stream.skip(markerLength - 2);
const length = stream.pos - startPos;
warn("Inline DCTDecode image stream: " + "EOI marker not found, searching for /EI/ instead.");
return this.findDefaultInlineStreamEnd(stream);
this.inlineStreamSkipEI(stream);
findASCII85DecodeInlineStreamEnd(stream) {
const startPos = stream.pos;
while ((ch = stream.getByte()) !== -1) {
const tildePos = stream.pos;
while (isWhiteSpace(ch)) {
if (stream.pos > tildePos) {
const maybeEI = stream.peekBytes(2);
if (maybeEI[0] === 0x45 && maybeEI[1] === 0x49) {
const length = stream.pos - startPos;
warn("Inline ASCII85Decode image stream: " + "EOD marker not found, searching for /EI/ instead.");
return this.findDefaultInlineStreamEnd(stream);
this.inlineStreamSkipEI(stream);
findASCIIHexDecodeInlineStreamEnd(stream) {
const startPos = stream.pos;
while ((ch = stream.getByte()) !== -1) {
const length = stream.pos - startPos;
warn("Inline ASCIIHexDecode image stream: " + "EOD marker not found, searching for /EI/ instead.");
return this.findDefaultInlineStreamEnd(stream);
this.inlineStreamSkipEI(stream);
inlineStreamSkipEI(stream) {
while ((ch = stream.getByte()) !== -1) {
state = ch === E ? 1 : 0;
} else if (state === 1) {
state = ch === I ? 2 : 0;
} else if (state === 2) {
makeInlineImage(cipherTransform) {
const lexer = this.lexer;
const stream = lexer.stream;
const dictMap = Object.create(null);
while (!isCmd(this.buf1, "ID") && this.buf1 !== EOF) {
if (!(this.buf1 instanceof Name)) {
throw new FormatError("Dictionary key must be a name object");
const key = this.buf1.name;