abstract-document 6.7.0 → 6.8.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/CHANGELOG.md +14 -1
- package/lib/abstract-document/atoms/toc-separator.d.ts +2 -0
- package/lib/abstract-document/atoms/toc-separator.d.ts.map +1 -1
- package/lib/abstract-document/atoms/toc-separator.js +2 -1
- package/lib/abstract-document/atoms/toc-separator.js.map +1 -1
- package/lib/abstract-document/styles/text-style.d.ts +0 -3
- package/lib/abstract-document/styles/text-style.d.ts.map +1 -1
- package/lib/abstract-document/styles/text-style.js +1 -2
- package/lib/abstract-document/styles/text-style.js.map +1 -1
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/mixed-hyperlink-and-textrun-no-underline.d.ts +3 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/mixed-hyperlink-and-textrun-no-underline.d.ts.map +1 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/mixed-hyperlink-and-textrun-no-underline.js +114 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/mixed-hyperlink-and-textrun-no-underline.js.map +1 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/mixed-hyperlink-and-textrun-with-underline.d.ts +3 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/mixed-hyperlink-and-textrun-with-underline.d.ts.map +1 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/mixed-hyperlink-and-textrun-with-underline.js +114 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/mixed-hyperlink-and-textrun-with-underline.js.map +1 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-hyperlink copy.d.ts +3 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-hyperlink copy.d.ts.map +1 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-hyperlink copy.js +65 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-hyperlink copy.js.map +1 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-hyperlink-no-underline.d.ts +3 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-hyperlink-no-underline.d.ts.map +1 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-hyperlink-no-underline.js +85 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-hyperlink-no-underline.js.map +1 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-hyperlink-with-underline.d.ts +3 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-hyperlink-with-underline.d.ts.map +1 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-hyperlink-with-underline.js +85 -0
- package/lib/abstract-document-exporters/__tests__/pdf/test-defs/single-hyperlink-with-underline.js.map +1 -0
- package/lib/abstract-document-exporters/pdf/render.js +10 -9
- package/lib/abstract-document-exporters/pdf/render.js.map +1 -1
- package/package.json +2 -3
- package/src/abstract-document/atoms/toc-separator.ts +6 -2
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Group.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Header and footer.docx and b/package/src/abstract-document-exporters/__tests__/docx2/tmp/Header → footer.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Mixed hyperlink and textrun.docx and b/package/src/abstract-document-exporters/__tests__/docx2/tmp/Mixed hyperlink → textrun.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Mixed textrun and images.docx and b/package/src/abstract-document-exporters/__tests__/docx2/tmp/Mixed textrun → images.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple images.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple tables.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple textrun with Center alignment.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple textrun with End alignment.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple textrun with Start alignment that linebreaks.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Multiple textrun with Start alignment.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Page numbering.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Simple table colSpan and rowSpan.docx and b/package/src/abstract-document-exporters/__tests__/docx2/tmp/Simple table colSpan → rowSpan.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Simple table without rows.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Simple table.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single hyperlink.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single image.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with Center alignment that linebreaks.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with Center alignment.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with End alignment that linebreaks.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with End alignment.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with Start alignment that linebreaks.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun with Start alignment.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/Single textrun.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/hello.docx +0 -0
- package/src/abstract-document-exporters/__tests__/docx2/tmp/world.docx +0 -0
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/absolute-position-header-and-footer.tsx +11 -3
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/mixed-hyperlink-and-textrun-no-underline.tsx +114 -0
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/mixed-hyperlink-and-textrun-with-underline.tsx +114 -0
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-hyperlink-no-underline.tsx +70 -0
- package/src/abstract-document-exporters/__tests__/pdf/test-defs/single-hyperlink-with-underline.tsx +70 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position group.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position header and footer.pdf +4 -4
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position paragraph.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position section in group.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position section in table.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Absolute position table.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Group Paragraphs.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Group Tables.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Group no keeptogether.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Group too big for one page.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Header and footer.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Hyperlink internal linktarget.pdf +250 -682
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Hyperlink internal.pdf +250 -682
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Margins header body footer.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Mixed hyperlink and textrun no underline.pdf +180 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Mixed hyperlink and textrun with underline.pdf +192 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Mixed hyperlink and textrun.pdf +34 -60
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Mixed textrun and images.pdf and b/package/src/abstract-document-exporters/__tests__/pdf/tmp/Mixed textrun → images.pdf +0 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple images overflow.pdf +0 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple images.pdf +0 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple textrun with Center alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple textrun with End alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple textrun with Start alignment that linebreaks.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Multiple textrun with Start alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Page numbering.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table row that doesnt fit page.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table single row.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with group.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with header 2.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with header.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with margin bottom.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with margin top single table.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with margin top.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with rowSpan multipages.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Pagebreak table with rowSpan.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table all auto.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table all fix.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table background.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table cell padding of image.pdf +0 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table cell padding of text.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table center alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table colSpan and rowSpan.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table mix auto fix.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table padding.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table right alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table row alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table text alignment in cell with wrapping.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table text alignment in cell.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table with default colored borders.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table with header.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table with multi colored borders.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Simple table with single colored borders.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single date.pdf +14 -14
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single figure.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single hyperlink centered.pdf +29 -43
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single hyperlink no underline.pdf +146 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single hyperlink right aligned.pdf +29 -43
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single hyperlink.pdf +29 -43
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image svg color hex.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image svg color name.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image svg color url.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single image.pdf +0 -0
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline alphabetic.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline bottom.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline hanging.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline middle.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun baseline top.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Center alignment that linebreaks.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Center alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with End alignment that linebreaks.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with End alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Justify alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Start alignment that linebreaks.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with Start alignment.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun with super and subscripts.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Single textrun.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/Table of content separator.pdf +26 -40
- package/src/abstract-document-exporters/__tests__/pdf/tmp/hello.pdf +2 -2
- package/src/abstract-document-exporters/__tests__/pdf/tmp/world.pdf +2 -2
- package/src/abstract-document-exporters/pdf/render.ts +42 -30
- package/LICENSE +0 -21
|
@@ -16,19 +16,6 @@ endobj
|
|
|
16
16
|
/F 4
|
|
17
17
|
>>
|
|
18
18
|
endobj
|
|
19
|
-
11 0 obj
|
|
20
|
-
<<
|
|
21
|
-
/align /left
|
|
22
|
-
/Subtype /Underline
|
|
23
|
-
/QuadPoints [0 840 22.78 840 0 828.44 22.78 828.44]
|
|
24
|
-
/Contents ()
|
|
25
|
-
/Type /Annot
|
|
26
|
-
/Rect [0 828.44 22.78 840]
|
|
27
|
-
/Border [0 0 0]
|
|
28
|
-
/C [0 0 1]
|
|
29
|
-
/Align /left
|
|
30
|
-
>>
|
|
31
|
-
endobj
|
|
32
19
|
7 0 obj
|
|
33
20
|
<<
|
|
34
21
|
/Type /Page
|
|
@@ -36,7 +23,7 @@ endobj
|
|
|
36
23
|
/MediaBox [0 0 595 842]
|
|
37
24
|
/Contents 5 0 R
|
|
38
25
|
/Resources 6 0 R
|
|
39
|
-
/Annots [9 0 R
|
|
26
|
+
/Annots [9 0 R]
|
|
40
27
|
>>
|
|
41
28
|
endobj
|
|
42
29
|
6 0 obj
|
|
@@ -77,20 +64,20 @@ Q
|
|
|
77
64
|
|
|
78
65
|
endstream
|
|
79
66
|
endobj
|
|
80
|
-
|
|
67
|
+
12 0 obj
|
|
81
68
|
(PDFKit)
|
|
82
69
|
endobj
|
|
83
|
-
|
|
70
|
+
13 0 obj
|
|
84
71
|
(PDFKit)
|
|
85
72
|
endobj
|
|
86
|
-
|
|
87
|
-
(D:
|
|
73
|
+
14 0 obj
|
|
74
|
+
(D:20220216115440Z)
|
|
88
75
|
endobj
|
|
89
|
-
|
|
76
|
+
11 0 obj
|
|
90
77
|
<<
|
|
91
|
-
/Producer
|
|
92
|
-
/Creator
|
|
93
|
-
/CreationDate
|
|
78
|
+
/Producer 12 0 R
|
|
79
|
+
/Creator 13 0 R
|
|
80
|
+
/CreationDate 14 0 R
|
|
94
81
|
>>
|
|
95
82
|
endobj
|
|
96
83
|
10 0 obj
|
|
@@ -128,30 +115,29 @@ endobj
|
|
|
128
115
|
>>
|
|
129
116
|
endobj
|
|
130
117
|
xref
|
|
131
|
-
0
|
|
118
|
+
0 15
|
|
132
119
|
0000000000 65535 f
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
120
|
+
0000001128 00000 n
|
|
121
|
+
0000001185 00000 n
|
|
122
|
+
0000001066 00000 n
|
|
123
|
+
0000001045 00000 n
|
|
124
|
+
0000000367 00000 n
|
|
125
|
+
0000000277 00000 n
|
|
126
|
+
0000000157 00000 n
|
|
140
127
|
0000000015 00000 n
|
|
141
128
|
0000000051 00000 n
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
0000001042 00000 n
|
|
129
|
+
0000000947 00000 n
|
|
130
|
+
0000000871 00000 n
|
|
131
|
+
0000000785 00000 n
|
|
132
|
+
0000000810 00000 n
|
|
133
|
+
0000000835 00000 n
|
|
148
134
|
trailer
|
|
149
135
|
<<
|
|
150
|
-
/Size
|
|
136
|
+
/Size 15
|
|
151
137
|
/Root 3 0 R
|
|
152
|
-
/Info
|
|
153
|
-
/ID [<
|
|
138
|
+
/Info 11 0 R
|
|
139
|
+
/ID [<611486daff7347181a1808b301876f43> <611486daff7347181a1808b301876f43>]
|
|
154
140
|
>>
|
|
155
141
|
startxref
|
|
156
|
-
|
|
142
|
+
1232
|
|
157
143
|
%%EOF
|
|
@@ -79,7 +79,7 @@ endobj
|
|
|
79
79
|
(PDFKit)
|
|
80
80
|
endobj
|
|
81
81
|
15 0 obj
|
|
82
|
-
(D:
|
|
82
|
+
(D:20220216115439Z)
|
|
83
83
|
endobj
|
|
84
84
|
12 0 obj
|
|
85
85
|
<<
|
|
@@ -145,7 +145,7 @@ trailer
|
|
|
145
145
|
/Size 16
|
|
146
146
|
/Root 3 0 R
|
|
147
147
|
/Info 12 0 R
|
|
148
|
-
/ID [<
|
|
148
|
+
/ID [<c1726f588f634670baad2b659fd2fbbf> <c1726f588f634670baad2b659fd2fbbf>]
|
|
149
149
|
>>
|
|
150
150
|
startxref
|
|
151
151
|
1212
|
|
@@ -43,7 +43,7 @@ endobj
|
|
|
43
43
|
(PDFKit)
|
|
44
44
|
endobj
|
|
45
45
|
12 0 obj
|
|
46
|
-
(D:
|
|
46
|
+
(D:20220216115440Z)
|
|
47
47
|
endobj
|
|
48
48
|
9 0 obj
|
|
49
49
|
<<
|
|
@@ -106,7 +106,7 @@ trailer
|
|
|
106
106
|
/Size 13
|
|
107
107
|
/Root 3 0 R
|
|
108
108
|
/Info 9 0 R
|
|
109
|
-
/ID [<
|
|
109
|
+
/ID [<7e7b9497e2b770678124912c78130e86> <7e7b9497e2b770678124912c78130e86>]
|
|
110
110
|
>>
|
|
111
111
|
startxref
|
|
112
112
|
837
|
|
@@ -113,7 +113,7 @@ function renderPage(
|
|
|
113
113
|
headerY += style.headerMargins.bottom;
|
|
114
114
|
|
|
115
115
|
const footerHeight = page.footer.reduce(
|
|
116
|
-
(a, b) => a + getDesiredSize(b, desiredSizes).height,
|
|
116
|
+
(a, b) => a + (AD.Position.isPositionAbsolute(b) ? 0 : getDesiredSize(b, desiredSizes).height),
|
|
117
117
|
style.footerMargins.top + style.footerMargins.bottom
|
|
118
118
|
);
|
|
119
119
|
const footerX = style.footerMargins.left;
|
|
@@ -383,7 +383,7 @@ function renderAtom(
|
|
|
383
383
|
renderHyperLink(resources, pdf, finalRect, textStyle, atom, alignment, isFirstAtom, isLastAtom, availableWidth);
|
|
384
384
|
return;
|
|
385
385
|
case "TocSeparator":
|
|
386
|
-
renderTocSeparator(pdf, finalRect, textStyle);
|
|
386
|
+
renderTocSeparator(pdf, finalRect, textStyle, atom);
|
|
387
387
|
return;
|
|
388
388
|
case "LinkTarget":
|
|
389
389
|
return;
|
|
@@ -476,8 +476,13 @@ function renderHyperLink(
|
|
|
476
476
|
drawHyperLink(pdf, finalRect, style, hyperLink, textAlignment, isFirstAtom, isLastAtom, availableWidth);
|
|
477
477
|
}
|
|
478
478
|
|
|
479
|
-
function renderTocSeparator(
|
|
480
|
-
|
|
479
|
+
function renderTocSeparator(
|
|
480
|
+
pdf: {},
|
|
481
|
+
finalRect: AD.Rect.Rect,
|
|
482
|
+
textStyle: AD.TextStyle.TextStyle,
|
|
483
|
+
tocSeparator: AD.TocSeparator.TocSeparator
|
|
484
|
+
): void {
|
|
485
|
+
drawDottedLine(pdf, finalRect, textStyle, tocSeparator);
|
|
481
486
|
}
|
|
482
487
|
|
|
483
488
|
function drawHyperLink(
|
|
@@ -513,34 +518,34 @@ function drawHyperLink(
|
|
|
513
518
|
// so always set alignment to left and handle it through an x offset
|
|
514
519
|
// if its just a single atom then we can use its alignment to partially support multi-line texts for other alignments
|
|
515
520
|
if (isFirstAtom || alignment !== "left") {
|
|
516
|
-
pdf
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
.underline(xUnderline, finalRect.y + 2, finalRect.width, finalRect.height, {
|
|
521
|
+
pdf.text(hyperLink.text, finalRect.x, finalRect.y, {
|
|
522
|
+
width: availableWidth,
|
|
523
|
+
align: isSingleAtom ? alignment : "left",
|
|
524
|
+
goTo: isInternalLink ? hyperLink.target.substr(1) : undefined,
|
|
525
|
+
indent: textStyle.indent || 0,
|
|
526
|
+
continued: alignment !== "left" ? false : !isLastAtom,
|
|
527
|
+
baseline: textStyle.baseline || "top",
|
|
528
|
+
...(textStyle.lineGap !== undefined ? { lineGap: textStyle.lineGap } : {}),
|
|
529
|
+
});
|
|
530
|
+
if (textStyle.underline === undefined ? true : textStyle.underline) {
|
|
531
|
+
pdf.underline(xUnderline, finalRect.y + 2, finalRect.width, finalRect.height, {
|
|
528
532
|
align: isSingleAtom ? alignment : "left",
|
|
529
533
|
color: "blue",
|
|
530
534
|
});
|
|
535
|
+
}
|
|
531
536
|
} else {
|
|
532
|
-
pdf
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
.underline(xUnderline, finalRect.y + 2, finalRect.width, finalRect.height, {
|
|
537
|
+
pdf.text(hyperLink.text, {
|
|
538
|
+
align: "left",
|
|
539
|
+
goTo: isInternalLink ? hyperLink.target.substr(1) : undefined,
|
|
540
|
+
indent: textStyle.indent || 0,
|
|
541
|
+
continued: !isLastAtom,
|
|
542
|
+
...(textStyle.lineGap !== undefined ? { lineGap: textStyle.lineGap } : {}),
|
|
543
|
+
});
|
|
544
|
+
if (textStyle.underline === undefined ? true : textStyle.underline) {
|
|
545
|
+
pdf.underline(xUnderline, finalRect.y + 2, finalRect.width, finalRect.height, {
|
|
542
546
|
color: "blue",
|
|
543
547
|
});
|
|
548
|
+
}
|
|
544
549
|
}
|
|
545
550
|
|
|
546
551
|
resetTextOffset(pdf, textStyle);
|
|
@@ -597,19 +602,26 @@ function drawText(
|
|
|
597
602
|
resetTextOffset(pdf, textStyle);
|
|
598
603
|
}
|
|
599
604
|
|
|
600
|
-
function drawDottedLine(
|
|
605
|
+
function drawDottedLine(
|
|
606
|
+
pdf: any,
|
|
607
|
+
finalRect: AD.Rect.Rect,
|
|
608
|
+
textStyle: AD.TextStyle.TextStyle,
|
|
609
|
+
tocSeparator: AD.TocSeparator.TocSeparator
|
|
610
|
+
): void {
|
|
601
611
|
const font = getFontNameStyle(textStyle);
|
|
602
612
|
const fontSize = AD.TextStyle.calculateFontSize(textStyle, 10);
|
|
603
613
|
|
|
614
|
+
const charSpacing = tocSeparator.width ? tocSeparator.width : 5;
|
|
615
|
+
|
|
604
616
|
const oneDotW = pdf.widthOfString(".", {
|
|
605
617
|
width: finalRect.width,
|
|
606
618
|
height: finalRect.height,
|
|
607
|
-
characterSpacing:
|
|
619
|
+
characterSpacing: charSpacing,
|
|
608
620
|
});
|
|
609
621
|
const twoDotsW = pdf.widthOfString("..", {
|
|
610
622
|
width: finalRect.width,
|
|
611
623
|
height: finalRect.height,
|
|
612
|
-
characterSpacing:
|
|
624
|
+
characterSpacing: charSpacing,
|
|
613
625
|
});
|
|
614
626
|
const numberOfDots = Math.floor((finalRect.width - oneDotW) / (twoDotsW - oneDotW)) + 1;
|
|
615
627
|
if (twoDotsW - oneDotW === 0 || numberOfDots < 1) {
|
|
@@ -633,7 +645,7 @@ function drawDottedLine(pdf: any, finalRect: AD.Rect.Rect, textStyle: AD.TextSty
|
|
|
633
645
|
width: finalRect.width,
|
|
634
646
|
height: finalRect.height,
|
|
635
647
|
align: "right",
|
|
636
|
-
characterSpacing:
|
|
648
|
+
characterSpacing: charSpacing,
|
|
637
649
|
});
|
|
638
650
|
resetTextOffset(pdf, textStyle);
|
|
639
651
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2018 Divid AB
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|