pdf-codec 3.4.4 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -26
- package/dist/{afm-widths-Dxucrg7D.js → afm-widths-BLl6ORCt.js} +2 -2
- package/dist/{afm-widths-BoeTOK2r.cjs → afm-widths-Cj9d3GVK.cjs} +2 -2
- package/dist/{afm-widths-DyDq56Ph.d.cts → afm-widths-CneRyu5l.d.cts} +1 -1
- package/dist/{afm-widths-DyDq56Ph.d.ts → afm-widths-CneRyu5l.d.ts} +1 -1
- package/dist/afm-widths.cjs +1 -1
- package/dist/afm-widths.d.cts +1 -1
- package/dist/afm-widths.d.ts +1 -1
- package/dist/afm-widths.js +1 -1
- package/dist/content-read.d.cts +2 -2
- package/dist/content-read.d.ts +2 -2
- package/dist/content-write.cjs +1 -1
- package/dist/content-write.d.cts +3 -3
- package/dist/content-write.d.ts +3 -3
- package/dist/content-write.js +1 -1
- package/dist/diagnostics.d.cts +1 -1
- package/dist/diagnostics.d.ts +1 -1
- package/dist/encoding.cjs +1 -1
- package/dist/encoding.js +1 -1
- package/dist/encrypt.d.cts +1 -1
- package/dist/encrypt.d.ts +1 -1
- package/dist/filters.cjs +14 -10
- package/dist/filters.js +14 -10
- package/dist/font-read.cjs +1 -1
- package/dist/font-read.js +1 -1
- package/dist/font-registry.d.cts +3 -3
- package/dist/font-registry.d.ts +3 -3
- package/dist/font-substitutes.d.cts +1 -1
- package/dist/font-substitutes.d.ts +1 -1
- package/dist/fonts.d.cts +2 -2
- package/dist/fonts.d.ts +2 -2
- package/dist/image/jbig2-bitmap.d.cts +1 -1
- package/dist/image/jbig2-bitmap.d.ts +1 -1
- package/dist/image/jbig2.cjs +3 -1
- package/dist/image/jbig2.js +3 -1
- package/dist/image/jp2-boxes.d.cts +1 -1
- package/dist/image/jp2-boxes.d.ts +1 -1
- package/dist/image/jpeg2000-codestream.d.cts +3 -3
- package/dist/image/jpeg2000-codestream.d.ts +3 -3
- package/dist/image/jpeg2000-t1.d.cts +1 -1
- package/dist/image/jpeg2000-t1.d.ts +1 -1
- package/dist/image/png-encode.d.cts +1 -1
- package/dist/image/png-encode.d.ts +1 -1
- package/dist/image/png-filter.d.cts +1 -1
- package/dist/image/png-filter.d.ts +1 -1
- package/dist/images-read.cjs +7 -5
- package/dist/images-read.d.cts +1 -1
- package/dist/images-read.d.ts +1 -1
- package/dist/images-read.js +7 -5
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/interpret.d.cts +10 -10
- package/dist/interpret.d.ts +10 -10
- package/dist/layout.d.cts +1 -1
- package/dist/layout.d.ts +1 -1
- package/dist/lexer.d.cts +9 -9
- package/dist/lexer.d.ts +9 -9
- package/dist/math-font.d.cts +1 -1
- package/dist/math-font.d.ts +1 -1
- package/dist/{math-stretch-a_rHNRvc.d.ts → math-stretch-BbC2o4Br.d.ts} +1 -1
- package/dist/{math-stretch-E26z6byT.d.cts → math-stretch-C2JanDAz.d.cts} +1 -1
- package/dist/math-stretch.d.cts +1 -1
- package/dist/math-stretch.d.ts +1 -1
- package/dist/measure.cjs +1 -1
- package/dist/measure.d.cts +1 -1
- package/dist/measure.d.ts +1 -1
- package/dist/measure.js +1 -1
- package/dist/objects.d.cts +12 -12
- package/dist/objects.d.ts +12 -12
- package/dist/util/base64.cjs +4 -4
- package/dist/util/base64.js +4 -4
- package/dist/winansi.cjs +1 -1
- package/dist/winansi.d.cts +1 -1
- package/dist/winansi.d.ts +1 -1
- package/dist/winansi.js +1 -1
- package/dist/write.cjs +1 -1
- package/dist/write.js +1 -1
- package/dist/xref.d.cts +2 -2
- package/dist/xref.d.ts +2 -2
- package/package.json +3 -11
|
@@ -11,7 +11,7 @@ declare class Jbig2BitmapTooLargeError extends Jbig2ParseError {
|
|
|
11
11
|
}
|
|
12
12
|
declare function createBitmap(width: number, height: number, fill?: number): Jbig2Bitmap;
|
|
13
13
|
declare function getPixel(bitmap: Jbig2Bitmap, x: number, y: number): number;
|
|
14
|
-
type Jbig2CombinationOperator =
|
|
14
|
+
type Jbig2CombinationOperator = "or" | "and" | "xor" | "xnor" | "replace";
|
|
15
15
|
declare function combinationOperatorFromCode(code: number): Jbig2CombinationOperator | undefined;
|
|
16
16
|
declare function combineBitmap(destination: Jbig2Bitmap, source: Jbig2Bitmap, x: number, y: number, operator: Jbig2CombinationOperator): void;
|
|
17
17
|
declare function packBitmapRows(bitmap: Jbig2Bitmap, width: number, height: number): Uint8Array<ArrayBuffer>;
|
package/dist/image/jbig2.cjs
CHANGED
|
@@ -206,7 +206,9 @@ var Jbig2Decoder = class {
|
|
|
206
206
|
columns: region.width,
|
|
207
207
|
rows: region.height,
|
|
208
208
|
blackIs1: true,
|
|
209
|
-
onWarning: (message) =>
|
|
209
|
+
onWarning: (message) => {
|
|
210
|
+
this.warn(message);
|
|
211
|
+
}
|
|
210
212
|
});
|
|
211
213
|
this.compose(region, require_image_jbig2_bitmap.unpackBitmapRows(fax.bytes, region.width, region.height));
|
|
212
214
|
return;
|
package/dist/image/jbig2.js
CHANGED
|
@@ -205,7 +205,9 @@ var Jbig2Decoder = class {
|
|
|
205
205
|
columns: region.width,
|
|
206
206
|
rows: region.height,
|
|
207
207
|
blackIs1: true,
|
|
208
|
-
onWarning: (message) =>
|
|
208
|
+
onWarning: (message) => {
|
|
209
|
+
this.warn(message);
|
|
210
|
+
}
|
|
209
211
|
});
|
|
210
212
|
this.compose(region, unpackBitmapRows(fax.bytes, region.width, region.height));
|
|
211
213
|
return;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/image/jp2-boxes.d.ts
|
|
2
|
-
type Jp2ColourSpace =
|
|
2
|
+
type Jp2ColourSpace = "greyscale" | "srgb" | "sycc" | "cmyk" | "e-srgb" | "rommrgb" | "cielab";
|
|
3
3
|
interface Jp2ImageHeader {
|
|
4
4
|
readonly width: number;
|
|
5
5
|
readonly height: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/image/jp2-boxes.d.ts
|
|
2
|
-
type Jp2ColourSpace =
|
|
2
|
+
type Jp2ColourSpace = "greyscale" | "srgb" | "sycc" | "cmyk" | "e-srgb" | "rommrgb" | "cielab";
|
|
3
3
|
interface Jp2ImageHeader {
|
|
4
4
|
readonly width: number;
|
|
5
5
|
readonly height: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region src/image/jpeg2000-codestream.d.ts
|
|
2
|
-
type Jpeg2000ProgressionOrder =
|
|
3
|
-
type Jpeg2000Transform =
|
|
4
|
-
type Jpeg2000QuantizationStyle =
|
|
2
|
+
type Jpeg2000ProgressionOrder = "LRCP" | "RLCP" | "RPCL" | "PCRL" | "CPRL";
|
|
3
|
+
type Jpeg2000Transform = "reversible-5-3" | "irreversible-9-7";
|
|
4
|
+
type Jpeg2000QuantizationStyle = "none" | "derived" | "expounded";
|
|
5
5
|
interface Jpeg2000ComponentSize {
|
|
6
6
|
readonly signed: boolean;
|
|
7
7
|
readonly bitDepth: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region src/image/jpeg2000-codestream.d.ts
|
|
2
|
-
type Jpeg2000ProgressionOrder =
|
|
3
|
-
type Jpeg2000Transform =
|
|
4
|
-
type Jpeg2000QuantizationStyle =
|
|
2
|
+
type Jpeg2000ProgressionOrder = "LRCP" | "RLCP" | "RPCL" | "PCRL" | "CPRL";
|
|
3
|
+
type Jpeg2000Transform = "reversible-5-3" | "irreversible-9-7";
|
|
4
|
+
type Jpeg2000QuantizationStyle = "none" | "derived" | "expounded";
|
|
5
5
|
interface Jpeg2000ComponentSize {
|
|
6
6
|
readonly signed: boolean;
|
|
7
7
|
readonly bitDepth: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RawImage } from "./png-decode.cjs";
|
|
2
2
|
//#region src/image/png-encode.d.ts
|
|
3
3
|
interface PngEncodeOptions {
|
|
4
|
-
readonly filter?:
|
|
4
|
+
readonly filter?: "none" | "adaptive";
|
|
5
5
|
}
|
|
6
6
|
declare function encodePng(image: RawImage, options?: PngEncodeOptions): Uint8Array<ArrayBuffer>;
|
|
7
7
|
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RawImage } from "./png-decode.js";
|
|
2
2
|
//#region src/image/png-encode.d.ts
|
|
3
3
|
interface PngEncodeOptions {
|
|
4
|
-
readonly filter?:
|
|
4
|
+
readonly filter?: "none" | "adaptive";
|
|
5
5
|
}
|
|
6
6
|
declare function encodePng(image: RawImage, options?: PngEncodeOptions): Uint8Array<ArrayBuffer>;
|
|
7
7
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/image/png-filter.d.ts
|
|
2
2
|
type PngFilterType = 0 | 1 | 2 | 3 | 4;
|
|
3
3
|
declare function unfilterScanlines(data: Uint8Array<ArrayBuffer>, height: number, bytesPerRow: number, bpp: number): Uint8Array<ArrayBuffer>;
|
|
4
|
-
declare function filterScanlines(raw: Uint8Array<ArrayBuffer>, height: number, bytesPerRow: number, bpp: number, strategy?:
|
|
4
|
+
declare function filterScanlines(raw: Uint8Array<ArrayBuffer>, height: number, bytesPerRow: number, bpp: number, strategy?: "none" | "adaptive"): Uint8Array<ArrayBuffer>;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { PngFilterType, filterScanlines, unfilterScanlines };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/image/png-filter.d.ts
|
|
2
2
|
type PngFilterType = 0 | 1 | 2 | 3 | 4;
|
|
3
3
|
declare function unfilterScanlines(data: Uint8Array<ArrayBuffer>, height: number, bytesPerRow: number, bpp: number): Uint8Array<ArrayBuffer>;
|
|
4
|
-
declare function filterScanlines(raw: Uint8Array<ArrayBuffer>, height: number, bytesPerRow: number, bpp: number, strategy?:
|
|
4
|
+
declare function filterScanlines(raw: Uint8Array<ArrayBuffer>, height: number, bytesPerRow: number, bpp: number, strategy?: "none" | "adaptive"): Uint8Array<ArrayBuffer>;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { PngFilterType, filterScanlines, unfilterScanlines };
|
package/dist/images-read.cjs
CHANGED
|
@@ -185,11 +185,13 @@ function jpeg2000ChannelKind(image, dict, resolver, sink) {
|
|
|
185
185
|
function readJpeg2000Image(dict, raw, resolver, sink) {
|
|
186
186
|
let image;
|
|
187
187
|
try {
|
|
188
|
-
image = require_image_jpeg2000.decodeJpeg2000(raw, { onWarning: (message) =>
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
188
|
+
image = require_image_jpeg2000.decodeJpeg2000(raw, { onWarning: (message) => {
|
|
189
|
+
sink({
|
|
190
|
+
code: "image/jpx-degraded",
|
|
191
|
+
severity: "warning",
|
|
192
|
+
message
|
|
193
|
+
});
|
|
194
|
+
} });
|
|
193
195
|
} catch (error) {
|
|
194
196
|
sink({
|
|
195
197
|
code: "image/jpx-undecodable",
|
package/dist/images-read.d.cts
CHANGED
|
@@ -3,7 +3,7 @@ import { PdfDict } from "./objects.cjs";
|
|
|
3
3
|
import { PdfObjectResolver } from "./interpret.cjs";
|
|
4
4
|
//#region src/images-read.d.ts
|
|
5
5
|
interface ExtractedPdfImage {
|
|
6
|
-
readonly format:
|
|
6
|
+
readonly format: "png" | "jpeg";
|
|
7
7
|
readonly bytes: Uint8Array<ArrayBuffer>;
|
|
8
8
|
readonly widthPx: number;
|
|
9
9
|
readonly heightPx: number;
|
package/dist/images-read.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { PdfDict } from "./objects.js";
|
|
|
3
3
|
import { PdfObjectResolver } from "./interpret.js";
|
|
4
4
|
//#region src/images-read.d.ts
|
|
5
5
|
interface ExtractedPdfImage {
|
|
6
|
-
readonly format:
|
|
6
|
+
readonly format: "png" | "jpeg";
|
|
7
7
|
readonly bytes: Uint8Array<ArrayBuffer>;
|
|
8
8
|
readonly widthPx: number;
|
|
9
9
|
readonly heightPx: number;
|
package/dist/images-read.js
CHANGED
|
@@ -184,11 +184,13 @@ function jpeg2000ChannelKind(image, dict, resolver, sink) {
|
|
|
184
184
|
function readJpeg2000Image(dict, raw, resolver, sink) {
|
|
185
185
|
let image;
|
|
186
186
|
try {
|
|
187
|
-
image = decodeJpeg2000(raw, { onWarning: (message) =>
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
187
|
+
image = decodeJpeg2000(raw, { onWarning: (message) => {
|
|
188
|
+
sink({
|
|
189
|
+
code: "image/jpx-degraded",
|
|
190
|
+
severity: "warning",
|
|
191
|
+
message
|
|
192
|
+
});
|
|
193
|
+
} });
|
|
192
194
|
} catch (error) {
|
|
193
195
|
sink({
|
|
194
196
|
code: "image/jpx-undecodable",
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_afm_widths = require("./afm-widths-
|
|
2
|
+
const require_afm_widths = require("./afm-widths-Cj9d3GVK.cjs");
|
|
3
3
|
const require_image_ccitt = require("./image/ccitt.cjs");
|
|
4
4
|
const require_image_jbig2_errors = require("./image/jbig2-errors.cjs");
|
|
5
5
|
const require_image_jbig2 = require("./image/jbig2.cjs");
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as STANDARD_METRICS, r as StandardFontName, t as FontMetrics } from "./afm-widths-
|
|
1
|
+
import { n as STANDARD_METRICS, r as StandardFontName, t as FontMetrics } from "./afm-widths-CneRyu5l.cjs";
|
|
2
2
|
import { NOOP_DIAGNOSTIC_SINK, PdfDiagnostic, PdfDiagnosticSeverity, PdfDiagnosticSink, PdfEncryptedError, PdfParseError, PdfPasswordRequiredError } from "./diagnostics.cjs";
|
|
3
3
|
import { LAYOUT_FORMAT_VERSION, LayoutAnnotation, LayoutAnnotationQuad, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachment, LayoutAttachmentSchema, LayoutDestination, LayoutDestinationSchema, LayoutDestinationTarget, LayoutDestinationTargetSchema, LayoutDocument, LayoutDocumentSchema, LayoutEllipse, LayoutEllipseSchema, LayoutFormField, LayoutFormFieldSchema, LayoutFormWidget, LayoutFormWidgetSchema, LayoutImage, LayoutImageAsset, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLink, LayoutInternalLinkSchema, LayoutItem, LayoutItemSchema, LayoutLayer, LayoutLayerSchema, LayoutLine, LayoutLineSchema, LayoutLink, LayoutLinkSchema, LayoutOutlineItem, LayoutOutlineItemSchema, LayoutPage, LayoutPageSchema, LayoutPath, LayoutPathSchema, LayoutPathSegment, LayoutPathSegmentSchema, LayoutRect, LayoutRectSchema, LayoutStructureElement, LayoutStructureElementSchema, LayoutSubpath, LayoutSubpathSchema, LayoutText, LayoutTextSchema } from "./layout.cjs";
|
|
4
4
|
import { t as GlyphInkBounds } from "./glyph-bounds-BV_Z40KS.cjs";
|
|
@@ -19,7 +19,7 @@ import { filterScanlines, unfilterScanlines } from "./image/png-filter.cjs";
|
|
|
19
19
|
import { ReadPdfOptions, readPdf } from "./read.cjs";
|
|
20
20
|
import { WritePdfOptions, writePdf } from "./write.cjs";
|
|
21
21
|
import { a as MathGlyphPart, c as MathVariants, n as MathGlyphAssembly, o as MathGlyphVariant, r as MathGlyphConstruction } from "./math-table-gFNB8DmQ.cjs";
|
|
22
|
-
import { a as scaleMathStretchConstruction, i as assembleStretchyGlyph, n as MathStretchOptions, r as MathStretchPlacement, t as MathStretchConstruction } from "./math-stretch-
|
|
22
|
+
import { a as scaleMathStretchConstruction, i as assembleStretchyGlyph, n as MathStretchOptions, r as MathStretchPlacement, t as MathStretchConstruction } from "./math-stretch-C2JanDAz.cjs";
|
|
23
23
|
import { LoadedMathFont, MathFont, MathFontDescriptorMetrics, loadMathFont } from "./math-font.cjs";
|
|
24
24
|
import { DEFAULT_VERTICAL_METRIC_POLICY, FontMeasurerOptions, StandardFontMeasurerOptions, VerticalMetricPolicy, createFontMeasurer, createStandardFontMeasurer } from "./measure.cjs";
|
|
25
25
|
import { FontRegistryOptions, FontSubstitution, MathAssembledGlyphs, MathBox, MathColor, MathFontMetrics, MathGlyphMetrics, MathGlyphPlacement, MathGlyphRun, MathLayoutItem, MathRule, MathStretchAxis, MathStretchGlyph, MathStretchResult, MathStroke, Point, PositionedFormula, ProvidedFont, StyledFragment, StyledRun, TextMeasurer, UnderlineMetrics, WrapOptions, WrappedLine } from "document-schema.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as STANDARD_METRICS, r as StandardFontName, t as FontMetrics } from "./afm-widths-
|
|
1
|
+
import { n as STANDARD_METRICS, r as StandardFontName, t as FontMetrics } from "./afm-widths-CneRyu5l.js";
|
|
2
2
|
import { NOOP_DIAGNOSTIC_SINK, PdfDiagnostic, PdfDiagnosticSeverity, PdfDiagnosticSink, PdfEncryptedError, PdfParseError, PdfPasswordRequiredError } from "./diagnostics.js";
|
|
3
3
|
import { LAYOUT_FORMAT_VERSION, LayoutAnnotation, LayoutAnnotationQuad, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachment, LayoutAttachmentSchema, LayoutDestination, LayoutDestinationSchema, LayoutDestinationTarget, LayoutDestinationTargetSchema, LayoutDocument, LayoutDocumentSchema, LayoutEllipse, LayoutEllipseSchema, LayoutFormField, LayoutFormFieldSchema, LayoutFormWidget, LayoutFormWidgetSchema, LayoutImage, LayoutImageAsset, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLink, LayoutInternalLinkSchema, LayoutItem, LayoutItemSchema, LayoutLayer, LayoutLayerSchema, LayoutLine, LayoutLineSchema, LayoutLink, LayoutLinkSchema, LayoutOutlineItem, LayoutOutlineItemSchema, LayoutPage, LayoutPageSchema, LayoutPath, LayoutPathSchema, LayoutPathSegment, LayoutPathSegmentSchema, LayoutRect, LayoutRectSchema, LayoutStructureElement, LayoutStructureElementSchema, LayoutSubpath, LayoutSubpathSchema, LayoutText, LayoutTextSchema } from "./layout.js";
|
|
4
4
|
import { t as GlyphInkBounds } from "./glyph-bounds-BV_Z40KS.js";
|
|
@@ -19,7 +19,7 @@ import { filterScanlines, unfilterScanlines } from "./image/png-filter.js";
|
|
|
19
19
|
import { ReadPdfOptions, readPdf } from "./read.js";
|
|
20
20
|
import { WritePdfOptions, writePdf } from "./write.js";
|
|
21
21
|
import { a as MathGlyphPart, c as MathVariants, n as MathGlyphAssembly, o as MathGlyphVariant, r as MathGlyphConstruction } from "./math-table-DhPrNoPa.js";
|
|
22
|
-
import { a as scaleMathStretchConstruction, i as assembleStretchyGlyph, n as MathStretchOptions, r as MathStretchPlacement, t as MathStretchConstruction } from "./math-stretch-
|
|
22
|
+
import { a as scaleMathStretchConstruction, i as assembleStretchyGlyph, n as MathStretchOptions, r as MathStretchPlacement, t as MathStretchConstruction } from "./math-stretch-BbC2o4Br.js";
|
|
23
23
|
import { LoadedMathFont, MathFont, MathFontDescriptorMetrics, loadMathFont } from "./math-font.js";
|
|
24
24
|
import { DEFAULT_VERTICAL_METRIC_POLICY, FontMeasurerOptions, StandardFontMeasurerOptions, VerticalMetricPolicy, createFontMeasurer, createStandardFontMeasurer } from "./measure.js";
|
|
25
25
|
import { FontRegistryOptions, FontSubstitution, MathAssembledGlyphs, MathBox, MathColor, MathFontMetrics, MathGlyphMetrics, MathGlyphPlacement, MathGlyphRun, MathLayoutItem, MathRule, MathStretchAxis, MathStretchGlyph, MathStretchResult, MathStroke, Point, PositionedFormula, ProvidedFont, StyledFragment, StyledRun, TextMeasurer, UnderlineMetrics, WrapOptions, WrappedLine } from "document-schema.js";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as STANDARD_METRICS } from "./afm-widths-
|
|
1
|
+
import { t as STANDARD_METRICS } from "./afm-widths-BLl6ORCt.js";
|
|
2
2
|
import { decodeCcittFax } from "./image/ccitt.js";
|
|
3
3
|
import { Jbig2ParseError, Jbig2UnsupportedError } from "./image/jbig2-errors.js";
|
|
4
4
|
import { decodeJbig2Embedded } from "./image/jbig2.js";
|
package/dist/interpret.d.cts
CHANGED
|
@@ -4,7 +4,7 @@ import { PdfDict, PdfObject } from "./objects.cjs";
|
|
|
4
4
|
import { Color } from "document-schema.js";
|
|
5
5
|
//#region src/interpret.d.ts
|
|
6
6
|
interface ExtractedTextRun {
|
|
7
|
-
readonly kind:
|
|
7
|
+
readonly kind: "text";
|
|
8
8
|
readonly codes: Uint8Array<ArrayBuffer>;
|
|
9
9
|
readonly fontResourceName: string;
|
|
10
10
|
readonly resources: PdfDict;
|
|
@@ -27,21 +27,21 @@ interface ExtractedPaint {
|
|
|
27
27
|
readonly mcid?: number;
|
|
28
28
|
}
|
|
29
29
|
interface ExtractedRect extends ExtractedPaint {
|
|
30
|
-
readonly kind:
|
|
30
|
+
readonly kind: "rect";
|
|
31
31
|
readonly xPt: number;
|
|
32
32
|
readonly yPt: number;
|
|
33
33
|
readonly widthPt: number;
|
|
34
34
|
readonly heightPt: number;
|
|
35
35
|
}
|
|
36
36
|
interface ExtractedEllipse extends ExtractedPaint {
|
|
37
|
-
readonly kind:
|
|
37
|
+
readonly kind: "ellipse";
|
|
38
38
|
readonly xPt: number;
|
|
39
39
|
readonly yPt: number;
|
|
40
40
|
readonly widthPt: number;
|
|
41
41
|
readonly heightPt: number;
|
|
42
42
|
}
|
|
43
43
|
interface ExtractedLine {
|
|
44
|
-
readonly kind:
|
|
44
|
+
readonly kind: "line";
|
|
45
45
|
readonly x1Pt: number;
|
|
46
46
|
readonly y1Pt: number;
|
|
47
47
|
readonly x2Pt: number;
|
|
@@ -52,11 +52,11 @@ interface ExtractedLine {
|
|
|
52
52
|
readonly mcid?: number;
|
|
53
53
|
}
|
|
54
54
|
type ExtractedPathSegment = {
|
|
55
|
-
readonly kind:
|
|
55
|
+
readonly kind: "line";
|
|
56
56
|
readonly xPt: number;
|
|
57
57
|
readonly yPt: number;
|
|
58
58
|
} | {
|
|
59
|
-
readonly kind:
|
|
59
|
+
readonly kind: "cubic";
|
|
60
60
|
readonly c1xPt: number;
|
|
61
61
|
readonly c1yPt: number;
|
|
62
62
|
readonly c2xPt: number;
|
|
@@ -71,12 +71,12 @@ interface ExtractedSubpath {
|
|
|
71
71
|
readonly closed: boolean;
|
|
72
72
|
}
|
|
73
73
|
interface ExtractedPath extends ExtractedPaint {
|
|
74
|
-
readonly kind:
|
|
74
|
+
readonly kind: "path";
|
|
75
75
|
readonly subpaths: readonly ExtractedSubpath[];
|
|
76
|
-
readonly fillRule:
|
|
76
|
+
readonly fillRule: "nonzero" | "evenodd";
|
|
77
77
|
}
|
|
78
78
|
interface ExtractedImage {
|
|
79
|
-
readonly kind:
|
|
79
|
+
readonly kind: "image";
|
|
80
80
|
readonly resourceName: string;
|
|
81
81
|
readonly resources: PdfDict;
|
|
82
82
|
readonly matrix: Matrix;
|
|
@@ -84,7 +84,7 @@ interface ExtractedImage {
|
|
|
84
84
|
readonly mcid?: number;
|
|
85
85
|
}
|
|
86
86
|
interface ExtractedInlineImage {
|
|
87
|
-
readonly kind:
|
|
87
|
+
readonly kind: "inlineImage";
|
|
88
88
|
readonly dict: PdfDict;
|
|
89
89
|
readonly data: Uint8Array<ArrayBuffer>;
|
|
90
90
|
readonly matrix: Matrix;
|
package/dist/interpret.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { PdfDict, PdfObject } from "./objects.js";
|
|
|
4
4
|
import { Color } from "document-schema.js";
|
|
5
5
|
//#region src/interpret.d.ts
|
|
6
6
|
interface ExtractedTextRun {
|
|
7
|
-
readonly kind:
|
|
7
|
+
readonly kind: "text";
|
|
8
8
|
readonly codes: Uint8Array<ArrayBuffer>;
|
|
9
9
|
readonly fontResourceName: string;
|
|
10
10
|
readonly resources: PdfDict;
|
|
@@ -27,21 +27,21 @@ interface ExtractedPaint {
|
|
|
27
27
|
readonly mcid?: number;
|
|
28
28
|
}
|
|
29
29
|
interface ExtractedRect extends ExtractedPaint {
|
|
30
|
-
readonly kind:
|
|
30
|
+
readonly kind: "rect";
|
|
31
31
|
readonly xPt: number;
|
|
32
32
|
readonly yPt: number;
|
|
33
33
|
readonly widthPt: number;
|
|
34
34
|
readonly heightPt: number;
|
|
35
35
|
}
|
|
36
36
|
interface ExtractedEllipse extends ExtractedPaint {
|
|
37
|
-
readonly kind:
|
|
37
|
+
readonly kind: "ellipse";
|
|
38
38
|
readonly xPt: number;
|
|
39
39
|
readonly yPt: number;
|
|
40
40
|
readonly widthPt: number;
|
|
41
41
|
readonly heightPt: number;
|
|
42
42
|
}
|
|
43
43
|
interface ExtractedLine {
|
|
44
|
-
readonly kind:
|
|
44
|
+
readonly kind: "line";
|
|
45
45
|
readonly x1Pt: number;
|
|
46
46
|
readonly y1Pt: number;
|
|
47
47
|
readonly x2Pt: number;
|
|
@@ -52,11 +52,11 @@ interface ExtractedLine {
|
|
|
52
52
|
readonly mcid?: number;
|
|
53
53
|
}
|
|
54
54
|
type ExtractedPathSegment = {
|
|
55
|
-
readonly kind:
|
|
55
|
+
readonly kind: "line";
|
|
56
56
|
readonly xPt: number;
|
|
57
57
|
readonly yPt: number;
|
|
58
58
|
} | {
|
|
59
|
-
readonly kind:
|
|
59
|
+
readonly kind: "cubic";
|
|
60
60
|
readonly c1xPt: number;
|
|
61
61
|
readonly c1yPt: number;
|
|
62
62
|
readonly c2xPt: number;
|
|
@@ -71,12 +71,12 @@ interface ExtractedSubpath {
|
|
|
71
71
|
readonly closed: boolean;
|
|
72
72
|
}
|
|
73
73
|
interface ExtractedPath extends ExtractedPaint {
|
|
74
|
-
readonly kind:
|
|
74
|
+
readonly kind: "path";
|
|
75
75
|
readonly subpaths: readonly ExtractedSubpath[];
|
|
76
|
-
readonly fillRule:
|
|
76
|
+
readonly fillRule: "nonzero" | "evenodd";
|
|
77
77
|
}
|
|
78
78
|
interface ExtractedImage {
|
|
79
|
-
readonly kind:
|
|
79
|
+
readonly kind: "image";
|
|
80
80
|
readonly resourceName: string;
|
|
81
81
|
readonly resources: PdfDict;
|
|
82
82
|
readonly matrix: Matrix;
|
|
@@ -84,7 +84,7 @@ interface ExtractedImage {
|
|
|
84
84
|
readonly mcid?: number;
|
|
85
85
|
}
|
|
86
86
|
interface ExtractedInlineImage {
|
|
87
|
-
readonly kind:
|
|
87
|
+
readonly kind: "inlineImage";
|
|
88
88
|
readonly dict: PdfDict;
|
|
89
89
|
readonly data: Uint8Array<ArrayBuffer>;
|
|
90
90
|
readonly matrix: Matrix;
|
package/dist/layout.d.cts
CHANGED
|
@@ -734,7 +734,7 @@ declare const LayoutFormWidgetSchema: z.ZodObject<{
|
|
|
734
734
|
type LayoutFormWidget = z.infer<typeof LayoutFormWidgetSchema>;
|
|
735
735
|
interface LayoutFormField {
|
|
736
736
|
readonly name: string;
|
|
737
|
-
readonly fieldType:
|
|
737
|
+
readonly fieldType: "text" | "checkbox" | "radio" | "button" | "listbox" | "combobox" | "signature" | "group";
|
|
738
738
|
readonly value?: string;
|
|
739
739
|
readonly checked?: boolean;
|
|
740
740
|
readonly options?: readonly string[];
|
package/dist/layout.d.ts
CHANGED
|
@@ -734,7 +734,7 @@ declare const LayoutFormWidgetSchema: z.ZodObject<{
|
|
|
734
734
|
type LayoutFormWidget = z.infer<typeof LayoutFormWidgetSchema>;
|
|
735
735
|
interface LayoutFormField {
|
|
736
736
|
readonly name: string;
|
|
737
|
-
readonly fieldType:
|
|
737
|
+
readonly fieldType: "text" | "checkbox" | "radio" | "button" | "listbox" | "combobox" | "signature" | "group";
|
|
738
738
|
readonly value?: string;
|
|
739
739
|
readonly checked?: boolean;
|
|
740
740
|
readonly options?: readonly string[];
|
package/dist/lexer.d.cts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { ByteReader } from "./bytes/reader.cjs";
|
|
2
2
|
//#region src/lexer.d.ts
|
|
3
3
|
type Token = {
|
|
4
|
-
readonly kind:
|
|
4
|
+
readonly kind: "number";
|
|
5
5
|
readonly value: number;
|
|
6
6
|
} | {
|
|
7
|
-
readonly kind:
|
|
7
|
+
readonly kind: "name";
|
|
8
8
|
readonly value: string;
|
|
9
9
|
} | {
|
|
10
|
-
readonly kind:
|
|
10
|
+
readonly kind: "literalString";
|
|
11
11
|
readonly value: Uint8Array<ArrayBuffer>;
|
|
12
12
|
} | {
|
|
13
|
-
readonly kind:
|
|
13
|
+
readonly kind: "hexString";
|
|
14
14
|
readonly value: Uint8Array<ArrayBuffer>;
|
|
15
15
|
} | {
|
|
16
|
-
readonly kind:
|
|
16
|
+
readonly kind: "arrayStart";
|
|
17
17
|
} | {
|
|
18
|
-
readonly kind:
|
|
18
|
+
readonly kind: "arrayEnd";
|
|
19
19
|
} | {
|
|
20
|
-
readonly kind:
|
|
20
|
+
readonly kind: "dictStart";
|
|
21
21
|
} | {
|
|
22
|
-
readonly kind:
|
|
22
|
+
readonly kind: "dictEnd";
|
|
23
23
|
} | {
|
|
24
|
-
readonly kind:
|
|
24
|
+
readonly kind: "keyword";
|
|
25
25
|
readonly value: string;
|
|
26
26
|
};
|
|
27
27
|
declare function nextToken(reader: ByteReader): Token | undefined;
|
package/dist/lexer.d.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { ByteReader } from "./bytes/reader.js";
|
|
2
2
|
//#region src/lexer.d.ts
|
|
3
3
|
type Token = {
|
|
4
|
-
readonly kind:
|
|
4
|
+
readonly kind: "number";
|
|
5
5
|
readonly value: number;
|
|
6
6
|
} | {
|
|
7
|
-
readonly kind:
|
|
7
|
+
readonly kind: "name";
|
|
8
8
|
readonly value: string;
|
|
9
9
|
} | {
|
|
10
|
-
readonly kind:
|
|
10
|
+
readonly kind: "literalString";
|
|
11
11
|
readonly value: Uint8Array<ArrayBuffer>;
|
|
12
12
|
} | {
|
|
13
|
-
readonly kind:
|
|
13
|
+
readonly kind: "hexString";
|
|
14
14
|
readonly value: Uint8Array<ArrayBuffer>;
|
|
15
15
|
} | {
|
|
16
|
-
readonly kind:
|
|
16
|
+
readonly kind: "arrayStart";
|
|
17
17
|
} | {
|
|
18
|
-
readonly kind:
|
|
18
|
+
readonly kind: "arrayEnd";
|
|
19
19
|
} | {
|
|
20
|
-
readonly kind:
|
|
20
|
+
readonly kind: "dictStart";
|
|
21
21
|
} | {
|
|
22
|
-
readonly kind:
|
|
22
|
+
readonly kind: "dictEnd";
|
|
23
23
|
} | {
|
|
24
|
-
readonly kind:
|
|
24
|
+
readonly kind: "keyword";
|
|
25
25
|
readonly value: string;
|
|
26
26
|
};
|
|
27
27
|
declare function nextToken(reader: ByteReader): Token | undefined;
|
package/dist/math-font.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as GlyphInkBounds } from "./glyph-bounds-BV_Z40KS.cjs";
|
|
2
2
|
import { r as MathGlyphConstruction } from "./math-table-gFNB8DmQ.cjs";
|
|
3
|
-
import { t as MathStretchConstruction } from "./math-stretch-
|
|
3
|
+
import { t as MathStretchConstruction } from "./math-stretch-C2JanDAz.cjs";
|
|
4
4
|
import { MathFontMetrics, MathStretchAxis } from "document-schema.js";
|
|
5
5
|
//#region src/math-font.d.ts
|
|
6
6
|
interface MathFontDescriptorMetrics {
|
package/dist/math-font.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as GlyphInkBounds } from "./glyph-bounds-BV_Z40KS.js";
|
|
2
2
|
import { r as MathGlyphConstruction } from "./math-table-DhPrNoPa.js";
|
|
3
|
-
import { t as MathStretchConstruction } from "./math-stretch-
|
|
3
|
+
import { t as MathStretchConstruction } from "./math-stretch-BbC2o4Br.js";
|
|
4
4
|
import { MathFontMetrics, MathStretchAxis } from "document-schema.js";
|
|
5
5
|
//#region src/math-font.d.ts
|
|
6
6
|
interface MathFontDescriptorMetrics {
|
|
@@ -7,7 +7,7 @@ interface MathStretchPlacement {
|
|
|
7
7
|
readonly advance: number;
|
|
8
8
|
}
|
|
9
9
|
interface MathStretchConstruction {
|
|
10
|
-
readonly kind:
|
|
10
|
+
readonly kind: "base" | "variant" | "assembly";
|
|
11
11
|
readonly axis: MathStretchAxis;
|
|
12
12
|
readonly size: number;
|
|
13
13
|
readonly italicsCorrection: number;
|
|
@@ -7,7 +7,7 @@ interface MathStretchPlacement {
|
|
|
7
7
|
readonly advance: number;
|
|
8
8
|
}
|
|
9
9
|
interface MathStretchConstruction {
|
|
10
|
-
readonly kind:
|
|
10
|
+
readonly kind: "base" | "variant" | "assembly";
|
|
11
11
|
readonly axis: MathStretchAxis;
|
|
12
12
|
readonly size: number;
|
|
13
13
|
readonly italicsCorrection: number;
|
package/dist/math-stretch.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as scaleMathStretchConstruction, i as assembleStretchyGlyph, n as MathStretchOptions, r as MathStretchPlacement, t as MathStretchConstruction } from "./math-stretch-
|
|
1
|
+
import { a as scaleMathStretchConstruction, i as assembleStretchyGlyph, n as MathStretchOptions, r as MathStretchPlacement, t as MathStretchConstruction } from "./math-stretch-C2JanDAz.cjs";
|
|
2
2
|
export { MathStretchConstruction, MathStretchOptions, MathStretchPlacement, assembleStretchyGlyph, scaleMathStretchConstruction };
|
package/dist/math-stretch.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as scaleMathStretchConstruction, i as assembleStretchyGlyph, n as MathStretchOptions, r as MathStretchPlacement, t as MathStretchConstruction } from "./math-stretch-
|
|
1
|
+
import { a as scaleMathStretchConstruction, i as assembleStretchyGlyph, n as MathStretchOptions, r as MathStretchPlacement, t as MathStretchConstruction } from "./math-stretch-BbC2o4Br.js";
|
|
2
2
|
export { MathStretchConstruction, MathStretchOptions, MathStretchPlacement, assembleStretchyGlyph, scaleMathStretchConstruction };
|
package/dist/measure.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_afm_widths = require("./afm-widths-
|
|
2
|
+
const require_afm_widths = require("./afm-widths-Cj9d3GVK.cjs");
|
|
3
3
|
const require_embedded_font = require("./embedded-font.cjs");
|
|
4
4
|
const require_font_registry = require("./font-registry.cjs");
|
|
5
5
|
//#region src/measure.ts
|
package/dist/measure.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FontRegistry } from "./font-registry.cjs";
|
|
2
2
|
import { TextMeasurer } from "document-schema.js";
|
|
3
3
|
//#region src/measure.d.ts
|
|
4
|
-
type VerticalMetricPolicy =
|
|
4
|
+
type VerticalMetricPolicy = "hhea" | "os2Typo" | "os2Win";
|
|
5
5
|
declare const DEFAULT_VERTICAL_METRIC_POLICY: VerticalMetricPolicy;
|
|
6
6
|
interface StandardFontMeasurerOptions {
|
|
7
7
|
readonly widthCorrectionByFamily?: Readonly<Record<string, number>>;
|
package/dist/measure.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FontRegistry } from "./font-registry.js";
|
|
2
2
|
import { TextMeasurer } from "document-schema.js";
|
|
3
3
|
//#region src/measure.d.ts
|
|
4
|
-
type VerticalMetricPolicy =
|
|
4
|
+
type VerticalMetricPolicy = "hhea" | "os2Typo" | "os2Win";
|
|
5
5
|
declare const DEFAULT_VERTICAL_METRIC_POLICY: VerticalMetricPolicy;
|
|
6
6
|
interface StandardFontMeasurerOptions {
|
|
7
7
|
readonly widthCorrectionByFamily?: Readonly<Record<string, number>>;
|
package/dist/measure.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as encodeForShow, t as STANDARD_METRICS } from "./afm-widths-
|
|
1
|
+
import { o as encodeForShow, t as STANDARD_METRICS } from "./afm-widths-BLl6ORCt.js";
|
|
2
2
|
import { encodeForShowEmbedded } from "./embedded-font.js";
|
|
3
3
|
import { resolveFaceWithRegistry } from "./font-registry.js";
|
|
4
4
|
//#region src/measure.ts
|