MCPcopy
hub / github.com/ShizukuIchi/pdf-editor / open

Method open

public/makeTextPDF.js:62589–62617  ·  view source on GitHub ↗
(src, label)

Source from the content-addressed store, hash-verified

62587 for (let j = 0, end = pixels.length; j < end; j++) {
62588 alphaChannel[i++] = transparency[pixels[j]];
62589 }
62590
62591 this.alphaChannel = zlib.deflateSync(alphaChannel);
62592 return this.finalize();
62593 });
62594 }
62595
62596 decodeData() {
62597 this.image.decodePixels(pixels => {
62598 this.imgData = zlib.deflateSync(pixels);
62599 this.finalize();
62600 });
62601 }
62602
62603}
62604
62605/*
62606PDFImage - embeds images in PDF documents
62607By Devon Govett
62608*/
62609
62610class PDFImage {
62611 static open(src, label) {
62612 let data;
62613
62614 if (Buffer.isBuffer(src)) {
62615 data = src;
62616 } else if (src instanceof ArrayBuffer) {
62617 data = new Buffer(new Uint8Array(src));
62618 } else {
62619 let match;
62620

Callers

nothing calls this directly

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected