Skip to content

Commit 49c61c6

Browse files
🤖 dprint fmt
1 parent f1b8cd5 commit 49c61c6

File tree

4 files changed

+108
-108
lines changed

4 files changed

+108
-108
lines changed

types/pdf2docx/index.d.ts

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -5,94 +5,94 @@
55
/// <reference types="node" />
66

77
export class Parser {
8-
/**
9-
* Creates an instance of Parser for PDF processing
10-
* @param pdf_file Path to the PDF file or Buffer containing PDF data
11-
* @param password Optional password for encrypted PDF
12-
*/
13-
constructor(pdf_file: string | Buffer, password?: string);
8+
/**
9+
* Creates an instance of Parser for PDF processing
10+
* @param pdf_file Path to the PDF file or Buffer containing PDF data
11+
* @param password Optional password for encrypted PDF
12+
*/
13+
constructor(pdf_file: string | Buffer, password?: string);
1414

15-
/**
16-
* Parse and convert PDF to DOCX
17-
* @param docx_file Output DOCX file path
18-
* @param options Conversion options
19-
* @returns Promise resolving to parsing status
20-
*/
21-
parse(docx_file: string, options?: ConversionOptions): Promise<ParsingStatus>;
15+
/**
16+
* Parse and convert PDF to DOCX
17+
* @param docx_file Output DOCX file path
18+
* @param options Conversion options
19+
* @returns Promise resolving to parsing status
20+
*/
21+
parse(docx_file: string, options?: ConversionOptions): Promise<ParsingStatus>;
2222

23-
/**
24-
* Convert a specific range of pages
25-
* @param docx_file Output DOCX file path
26-
* @param start_page Starting page number (1-based)
27-
* @param end_page Ending page number (1-based)
28-
* @param options Conversion options
29-
* @returns Promise resolving to parsing status
30-
*/
31-
parsePages(
32-
docx_file: string,
33-
start_page: number,
34-
end_page: number,
35-
options?: ConversionOptions
36-
): Promise<ParsingStatus>;
23+
/**
24+
* Convert a specific range of pages
25+
* @param docx_file Output DOCX file path
26+
* @param start_page Starting page number (1-based)
27+
* @param end_page Ending page number (1-based)
28+
* @param options Conversion options
29+
* @returns Promise resolving to parsing status
30+
*/
31+
parsePages(
32+
docx_file: string,
33+
start_page: number,
34+
end_page: number,
35+
options?: ConversionOptions,
36+
): Promise<ParsingStatus>;
3737
}
3838

3939
export interface ConversionOptions {
40-
start?: number;
41-
end?: number;
42-
pages?: number[];
43-
password?: string;
44-
tables?: TableOptions;
45-
images?: ImageOptions;
46-
font_settings?: FontSettings;
47-
page_margin?: MarginSettings;
40+
start?: number;
41+
end?: number;
42+
pages?: number[];
43+
password?: string;
44+
tables?: TableOptions;
45+
images?: ImageOptions;
46+
font_settings?: FontSettings;
47+
page_margin?: MarginSettings;
4848
}
4949

5050
export interface TableOptions {
51-
extract_tables?: boolean;
52-
cell_border_width?: number;
53-
cell_margin?: number;
51+
extract_tables?: boolean;
52+
cell_border_width?: number;
53+
cell_margin?: number;
5454
}
5555

5656
export interface ImageOptions {
57-
extract_images?: boolean;
58-
max_width?: number;
59-
max_height?: number;
57+
extract_images?: boolean;
58+
max_width?: number;
59+
max_height?: number;
6060
}
6161

6262
export interface FontSettings {
63-
default_font_size?: number;
64-
default_font_family?: string;
65-
text_direction?: 'horizontal' | 'vertical';
63+
default_font_size?: number;
64+
default_font_family?: string;
65+
text_direction?: "horizontal" | "vertical";
6666
}
6767

6868
export interface MarginSettings {
69-
top?: number;
70-
bottom?: number;
71-
left?: number;
72-
right?: number;
69+
top?: number;
70+
bottom?: number;
71+
left?: number;
72+
right?: number;
7373
}
7474

7575
export interface ParsingStatus {
76-
pages_processed: number;
77-
status: string;
78-
errors?: ParseError[];
76+
pages_processed: number;
77+
status: string;
78+
errors?: ParseError[];
7979
}
8080

8181
export interface ParseError {
82-
message: string;
83-
page?: number;
84-
code?: string;
82+
message: string;
83+
page?: number;
84+
code?: string;
8585
}
8686

8787
/**
88-
* Convert PDF to DOCX
89-
* @param pdf_file Input PDF file path or Buffer
90-
* @param docx_file Output DOCX file path
91-
* @param options Conversion options
92-
* @returns Promise resolving to parsing status
93-
*/
88+
* Convert PDF to DOCX
89+
* @param pdf_file Input PDF file path or Buffer
90+
* @param docx_file Output DOCX file path
91+
* @param options Conversion options
92+
* @returns Promise resolving to parsing status
93+
*/
9494
export function convert(
95-
pdf_file: string | Buffer,
96-
docx_file: string,
97-
options?: ConversionOptions
95+
pdf_file: string | Buffer,
96+
docx_file: string,
97+
options?: ConversionOptions,
9898
): Promise<ParsingStatus>;

types/pdf2docx/package.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
2-
"private": true,
3-
"name": "@types/pdf2docx",
4-
"version": "0.0.9999",
5-
"projects": [
6-
"https://www.npmjs.com/package/pdf2docx"
7-
],
8-
"dependencies": {
9-
"@types/node": "*"
10-
},
11-
"devDependencies": {
12-
"@types/pdf2docx": "workspace:."
13-
},
14-
"owners": [
15-
{
16-
"name": "manuz cheruz",
17-
"githubUsername": "manuzcheruz"
18-
}
19-
]
20-
}
2+
"private": true,
3+
"name": "@types/pdf2docx",
4+
"version": "0.0.9999",
5+
"projects": [
6+
"https://www.npmjs.com/package/pdf2docx"
7+
],
8+
"dependencies": {
9+
"@types/node": "*"
10+
},
11+
"devDependencies": {
12+
"@types/pdf2docx": "workspace:."
13+
},
14+
"owners": [
15+
{
16+
"name": "manuz cheruz",
17+
"githubUsername": "manuzcheruz"
18+
}
19+
]
20+
}

types/pdf2docx/pdf2docx-tests.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
import { Parser, convert } from 'pdf2docx';
1+
import { convert, Parser } from "pdf2docx";
22

33
// Test the Parser class
4-
const parser = new Parser('test.pdf');
5-
parser.parse('output.docx', {
4+
const parser = new Parser("test.pdf");
5+
parser.parse("output.docx", {
66
start: 1,
77
end: 5,
88
tables: {
99
extract_tables: true,
10-
cell_border_width: 1
11-
}
10+
cell_border_width: 1,
11+
},
1212
}).then(status => {
1313
console.log(`Processed ${status.pages_processed} pages`);
1414
});
1515

1616
// Test the convert function
17-
convert('input.pdf', 'output.docx', {
17+
convert("input.pdf", "output.docx", {
1818
pages: [1, 2, 3],
1919
images: {
2020
extract_images: true,
21-
max_width: 800
22-
}
21+
max_width: 800,
22+
},
2323
}).then(status => {
2424
console.log(status.status);
2525
});

types/pdf2docx/tsconfig.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"compilerOptions": {
3-
"module": "commonjs",
4-
"lib": [
5-
"es6"
6-
],
7-
"strictFunctionTypes": true,
8-
"noImplicitAny": true,
9-
"noImplicitThis": true,
10-
"strictNullChecks": true,
11-
"types": [],
12-
"noEmit": true,
13-
"forceConsistentCasingInFileNames": true
14-
},
15-
"files": [
16-
"index.d.ts",
17-
"pdf2docx-tests.ts"
18-
]
19-
}
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"lib": [
5+
"es6"
6+
],
7+
"strictFunctionTypes": true,
8+
"noImplicitAny": true,
9+
"noImplicitThis": true,
10+
"strictNullChecks": true,
11+
"types": [],
12+
"noEmit": true,
13+
"forceConsistentCasingInFileNames": true
14+
},
15+
"files": [
16+
"index.d.ts",
17+
"pdf2docx-tests.ts"
18+
]
19+
}

0 commit comments

Comments
 (0)