chromiumly 2.5.0 → 2.6.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 +57 -40
- package/dist/chromium/converters/converter.d.ts +13 -0
- package/dist/chromium/converters/converter.js +10 -0
- package/dist/chromium/converters/converter.js.map +1 -1
- package/dist/chromium/converters/html.converter.d.ts +33 -1
- package/dist/chromium/converters/html.converter.js +32 -2
- package/dist/chromium/converters/html.converter.js.map +1 -1
- package/dist/chromium/converters/markdown.converter.d.ts +29 -0
- package/dist/chromium/converters/markdown.converter.js +29 -0
- package/dist/chromium/converters/markdown.converter.js.map +1 -1
- package/dist/chromium/converters/url.converter.d.ts +28 -0
- package/dist/chromium/converters/url.converter.js +28 -0
- package/dist/chromium/converters/url.converter.js.map +1 -1
- package/dist/chromium/utils/converter.utils.d.ts +24 -0
- package/dist/chromium/utils/converter.utils.js +24 -0
- package/dist/chromium/utils/converter.utils.js.map +1 -1
- package/dist/common/gotenberg.utils.d.ts +18 -0
- package/dist/common/gotenberg.utils.js +18 -0
- package/dist/common/gotenberg.utils.js.map +1 -1
- package/dist/gotenberg.d.ts +8 -0
- package/dist/gotenberg.js +8 -0
- package/dist/gotenberg.js.map +1 -1
- package/dist/libre-office/utils/constants.js +76 -76
- package/dist/libre-office/utils/constants.js.map +1 -1
- package/dist/libre-office/utils/libre-office.utils.d.ts +16 -0
- package/dist/libre-office/utils/libre-office.utils.js +38 -15
- package/dist/libre-office/utils/libre-office.utils.js.map +1 -1
- package/dist/main.config.d.ts +43 -0
- package/dist/main.config.js +43 -0
- package/dist/main.config.js.map +1 -1
- package/dist/pdf-engines/pdf.engine.d.ts +31 -5
- package/dist/pdf-engines/pdf.engine.js +28 -0
- package/dist/pdf-engines/pdf.engine.js.map +1 -1
- package/dist/pdf-engines/utils/engine.utils.d.ts +10 -0
- package/dist/pdf-engines/utils/engine.utils.js +11 -1
- package/dist/pdf-engines/utils/engine.utils.js.map +1 -1
- package/package.json +14 -13
- package/src/chromium/converters/converter.ts +13 -0
- package/src/chromium/converters/html.converter.ts +36 -3
- package/src/chromium/converters/markdown.converter.ts +30 -1
- package/src/chromium/converters/tests/html.converter.test.ts +21 -2
- package/src/chromium/converters/url.converter.ts +29 -3
- package/src/chromium/utils/converter.utils.ts +24 -0
- package/src/chromium/utils/tests/converter.utils.test.ts +2 -2
- package/src/common/gotenberg.utils.ts +20 -1
- package/src/gotenberg.ts +9 -0
- package/src/libre-office/utils/constants.ts +76 -76
- package/src/libre-office/utils/libre-office.utils.ts +42 -14
- package/src/libre-office/utils/tests/libre-office.utils.test.ts +24 -4
- package/src/main.config.ts +46 -1
- package/src/pdf-engines/pdf.engine.ts +32 -4
- package/src/pdf-engines/utils/engine.utils.ts +11 -1
package/README.md
CHANGED
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
[](https://npm-stat.com/charts.html?package=chromiumly)
|
|
9
9
|

|
|
10
10
|
|
|
11
|
-
A lightweight Typescript library that interacts with [Gotenberg](https://gotenberg.dev/)'s different modules to convert
|
|
11
|
+
A lightweight Typescript library that interacts with [Gotenberg](https://gotenberg.dev/)'s different modules to convert
|
|
12
|
+
a variety of document formats to PDF files.
|
|
12
13
|
|
|
13
14
|
## Install
|
|
14
15
|
|
|
@@ -26,7 +27,8 @@ yarn add chromiumly
|
|
|
26
27
|
|
|
27
28
|
## Prerequisites
|
|
28
29
|
|
|
29
|
-
Before attempting to use Chromiumly, be sure you install [Docker](https://www.docker.com/) if you have not already done
|
|
30
|
+
Before attempting to use Chromiumly, be sure you install [Docker](https://www.docker.com/) if you have not already done
|
|
31
|
+
so.
|
|
30
32
|
|
|
31
33
|
After that, you can start a default Docker container of [Gotenberg](https://gotenberg.dev/) as follows:
|
|
32
34
|
|
|
@@ -38,7 +40,8 @@ docker run --rm -p 3000:3000 gotenberg/gotenberg:7
|
|
|
38
40
|
|
|
39
41
|
### Configuration
|
|
40
42
|
|
|
41
|
-
Chromiumly supports both [dotenv](https://www.npmjs.com/package/dotenv)
|
|
43
|
+
Chromiumly supports both [dotenv](https://www.npmjs.com/package/dotenv)
|
|
44
|
+
and [config](https://www.npmjs.com/package/config) configuration libraries to add Gotenberg endpoint to your project.
|
|
42
45
|
|
|
43
46
|
#### dotenv
|
|
44
47
|
|
|
@@ -58,16 +61,21 @@ GOTENBERG_ENDPOINT=http://localhost:3000
|
|
|
58
61
|
|
|
59
62
|
## Modules
|
|
60
63
|
|
|
61
|
-
Chromiumly introduces different classes that serve as wrappers to
|
|
64
|
+
Chromiumly introduces different classes that serve as wrappers to
|
|
65
|
+
Gotenberg's [modules](https://gotenberg.dev/docs/modules/api#modules). These classes encompass methods featuring an
|
|
66
|
+
input file parameter, such as `html`, `header`, `footer`, and `markdown`, capable of accepting inputs in the form of a
|
|
67
|
+
`string` (i.e. file path), `Buffer`, or `ReadStream`.
|
|
62
68
|
|
|
63
69
|
### Chormium
|
|
64
70
|
|
|
65
|
-
There are three different classes that come with a single method (i.e.`convert`) which calls one of
|
|
71
|
+
There are three different classes that come with a single method (i.e.`convert`) which calls one of
|
|
72
|
+
Chromium's [routes](https://gotenberg.dev/docs/modules/chromium#routes) to convert `html` and `markdown` files, or
|
|
73
|
+
a `url` to a `buffer` which contains the converted PDF file content.
|
|
66
74
|
|
|
67
75
|
#### URL
|
|
68
76
|
|
|
69
77
|
```typescript
|
|
70
|
-
import {
|
|
78
|
+
import {UrlConverter} from "chromiumly";
|
|
71
79
|
|
|
72
80
|
const urlConverter = new UrlConverter();
|
|
73
81
|
const buffer = await urlConverter.convert({
|
|
@@ -80,7 +88,7 @@ const buffer = await urlConverter.convert({
|
|
|
80
88
|
The only requirement is that the file name should be `index.html`.
|
|
81
89
|
|
|
82
90
|
```typescript
|
|
83
|
-
import {
|
|
91
|
+
import {HtmlConverter} from "chromiumly";
|
|
84
92
|
|
|
85
93
|
const htmlConverter = new HtmlConverter();
|
|
86
94
|
const buffer = await htmlConverter.convert({
|
|
@@ -94,7 +102,7 @@ const buffer = await htmlConverter.convert({
|
|
|
94
102
|
This route accepts an `index.html` file plus a markdown file.
|
|
95
103
|
|
|
96
104
|
```typescript
|
|
97
|
-
import {
|
|
105
|
+
import {MarkdownConverter} from "chromiumly";
|
|
98
106
|
|
|
99
107
|
const markdownConverter = new MarkdownConverter();
|
|
100
108
|
const buffer = await markdownConverter.convert({
|
|
@@ -105,42 +113,47 @@ const buffer = await markdownConverter.convert({
|
|
|
105
113
|
|
|
106
114
|
### Customization
|
|
107
115
|
|
|
108
|
-
`convert()` method takes an optional `properties` parameter of the following type which dictates how the PDF generated
|
|
116
|
+
`convert()` method takes an optional `properties` parameter of the following type which dictates how the PDF generated
|
|
117
|
+
file will look like.
|
|
109
118
|
|
|
110
119
|
```typescript
|
|
111
120
|
type PageProperties = {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
121
|
+
size?: {
|
|
122
|
+
width: number; // Paper width, in inches (default 8.5)
|
|
123
|
+
height: number; //Paper height, in inches (default 11)
|
|
124
|
+
};
|
|
125
|
+
margins?: {
|
|
126
|
+
top: number; // Top margin, in inches (default 0.39)
|
|
127
|
+
bottom: number; // Bottom margin, in inches (default 0.39)
|
|
128
|
+
left: number; // Left margin, in inches (default 0.39)
|
|
129
|
+
right: number; // Right margin, in inches (default 0.39)
|
|
130
|
+
};
|
|
131
|
+
preferCssPageSize?: boolean; // Define whether to prefer page size as defined by CSS (default false)
|
|
132
|
+
printBackground?: boolean; // Print the background graphics (default false)
|
|
133
|
+
omitBackground?: boolean; // Hide the default white background and allow generating PDFs with transparency (default false)
|
|
134
|
+
landscape?: boolean; // Set the paper orientation to landscape (default false)
|
|
135
|
+
scale?: number; // The scale of the page rendering (default 1.0)
|
|
136
|
+
nativePageRanges?: { from: number; to: number }; // Page ranges to print
|
|
128
137
|
};
|
|
129
138
|
```
|
|
130
139
|
|
|
131
140
|
### PDF Engine
|
|
132
141
|
|
|
133
|
-
The `PDFEngine` combines the functionality of both
|
|
142
|
+
The `PDFEngine` combines the functionality of both
|
|
143
|
+
Gotenberg's [PDF Engines](https://gotenberg.dev/docs/modules/pdf-engines)
|
|
144
|
+
and [LibreOffice](https://gotenberg.dev/docs/modules/libreoffice) modules to manipulate different file formats.
|
|
134
145
|
|
|
135
146
|
#### convert
|
|
136
147
|
|
|
137
|
-
This method interacts with [LibreOffice](https://gotenberg.dev/docs/modules/libreoffice) module to convert different
|
|
148
|
+
This method interacts with [LibreOffice](https://gotenberg.dev/docs/modules/libreoffice) module to convert different
|
|
149
|
+
documents to PDF files. You can find the file extensions
|
|
150
|
+
accepted [here](https://gotenberg.dev/docs/modules/libreoffice#route).
|
|
138
151
|
|
|
139
152
|
```typescript
|
|
140
|
-
import {
|
|
153
|
+
import {PDFEngine} from "chromiumly";
|
|
141
154
|
|
|
142
155
|
const buffer = await PDFEngine.convert({
|
|
143
|
-
|
|
156
|
+
files: ["path/to/file.docx", "path/to/file.png"],
|
|
144
157
|
});
|
|
145
158
|
```
|
|
146
159
|
|
|
@@ -152,36 +165,40 @@ Similarly to Chromium's module `convert` method, this method takes the following
|
|
|
152
165
|
|
|
153
166
|
#### merge
|
|
154
167
|
|
|
155
|
-
This method interacts with [PDF Engines](https://gotenberg.dev/docs/modules/pdf-engines) module which gathers different
|
|
168
|
+
This method interacts with [PDF Engines](https://gotenberg.dev/docs/modules/pdf-engines) module which gathers different
|
|
169
|
+
engines that can manipulate and merge PDF files such
|
|
170
|
+
as: [PDFtk](https://gitlab.com/pdftk-java/pdftk), [PDFcpu](https://github.com/pdfcpu/pdfcpu), [QPDF](https://github.com/qpdf/qpdf),
|
|
171
|
+
and [UNO](https://github.com/unoconv/unoconv).
|
|
156
172
|
|
|
157
173
|
```typescript
|
|
158
|
-
import {
|
|
174
|
+
import {PDFEngine} from "chromiumly";
|
|
159
175
|
|
|
160
176
|
const buffer = await PDFEngine.merge({
|
|
161
|
-
|
|
177
|
+
files: ["path/to/file.docx", "path/to/file.png"],
|
|
162
178
|
});
|
|
163
179
|
```
|
|
164
180
|
|
|
165
181
|
#### generate
|
|
166
182
|
|
|
167
|
-
It is just a generic complementary method that takes the `buffer` returned by the `convert` method, and a
|
|
183
|
+
It is just a generic complementary method that takes the `buffer` returned by the `convert` method, and a
|
|
184
|
+
chosen `filename` to generate the PDF file.
|
|
168
185
|
|
|
169
|
-
Please note that all the PDF files can be found `__generated__` folder in the root folder of your project.
|
|
186
|
+
Please note that all the PDF files can be found `__generated__` folder in the root folder of your project.
|
|
170
187
|
|
|
171
188
|
## Snippet
|
|
172
189
|
|
|
173
190
|
The following is a short snippet of how to use the library.
|
|
174
191
|
|
|
175
192
|
```typescript
|
|
176
|
-
import {
|
|
193
|
+
import {PDFEngine, UrlConverter} from "chromiumly";
|
|
177
194
|
|
|
178
195
|
async function run() {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
196
|
+
const urlConverter = new UrlConverter();
|
|
197
|
+
const buffer = await urlConverter.convert({
|
|
198
|
+
url: "https://gotenberg.dev/",
|
|
199
|
+
});
|
|
183
200
|
|
|
184
|
-
|
|
201
|
+
await PDFEngine.generate("gotenberg.pdf", buffer);
|
|
185
202
|
}
|
|
186
203
|
|
|
187
204
|
run();
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { ChromiumRoute } from "../../main.config";
|
|
2
|
+
/**
|
|
3
|
+
* Abstract class representing a generic converter.
|
|
4
|
+
* Concrete converter classes should extend this class and implement specific conversion logic.
|
|
5
|
+
*/
|
|
2
6
|
export declare abstract class Converter {
|
|
7
|
+
/**
|
|
8
|
+
* The endpoint URL for the converter.
|
|
9
|
+
*/
|
|
3
10
|
readonly endpoint: string;
|
|
11
|
+
/**
|
|
12
|
+
* Creates an instance of the Converter class.
|
|
13
|
+
* Initializes the endpoint URL based on the provided ChromiumRoute.
|
|
14
|
+
*
|
|
15
|
+
* @param {ChromiumRoute} route - The ChromiumRoute enum value representing the conversion route.
|
|
16
|
+
*/
|
|
4
17
|
constructor(route: ChromiumRoute);
|
|
5
18
|
}
|
|
@@ -2,7 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Converter = void 0;
|
|
4
4
|
const main_config_1 = require("../../main.config");
|
|
5
|
+
/**
|
|
6
|
+
* Abstract class representing a generic converter.
|
|
7
|
+
* Concrete converter classes should extend this class and implement specific conversion logic.
|
|
8
|
+
*/
|
|
5
9
|
class Converter {
|
|
10
|
+
/**
|
|
11
|
+
* Creates an instance of the Converter class.
|
|
12
|
+
* Initializes the endpoint URL based on the provided ChromiumRoute.
|
|
13
|
+
*
|
|
14
|
+
* @param {ChromiumRoute} route - The ChromiumRoute enum value representing the conversion route.
|
|
15
|
+
*/
|
|
6
16
|
constructor(route) {
|
|
7
17
|
this.endpoint = `${main_config_1.Chromiumly.GOTENBERG_ENDPOINT}/${main_config_1.Chromiumly.CHROMIUM_PATH}/${main_config_1.Chromiumly.CHROMIUM_ROUTES[route]}`;
|
|
8
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../../../src/chromium/converters/converter.ts"],"names":[],"mappings":";;;AAAA,mDAA4D;AAE5D,MAAsB,SAAS;
|
|
1
|
+
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../../../src/chromium/converters/converter.ts"],"names":[],"mappings":";;;AAAA,mDAA4D;AAE5D;;;GAGG;AACH,MAAsB,SAAS;IAM3B;;;;;OAKG;IACH,YAAY,KAAoB;QAC5B,IAAI,CAAC,QAAQ,GAAG,GAAG,wBAAU,CAAC,kBAAkB,IAAI,wBAAU,CAAC,aAAa,IAAI,wBAAU,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;IACxH,CAAC;CACJ;AAfD,8BAeC"}
|
|
@@ -2,10 +2,42 @@
|
|
|
2
2
|
import { PathLikeOrReadStream, PdfFormat } from "../../common";
|
|
3
3
|
import { EmulatedMediaType, PageProperties } from "../interfaces/converter.types";
|
|
4
4
|
import { Converter } from "./converter";
|
|
5
|
+
/**
|
|
6
|
+
* Class representing an HTML converter that extends the base Converter class.
|
|
7
|
+
* This class is used to convert HTML content to PDF using Gotenberg service.
|
|
8
|
+
*
|
|
9
|
+
* @extends Converter
|
|
10
|
+
*/
|
|
5
11
|
export declare class HtmlConverter extends Converter {
|
|
12
|
+
/**
|
|
13
|
+
* Creates an instance of HtmlConverter.
|
|
14
|
+
* Initializes the converter with the HTML conversion route.
|
|
15
|
+
*/
|
|
6
16
|
constructor();
|
|
7
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Converts HTML content to PDF.
|
|
19
|
+
*
|
|
20
|
+
* @param {Object} options - Conversion options.
|
|
21
|
+
* @param {PathLikeOrReadStream} options.html - PathLike or ReadStream of the HTML content to be converted.
|
|
22
|
+
* @param {PathLikeOrReadStream} [options.header] - PathLike or ReadStream of the header HTML content.
|
|
23
|
+
* @param {PathLikeOrReadStream} [options.footer] - PathLike or ReadStream of the footer HTML content.
|
|
24
|
+
* @param {PageProperties} [options.properties] - Page properties for the conversion.
|
|
25
|
+
* @param {PdfFormat} [options.pdfFormat] - PDF format options.
|
|
26
|
+
* @param {boolean} [options.pdfUA] - Indicates whether to generate PDF/UA compliant output.
|
|
27
|
+
* @param {EmulatedMediaType} [options.emulatedMediaType] - Emulated media type for the conversion.
|
|
28
|
+
* @param {string} [options.waitDelay] - Delay before the conversion process starts.
|
|
29
|
+
* @param {string} [options.waitForExpression] - JavaScript expression to wait for before completing the conversion.
|
|
30
|
+
* @param {string} [options.userAgent] - User agent string to use during the conversion.
|
|
31
|
+
* @param {Record<string, string>} [options.extraHttpHeaders] - Additional HTTP headers for the conversion.
|
|
32
|
+
* @param {boolean} [options.failOnConsoleExceptions] - Whether to fail on console exceptions during conversion.
|
|
33
|
+
* @returns {Promise<Buffer>} A Promise resolving to the converted PDF content as a Buffer.
|
|
34
|
+
*/
|
|
35
|
+
convert({ html, assets, header, footer, properties, pdfFormat, pdfUA, emulatedMediaType, waitDelay, waitForExpression, userAgent, extraHttpHeaders, failOnConsoleExceptions, }: {
|
|
8
36
|
html: PathLikeOrReadStream;
|
|
37
|
+
assets?: {
|
|
38
|
+
file: PathLikeOrReadStream;
|
|
39
|
+
name: string;
|
|
40
|
+
}[];
|
|
9
41
|
header?: PathLikeOrReadStream;
|
|
10
42
|
footer?: PathLikeOrReadStream;
|
|
11
43
|
properties?: PageProperties;
|
|
@@ -2,20 +2,50 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HtmlConverter = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
5
|
const form_data_1 = tslib_1.__importDefault(require("form-data"));
|
|
7
6
|
const common_1 = require("../../common");
|
|
8
7
|
const converter_utils_1 = require("../utils/converter.utils");
|
|
9
8
|
const converter_1 = require("./converter");
|
|
10
9
|
const main_config_1 = require("../../main.config");
|
|
10
|
+
/**
|
|
11
|
+
* Class representing an HTML converter that extends the base Converter class.
|
|
12
|
+
* This class is used to convert HTML content to PDF using Gotenberg service.
|
|
13
|
+
*
|
|
14
|
+
* @extends Converter
|
|
15
|
+
*/
|
|
11
16
|
class HtmlConverter extends converter_1.Converter {
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of HtmlConverter.
|
|
19
|
+
* Initializes the converter with the HTML conversion route.
|
|
20
|
+
*/
|
|
12
21
|
constructor() {
|
|
13
22
|
super(main_config_1.ChromiumRoute.HTML);
|
|
14
23
|
}
|
|
15
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Converts HTML content to PDF.
|
|
26
|
+
*
|
|
27
|
+
* @param {Object} options - Conversion options.
|
|
28
|
+
* @param {PathLikeOrReadStream} options.html - PathLike or ReadStream of the HTML content to be converted.
|
|
29
|
+
* @param {PathLikeOrReadStream} [options.header] - PathLike or ReadStream of the header HTML content.
|
|
30
|
+
* @param {PathLikeOrReadStream} [options.footer] - PathLike or ReadStream of the footer HTML content.
|
|
31
|
+
* @param {PageProperties} [options.properties] - Page properties for the conversion.
|
|
32
|
+
* @param {PdfFormat} [options.pdfFormat] - PDF format options.
|
|
33
|
+
* @param {boolean} [options.pdfUA] - Indicates whether to generate PDF/UA compliant output.
|
|
34
|
+
* @param {EmulatedMediaType} [options.emulatedMediaType] - Emulated media type for the conversion.
|
|
35
|
+
* @param {string} [options.waitDelay] - Delay before the conversion process starts.
|
|
36
|
+
* @param {string} [options.waitForExpression] - JavaScript expression to wait for before completing the conversion.
|
|
37
|
+
* @param {string} [options.userAgent] - User agent string to use during the conversion.
|
|
38
|
+
* @param {Record<string, string>} [options.extraHttpHeaders] - Additional HTTP headers for the conversion.
|
|
39
|
+
* @param {boolean} [options.failOnConsoleExceptions] - Whether to fail on console exceptions during conversion.
|
|
40
|
+
* @returns {Promise<Buffer>} A Promise resolving to the converted PDF content as a Buffer.
|
|
41
|
+
*/
|
|
42
|
+
convert({ html, assets, header, footer, properties, pdfFormat, pdfUA, emulatedMediaType, waitDelay, waitForExpression, userAgent, extraHttpHeaders, failOnConsoleExceptions, }) {
|
|
16
43
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
17
44
|
const data = new form_data_1.default();
|
|
18
45
|
yield converter_utils_1.ConverterUtils.addFile(data, html, "index.html");
|
|
46
|
+
if (assets === null || assets === void 0 ? void 0 : assets.length) {
|
|
47
|
+
yield Promise.all(assets.map(({ file, name }) => converter_utils_1.ConverterUtils.addFile(data, file, name)));
|
|
48
|
+
}
|
|
19
49
|
yield converter_utils_1.ConverterUtils.customize(data, {
|
|
20
50
|
header,
|
|
21
51
|
footer,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.converter.js","sourceRoot":"","sources":["../../../src/chromium/converters/html.converter.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"html.converter.js","sourceRoot":"","sources":["../../../src/chromium/converters/html.converter.ts"],"names":[],"mappings":";;;;AAAA,kEAAiC;AAEjC,yCAA6E;AAK7E,8DAAwD;AACxD,2CAAsC;AACtC,mDAAgD;AAEhD;;;;;GAKG;AACH,MAAa,aAAc,SAAQ,qBAAS;IACxC;;;OAGG;IACH;QACI,KAAK,CAAC,2BAAa,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACG,OAAO,CAAC,EACI,IAAI,EACJ,MAAM,EACN,MAAM,EACN,MAAM,EACN,UAAU,EACV,SAAS,EACT,KAAK,EACL,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,uBAAuB,GAexC;;YACG,MAAM,IAAI,GAAG,IAAI,mBAAQ,EAAE,CAAC;YAE5B,MAAM,gCAAc,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;YAEvD,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,EAAE,CAAC;gBACjB,MAAM,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,gCAAc,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;YAC/F,CAAC;YAED,MAAM,gCAAc,CAAC,SAAS,CAAC,IAAI,EAAE;gBACjC,MAAM;gBACN,MAAM;gBACN,UAAU;gBACV,SAAS;gBACT,KAAK;gBACL,iBAAiB;gBACjB,SAAS;gBACT,iBAAiB;gBACjB,SAAS;gBACT,gBAAgB;gBAChB,uBAAuB;aAC1B,CAAC,CAAC;YAEH,OAAO,uBAAc,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACrD,CAAC;KAAA;CACJ;AAhFD,sCAgFC"}
|
|
@@ -2,8 +2,37 @@
|
|
|
2
2
|
import { PdfFormat, PathLikeOrReadStream } from "../../common";
|
|
3
3
|
import { EmulatedMediaType, PageProperties } from "../interfaces/converter.types";
|
|
4
4
|
import { Converter } from "./converter";
|
|
5
|
+
/**
|
|
6
|
+
* Class representing a Markdown converter that extends the base Converter class.
|
|
7
|
+
* This class is used to convert HTML with markdown content to PDF using Gotenberg service.
|
|
8
|
+
*
|
|
9
|
+
* @extends Converter
|
|
10
|
+
*/
|
|
5
11
|
export declare class MarkdownConverter extends Converter {
|
|
12
|
+
/**
|
|
13
|
+
* Creates an instance of MarkdownConverter.
|
|
14
|
+
* Initializes the converter with the Markdown conversion route.
|
|
15
|
+
*/
|
|
6
16
|
constructor();
|
|
17
|
+
/**
|
|
18
|
+
* Converts HTML with markdown content to PDF.
|
|
19
|
+
*
|
|
20
|
+
* @param {Object} options - Conversion options.
|
|
21
|
+
* @param {PathLikeOrReadStream} options.html - PathLike or ReadStream of the HTML content to be converted.
|
|
22
|
+
* @param {PathLikeOrReadStream} options.markdown - PathLike or ReadStream of the Markdown content to be converted.
|
|
23
|
+
* @param {PathLikeOrReadStream} [options.header] - PathLike or ReadStream of the header HTML content.
|
|
24
|
+
* @param {PathLikeOrReadStream} [options.footer] - PathLike or ReadStream of the footer HTML content.
|
|
25
|
+
* @param {PageProperties} [options.properties] - Page properties for the conversion.
|
|
26
|
+
* @param {PdfFormat} [options.pdfFormat] - PDF format options.
|
|
27
|
+
* @param {boolean} [options.pdfUA] - Indicates whether to generate PDF/UA compliant output.
|
|
28
|
+
* @param {EmulatedMediaType} [options.emulatedMediaType] - Emulated media type for the conversion.
|
|
29
|
+
* @param {string} [options.waitDelay] - Delay before the conversion process starts.
|
|
30
|
+
* @param {string} [options.waitForExpression] - JavaScript expression to wait for before completing the conversion.
|
|
31
|
+
* @param {string} [options.userAgent] - User agent string to use during the conversion.
|
|
32
|
+
* @param {Record<string, string>} [options.extraHttpHeaders] - Additional HTTP headers for the conversion.
|
|
33
|
+
* @param {boolean} [options.failOnConsoleExceptions] - Whether to fail on console exceptions during conversion.
|
|
34
|
+
* @returns {Promise<Buffer>} A Promise resolving to the converted PDF content as a Buffer.
|
|
35
|
+
*/
|
|
7
36
|
convert({ html, markdown, header, footer, properties, pdfFormat, pdfUA, emulatedMediaType, waitDelay, waitForExpression, userAgent, extraHttpHeaders, failOnConsoleExceptions, }: {
|
|
8
37
|
html: PathLikeOrReadStream;
|
|
9
38
|
markdown: PathLikeOrReadStream;
|
|
@@ -7,10 +7,39 @@ const common_1 = require("../../common");
|
|
|
7
7
|
const converter_utils_1 = require("../utils/converter.utils");
|
|
8
8
|
const converter_1 = require("./converter");
|
|
9
9
|
const main_config_1 = require("../../main.config");
|
|
10
|
+
/**
|
|
11
|
+
* Class representing a Markdown converter that extends the base Converter class.
|
|
12
|
+
* This class is used to convert HTML with markdown content to PDF using Gotenberg service.
|
|
13
|
+
*
|
|
14
|
+
* @extends Converter
|
|
15
|
+
*/
|
|
10
16
|
class MarkdownConverter extends converter_1.Converter {
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of MarkdownConverter.
|
|
19
|
+
* Initializes the converter with the Markdown conversion route.
|
|
20
|
+
*/
|
|
11
21
|
constructor() {
|
|
12
22
|
super(main_config_1.ChromiumRoute.MARKDOWN);
|
|
13
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Converts HTML with markdown content to PDF.
|
|
26
|
+
*
|
|
27
|
+
* @param {Object} options - Conversion options.
|
|
28
|
+
* @param {PathLikeOrReadStream} options.html - PathLike or ReadStream of the HTML content to be converted.
|
|
29
|
+
* @param {PathLikeOrReadStream} options.markdown - PathLike or ReadStream of the Markdown content to be converted.
|
|
30
|
+
* @param {PathLikeOrReadStream} [options.header] - PathLike or ReadStream of the header HTML content.
|
|
31
|
+
* @param {PathLikeOrReadStream} [options.footer] - PathLike or ReadStream of the footer HTML content.
|
|
32
|
+
* @param {PageProperties} [options.properties] - Page properties for the conversion.
|
|
33
|
+
* @param {PdfFormat} [options.pdfFormat] - PDF format options.
|
|
34
|
+
* @param {boolean} [options.pdfUA] - Indicates whether to generate PDF/UA compliant output.
|
|
35
|
+
* @param {EmulatedMediaType} [options.emulatedMediaType] - Emulated media type for the conversion.
|
|
36
|
+
* @param {string} [options.waitDelay] - Delay before the conversion process starts.
|
|
37
|
+
* @param {string} [options.waitForExpression] - JavaScript expression to wait for before completing the conversion.
|
|
38
|
+
* @param {string} [options.userAgent] - User agent string to use during the conversion.
|
|
39
|
+
* @param {Record<string, string>} [options.extraHttpHeaders] - Additional HTTP headers for the conversion.
|
|
40
|
+
* @param {boolean} [options.failOnConsoleExceptions] - Whether to fail on console exceptions during conversion.
|
|
41
|
+
* @returns {Promise<Buffer>} A Promise resolving to the converted PDF content as a Buffer.
|
|
42
|
+
*/
|
|
14
43
|
convert({ html, markdown, header, footer, properties, pdfFormat, pdfUA, emulatedMediaType, waitDelay, waitForExpression, userAgent, extraHttpHeaders, failOnConsoleExceptions, }) {
|
|
15
44
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
16
45
|
const data = new form_data_1.default();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.converter.js","sourceRoot":"","sources":["../../../src/chromium/converters/markdown.converter.ts"],"names":[],"mappings":";;;;AAAA,kEAAiC;AAEjC,yCAA6E;AAK7E,8DAAwD;AACxD,2CAAsC;AACtC,mDAAgD;AAEhD,MAAa,iBAAkB,SAAQ,qBAAS;IAC5C;QACI,KAAK,CAAC,2BAAa,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC;
|
|
1
|
+
{"version":3,"file":"markdown.converter.js","sourceRoot":"","sources":["../../../src/chromium/converters/markdown.converter.ts"],"names":[],"mappings":";;;;AAAA,kEAAiC;AAEjC,yCAA6E;AAK7E,8DAAwD;AACxD,2CAAsC;AACtC,mDAAgD;AAEhD;;;;;GAKG;AACH,MAAa,iBAAkB,SAAQ,qBAAS;IAC5C;;;OAGG;IACH;QACI,KAAK,CAAC,2BAAa,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACG,OAAO,CAAC,EACI,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,MAAM,EACN,UAAU,EACV,SAAS,EACT,KAAK,EACL,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,uBAAuB,GAexC;;YACG,MAAM,IAAI,GAAG,IAAI,mBAAQ,EAAE,CAAC;YAE5B,MAAM,gCAAc,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;YAEvD,MAAM,gCAAc,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;YAExD,MAAM,gCAAc,CAAC,SAAS,CAAC,IAAI,EAAE;gBACjC,MAAM;gBACN,MAAM;gBACN,UAAU;gBACV,SAAS;gBACT,KAAK;gBACL,iBAAiB;gBACjB,SAAS;gBACT,iBAAiB;gBACjB,SAAS;gBACT,gBAAgB;gBAChB,uBAAuB;aAC1B,CAAC,CAAC;YAEH,OAAO,uBAAc,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACrD,CAAC;KAAA;CACJ;AA/ED,8CA+EC"}
|
|
@@ -2,8 +2,36 @@
|
|
|
2
2
|
import { PdfFormat, PathLikeOrReadStream } from "../../common";
|
|
3
3
|
import { EmulatedMediaType, PageProperties } from "../interfaces/converter.types";
|
|
4
4
|
import { Converter } from "./converter";
|
|
5
|
+
/**
|
|
6
|
+
* Class representing a URL converter that extends the base Converter class.
|
|
7
|
+
* This class is used to convert content from a URL to PDF using Gotenberg service.
|
|
8
|
+
*
|
|
9
|
+
* @extends Converter
|
|
10
|
+
*/
|
|
5
11
|
export declare class UrlConverter extends Converter {
|
|
12
|
+
/**
|
|
13
|
+
* Creates an instance of UrlConverter.
|
|
14
|
+
* Initializes the converter with the URL conversion route.
|
|
15
|
+
*/
|
|
6
16
|
constructor();
|
|
17
|
+
/**
|
|
18
|
+
* Converts content from a URL to PDF.
|
|
19
|
+
*
|
|
20
|
+
* @param {Object} options - Conversion options.
|
|
21
|
+
* @param {string} options.url - The URL of the content to be converted to PDF.
|
|
22
|
+
* @param {PathLikeOrReadStream} [options.header] - PathLike or ReadStream of the header HTML content.
|
|
23
|
+
* @param {PathLikeOrReadStream} [options.footer] - PathLike or ReadStream of the footer HTML content.
|
|
24
|
+
* @param {PageProperties} [options.properties] - Page properties for the conversion.
|
|
25
|
+
* @param {PdfFormat} [options.pdfFormat] - PDF format options.
|
|
26
|
+
* @param {boolean} [options.pdfUA] - Indicates whether to generate PDF/UA compliant output.
|
|
27
|
+
* @param {EmulatedMediaType} [options.emulatedMediaType] - Emulated media type for the conversion.
|
|
28
|
+
* @param {string} [options.waitDelay] - Delay before the conversion process starts.
|
|
29
|
+
* @param {string} [options.waitForExpression] - JavaScript expression to wait for before completing the conversion.
|
|
30
|
+
* @param {string} [options.userAgent] - User agent string to use during the conversion.
|
|
31
|
+
* @param {Record<string, string>} [options.extraHttpHeaders] - Additional HTTP headers for the conversion.
|
|
32
|
+
* @param {boolean} [options.failOnConsoleExceptions] - Whether to fail on console exceptions during conversion.
|
|
33
|
+
* @returns {Promise<Buffer>} A Promise resolving to the converted PDF content as a Buffer.
|
|
34
|
+
*/
|
|
7
35
|
convert({ url, header, footer, properties, pdfFormat, pdfUA, emulatedMediaType, waitDelay, waitForExpression, userAgent, extraHttpHeaders, failOnConsoleExceptions, }: {
|
|
8
36
|
url: string;
|
|
9
37
|
header?: PathLikeOrReadStream;
|
|
@@ -8,10 +8,38 @@ const common_1 = require("../../common");
|
|
|
8
8
|
const converter_utils_1 = require("../utils/converter.utils");
|
|
9
9
|
const converter_1 = require("./converter");
|
|
10
10
|
const main_config_1 = require("../../main.config");
|
|
11
|
+
/**
|
|
12
|
+
* Class representing a URL converter that extends the base Converter class.
|
|
13
|
+
* This class is used to convert content from a URL to PDF using Gotenberg service.
|
|
14
|
+
*
|
|
15
|
+
* @extends Converter
|
|
16
|
+
*/
|
|
11
17
|
class UrlConverter extends converter_1.Converter {
|
|
18
|
+
/**
|
|
19
|
+
* Creates an instance of UrlConverter.
|
|
20
|
+
* Initializes the converter with the URL conversion route.
|
|
21
|
+
*/
|
|
12
22
|
constructor() {
|
|
13
23
|
super(main_config_1.ChromiumRoute.URL);
|
|
14
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Converts content from a URL to PDF.
|
|
27
|
+
*
|
|
28
|
+
* @param {Object} options - Conversion options.
|
|
29
|
+
* @param {string} options.url - The URL of the content to be converted to PDF.
|
|
30
|
+
* @param {PathLikeOrReadStream} [options.header] - PathLike or ReadStream of the header HTML content.
|
|
31
|
+
* @param {PathLikeOrReadStream} [options.footer] - PathLike or ReadStream of the footer HTML content.
|
|
32
|
+
* @param {PageProperties} [options.properties] - Page properties for the conversion.
|
|
33
|
+
* @param {PdfFormat} [options.pdfFormat] - PDF format options.
|
|
34
|
+
* @param {boolean} [options.pdfUA] - Indicates whether to generate PDF/UA compliant output.
|
|
35
|
+
* @param {EmulatedMediaType} [options.emulatedMediaType] - Emulated media type for the conversion.
|
|
36
|
+
* @param {string} [options.waitDelay] - Delay before the conversion process starts.
|
|
37
|
+
* @param {string} [options.waitForExpression] - JavaScript expression to wait for before completing the conversion.
|
|
38
|
+
* @param {string} [options.userAgent] - User agent string to use during the conversion.
|
|
39
|
+
* @param {Record<string, string>} [options.extraHttpHeaders] - Additional HTTP headers for the conversion.
|
|
40
|
+
* @param {boolean} [options.failOnConsoleExceptions] - Whether to fail on console exceptions during conversion.
|
|
41
|
+
* @returns {Promise<Buffer>} A Promise resolving to the converted PDF content as a Buffer.
|
|
42
|
+
*/
|
|
15
43
|
convert({ url, header, footer, properties, pdfFormat, pdfUA, emulatedMediaType, waitDelay, waitForExpression, userAgent, extraHttpHeaders, failOnConsoleExceptions, }) {
|
|
16
44
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
17
45
|
const _url = new url_1.URL(url);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.converter.js","sourceRoot":"","sources":["../../../src/chromium/converters/url.converter.ts"],"names":[],"mappings":";;;;AAAA,6BAAwB;
|
|
1
|
+
{"version":3,"file":"url.converter.js","sourceRoot":"","sources":["../../../src/chromium/converters/url.converter.ts"],"names":[],"mappings":";;;;AAAA,6BAAwB;AACxB,kEAAiC;AACjC,yCAA6E;AAK7E,8DAAwD;AACxD,2CAAsC;AACtC,mDAAgD;AAEhD;;;;;GAKG;AACH,MAAa,YAAa,SAAQ,qBAAS;IACvC;;;OAGG;IACH;QACI,KAAK,CAAC,2BAAa,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACG,OAAO,CAAC,EACI,GAAG,EACH,MAAM,EACN,MAAM,EACN,UAAU,EACV,SAAS,EACT,KAAK,EACL,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,uBAAuB,GAcxC;;YACG,MAAM,IAAI,GAAG,IAAI,SAAG,CAAC,GAAG,CAAC,CAAC;YAC1B,MAAM,IAAI,GAAG,IAAI,mBAAQ,EAAE,CAAC;YAE5B,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YAE9B,MAAM,gCAAc,CAAC,SAAS,CAAC,IAAI,EAAE;gBACjC,MAAM;gBACN,MAAM;gBACN,UAAU;gBACV,SAAS;gBACT,KAAK;gBACL,iBAAiB;gBACjB,SAAS;gBACT,iBAAiB;gBACjB,SAAS;gBACT,gBAAgB;gBAChB,uBAAuB;aAC1B,CAAC,CAAC;YAEH,OAAO,uBAAc,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACrD,CAAC;KAAA;CACJ;AA3ED,oCA2EC"}
|
|
@@ -1,8 +1,32 @@
|
|
|
1
1
|
import FormData from "form-data";
|
|
2
2
|
import { ConversionOptions, PageProperties } from "../interfaces/converter.types";
|
|
3
3
|
import { PathLikeOrReadStream } from "../../common";
|
|
4
|
+
/**
|
|
5
|
+
* Utility class for handling common tasks related to conversion.
|
|
6
|
+
*/
|
|
4
7
|
export declare class ConverterUtils {
|
|
8
|
+
/**
|
|
9
|
+
* Adds page properties to the FormData object based on the provided PageProperties.
|
|
10
|
+
*
|
|
11
|
+
* @param {FormData} data - The FormData object to which page properties will be added.
|
|
12
|
+
* @param {PageProperties} pageProperties - The page properties to be added to the FormData.
|
|
13
|
+
*/
|
|
5
14
|
static addPageProperties(data: FormData, pageProperties: PageProperties): void;
|
|
15
|
+
/**
|
|
16
|
+
* Adds a file to the FormData object.
|
|
17
|
+
*
|
|
18
|
+
* @param {FormData} data - The FormData object to which the file will be added.
|
|
19
|
+
* @param {PathLikeOrReadStream} file - The file to be added (either a PathLike or a ReadStream).
|
|
20
|
+
* @param {string} name - The name to be used for the file in the FormData.
|
|
21
|
+
* @returns {Promise<void>} A Promise that resolves once the file has been added.
|
|
22
|
+
*/
|
|
6
23
|
static addFile(data: FormData, file: PathLikeOrReadStream, name: string): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Customizes the FormData object based on the provided conversion options.
|
|
26
|
+
*
|
|
27
|
+
* @param {FormData} data - The FormData object to be customized.
|
|
28
|
+
* @param {ConversionOptions} options - The conversion options to apply to the FormData.
|
|
29
|
+
* @returns {Promise<void>} A Promise that resolves once the customization is complete.
|
|
30
|
+
*/
|
|
7
31
|
static customize(data: FormData, options: ConversionOptions): Promise<void>;
|
|
8
32
|
}
|
|
@@ -5,7 +5,16 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
6
|
const common_1 = require("../../common");
|
|
7
7
|
const fs_2 = require("fs");
|
|
8
|
+
/**
|
|
9
|
+
* Utility class for handling common tasks related to conversion.
|
|
10
|
+
*/
|
|
8
11
|
class ConverterUtils {
|
|
12
|
+
/**
|
|
13
|
+
* Adds page properties to the FormData object based on the provided PageProperties.
|
|
14
|
+
*
|
|
15
|
+
* @param {FormData} data - The FormData object to which page properties will be added.
|
|
16
|
+
* @param {PageProperties} pageProperties - The page properties to be added to the FormData.
|
|
17
|
+
*/
|
|
9
18
|
static addPageProperties(data, pageProperties) {
|
|
10
19
|
if (pageProperties.size) {
|
|
11
20
|
common_1.GotenbergUtils.assert(pageProperties.size.width >= 1.0 && pageProperties.size.height >= 1.5, "size is smaller than the minimum printing requirements (i.e. 1.0 x 1.5 in)");
|
|
@@ -46,6 +55,14 @@ class ConverterUtils {
|
|
|
46
55
|
data.append("nativePageRanges", `${pageProperties.nativePageRanges.from}-${pageProperties.nativePageRanges.to}`);
|
|
47
56
|
}
|
|
48
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Adds a file to the FormData object.
|
|
60
|
+
*
|
|
61
|
+
* @param {FormData} data - The FormData object to which the file will be added.
|
|
62
|
+
* @param {PathLikeOrReadStream} file - The file to be added (either a PathLike or a ReadStream).
|
|
63
|
+
* @param {string} name - The name to be used for the file in the FormData.
|
|
64
|
+
* @returns {Promise<void>} A Promise that resolves once the file has been added.
|
|
65
|
+
*/
|
|
49
66
|
static addFile(data, file, name) {
|
|
50
67
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
51
68
|
if (Buffer.isBuffer(file)) {
|
|
@@ -60,6 +77,13 @@ class ConverterUtils {
|
|
|
60
77
|
}
|
|
61
78
|
});
|
|
62
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Customizes the FormData object based on the provided conversion options.
|
|
82
|
+
*
|
|
83
|
+
* @param {FormData} data - The FormData object to be customized.
|
|
84
|
+
* @param {ConversionOptions} options - The conversion options to apply to the FormData.
|
|
85
|
+
* @returns {Promise<void>} A Promise that resolves once the customization is complete.
|
|
86
|
+
*/
|
|
63
87
|
static customize(data, options) {
|
|
64
88
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
65
89
|
if (options.pdfFormat) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converter.utils.js","sourceRoot":"","sources":["../../../src/chromium/utils/converter.utils.ts"],"names":[],"mappings":";;;;AAAA,2BAAyD;AAOzD,yCAAkE;AAClE,2BAA8B;AAE9B,MAAa,cAAc;
|
|
1
|
+
{"version":3,"file":"converter.utils.js","sourceRoot":"","sources":["../../../src/chromium/utils/converter.utils.ts"],"names":[],"mappings":";;;;AAAA,2BAAyD;AAOzD,yCAAkE;AAClE,2BAA8B;AAE9B;;GAEG;AACH,MAAa,cAAc;IACvB;;;;;OAKG;IACI,MAAM,CAAC,iBAAiB,CAC3B,IAAc,EACd,cAA8B;QAE9B,IAAI,cAAc,CAAC,IAAI,EAAE,CAAC;YACtB,uBAAc,CAAC,MAAM,CACjB,cAAc,CAAC,IAAI,CAAC,KAAK,IAAI,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,IAAI,GAAG,EACrE,4EAA4E,CAC/E,CAAC;YAEF,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACrD,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC3D,CAAC;QAED,IAAI,cAAc,CAAC,OAAO,EAAE,CAAC;YACzB,uBAAc,CAAC,MAAM,CACjB,cAAc,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;gBAC/B,cAAc,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC;gBAClC,cAAc,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC;gBAChC,cAAc,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,EAChC,kCAAkC,CACrC,CAAC;YAEF,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,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