@@ -33,12 +33,16 @@ | ||
33 | 33 | Me.Button8 = New System.Windows.Forms.Button() |
34 | 34 | Me.Button9 = New System.Windows.Forms.Button() |
35 | 35 | Me.btnReName = New System.Windows.Forms.Button() |
36 | + Me.Button10 = New System.Windows.Forms.Button() | |
37 | + Me.Button11 = New System.Windows.Forms.Button() | |
38 | + Me.Button12 = New System.Windows.Forms.Button() | |
39 | + Me.Button13 = New System.Windows.Forms.Button() | |
36 | 40 | Me.SuspendLayout() |
37 | 41 | ' |
38 | 42 | 'btnNCXDep2 |
39 | 43 | ' |
40 | 44 | Me.btnNCXDep2.Location = New System.Drawing.Point(60, 52) |
41 | - Me.btnNCXDep2.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) | |
45 | + Me.btnNCXDep2.Margin = New System.Windows.Forms.Padding(4) | |
42 | 46 | Me.btnNCXDep2.Name = "btnNCXDep2" |
43 | 47 | Me.btnNCXDep2.Size = New System.Drawing.Size(231, 86) |
44 | 48 | Me.btnNCXDep2.TabIndex = 10 |
@@ -48,7 +52,7 @@ | ||
48 | 52 | 'Button1 |
49 | 53 | ' |
50 | 54 | Me.Button1.Location = New System.Drawing.Point(60, 191) |
51 | - Me.Button1.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) | |
55 | + Me.Button1.Margin = New System.Windows.Forms.Padding(4) | |
52 | 56 | Me.Button1.Name = "Button1" |
53 | 57 | Me.Button1.Size = New System.Drawing.Size(231, 86) |
54 | 58 | Me.Button1.TabIndex = 11 |
@@ -58,7 +62,7 @@ | ||
58 | 62 | 'Button2 |
59 | 63 | ' |
60 | 64 | Me.Button2.Location = New System.Drawing.Point(60, 310) |
61 | - Me.Button2.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) | |
65 | + Me.Button2.Margin = New System.Windows.Forms.Padding(4) | |
62 | 66 | Me.Button2.Name = "Button2" |
63 | 67 | Me.Button2.Size = New System.Drawing.Size(231, 86) |
64 | 68 | Me.Button2.TabIndex = 12 |
@@ -68,7 +72,7 @@ | ||
68 | 72 | 'Button3 |
69 | 73 | ' |
70 | 74 | Me.Button3.Location = New System.Drawing.Point(315, 191) |
71 | - Me.Button3.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) | |
75 | + Me.Button3.Margin = New System.Windows.Forms.Padding(4) | |
72 | 76 | Me.Button3.Name = "Button3" |
73 | 77 | Me.Button3.Size = New System.Drawing.Size(231, 86) |
74 | 78 | Me.Button3.TabIndex = 13 |
@@ -78,7 +82,7 @@ | ||
78 | 82 | 'Button4 |
79 | 83 | ' |
80 | 84 | Me.Button4.Location = New System.Drawing.Point(573, 310) |
81 | - Me.Button4.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) | |
85 | + Me.Button4.Margin = New System.Windows.Forms.Padding(4) | |
82 | 86 | Me.Button4.Name = "Button4" |
83 | 87 | Me.Button4.Size = New System.Drawing.Size(231, 86) |
84 | 88 | Me.Button4.TabIndex = 14 |
@@ -88,7 +92,7 @@ | ||
88 | 92 | 'Button5 |
89 | 93 | ' |
90 | 94 | Me.Button5.Location = New System.Drawing.Point(299, 52) |
91 | - Me.Button5.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) | |
95 | + Me.Button5.Margin = New System.Windows.Forms.Padding(4) | |
92 | 96 | Me.Button5.Name = "Button5" |
93 | 97 | Me.Button5.Size = New System.Drawing.Size(231, 86) |
94 | 98 | Me.Button5.TabIndex = 15 |
@@ -98,7 +102,7 @@ | ||
98 | 102 | 'Button6 |
99 | 103 | ' |
100 | 104 | Me.Button6.Location = New System.Drawing.Point(556, 52) |
101 | - Me.Button6.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) | |
105 | + Me.Button6.Margin = New System.Windows.Forms.Padding(4) | |
102 | 106 | Me.Button6.Name = "Button6" |
103 | 107 | Me.Button6.Size = New System.Drawing.Size(231, 86) |
104 | 108 | Me.Button6.TabIndex = 16 |
@@ -108,7 +112,7 @@ | ||
108 | 112 | 'Button7 |
109 | 113 | ' |
110 | 114 | Me.Button7.Location = New System.Drawing.Point(60, 420) |
111 | - Me.Button7.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) | |
115 | + Me.Button7.Margin = New System.Windows.Forms.Padding(4) | |
112 | 116 | Me.Button7.Name = "Button7" |
113 | 117 | Me.Button7.Size = New System.Drawing.Size(231, 86) |
114 | 118 | Me.Button7.TabIndex = 17 |
@@ -118,7 +122,7 @@ | ||
118 | 122 | 'Button8 |
119 | 123 | ' |
120 | 124 | Me.Button8.Location = New System.Drawing.Point(573, 191) |
121 | - Me.Button8.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) | |
125 | + Me.Button8.Margin = New System.Windows.Forms.Padding(4) | |
122 | 126 | Me.Button8.Name = "Button8" |
123 | 127 | Me.Button8.Size = New System.Drawing.Size(231, 86) |
124 | 128 | Me.Button8.TabIndex = 18 |
@@ -128,7 +132,7 @@ | ||
128 | 132 | 'Button9 |
129 | 133 | ' |
130 | 134 | Me.Button9.Location = New System.Drawing.Point(315, 310) |
131 | - Me.Button9.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) | |
135 | + Me.Button9.Margin = New System.Windows.Forms.Padding(4) | |
132 | 136 | Me.Button9.Name = "Button9" |
133 | 137 | Me.Button9.Size = New System.Drawing.Size(231, 86) |
134 | 138 | Me.Button9.TabIndex = 19 |
@@ -137,7 +141,7 @@ | ||
137 | 141 | ' |
138 | 142 | 'btnReName |
139 | 143 | ' |
140 | - Me.btnReName.Location = New System.Drawing.Point(808, 451) | |
144 | + Me.btnReName.Location = New System.Drawing.Point(610, 420) | |
141 | 145 | Me.btnReName.Margin = New System.Windows.Forms.Padding(4) |
142 | 146 | Me.btnReName.Name = "btnReName" |
143 | 147 | Me.btnReName.Size = New System.Drawing.Size(231, 86) |
@@ -145,11 +149,55 @@ | ||
145 | 149 | Me.btnReName.Text = "ReName" |
146 | 150 | Me.btnReName.UseVisualStyleBackColor = True |
147 | 151 | ' |
152 | + 'Button10 | |
153 | + ' | |
154 | + Me.Button10.Location = New System.Drawing.Point(831, 52) | |
155 | + Me.Button10.Margin = New System.Windows.Forms.Padding(4) | |
156 | + Me.Button10.Name = "Button10" | |
157 | + Me.Button10.Size = New System.Drawing.Size(231, 86) | |
158 | + Me.Button10.TabIndex = 21 | |
159 | + Me.Button10.Text = "JsonEdit" | |
160 | + Me.Button10.UseVisualStyleBackColor = True | |
161 | + ' | |
162 | + 'Button11 | |
163 | + ' | |
164 | + Me.Button11.Location = New System.Drawing.Point(315, 420) | |
165 | + Me.Button11.Margin = New System.Windows.Forms.Padding(4) | |
166 | + Me.Button11.Name = "Button11" | |
167 | + Me.Button11.Size = New System.Drawing.Size(231, 86) | |
168 | + Me.Button11.TabIndex = 22 | |
169 | + Me.Button11.Text = "Txt Dep 1" | |
170 | + Me.Button11.UseVisualStyleBackColor = True | |
171 | + ' | |
172 | + 'Button12 | |
173 | + ' | |
174 | + Me.Button12.Location = New System.Drawing.Point(924, 234) | |
175 | + Me.Button12.Margin = New System.Windows.Forms.Padding(4) | |
176 | + Me.Button12.Name = "Button12" | |
177 | + Me.Button12.Size = New System.Drawing.Size(115, 86) | |
178 | + Me.Button12.TabIndex = 23 | |
179 | + Me.Button12.Text = "NCX Dep 2 B" | |
180 | + Me.Button12.UseVisualStyleBackColor = True | |
181 | + ' | |
182 | + 'Button13 | |
183 | + ' | |
184 | + Me.Button13.Location = New System.Drawing.Point(924, 374) | |
185 | + Me.Button13.Margin = New System.Windows.Forms.Padding(4) | |
186 | + Me.Button13.Name = "Button13" | |
187 | + Me.Button13.Size = New System.Drawing.Size(115, 86) | |
188 | + Me.Button13.TabIndex = 24 | |
189 | + Me.Button13.Text = "Fore 2020" | |
190 | + Me.Button13.UseVisualStyleBackColor = True | |
191 | + ' | |
148 | 192 | 'AutoEpub7 |
149 | 193 | ' |
150 | 194 | Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 15.0!) |
151 | 195 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font |
152 | 196 | Me.ClientSize = New System.Drawing.Size(1084, 562) |
197 | + Me.Controls.Add(Me.Button13) | |
198 | + Me.Controls.Add(Me.Button12) | |
199 | + Me.Controls.Add(Me.Button11) | |
200 | + Me.Controls.Add(Me.Button10) | |
153 | 201 | Me.Controls.Add(Me.btnReName) |
154 | 202 | Me.Controls.Add(Me.Button9) |
155 | 203 | Me.Controls.Add(Me.Button8) |
@@ -161,7 +209,7 @@ | ||
161 | 209 | Me.Controls.Add(Me.Button2) |
162 | 210 | Me.Controls.Add(Me.Button1) |
163 | 211 | Me.Controls.Add(Me.btnNCXDep2) |
164 | - Me.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) | |
212 | + Me.Margin = New System.Windows.Forms.Padding(4) | |
165 | 213 | Me.Name = "AutoEpub7" |
166 | 214 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen |
167 | 215 | Me.Text = "AutoEpub7" |
@@ -180,4 +228,8 @@ | ||
180 | 228 | Friend WithEvents Button8 As Button |
181 | 229 | Friend WithEvents Button9 As Button |
182 | 230 | Friend WithEvents btnReName As Button |
231 | + Friend WithEvents Button10 As Button | |
232 | + Friend WithEvents Button11 As Button | |
233 | + Friend WithEvents Button12 As Button | |
234 | + Friend WithEvents Button13 As Button | |
183 | 235 | End Class |
@@ -1,5 +1,7 @@ | ||
1 | 1 | |
2 | 2 | |
3 | +Imports System.IO | |
4 | +Imports Newtonsoft.Json | |
3 | 5 | Imports ExcelApplication = Microsoft.Office.Interop.Excel.Application |
4 | 6 | |
5 | 7 |
@@ -714,7 +716,7 @@ | ||
714 | 716 | |
715 | 717 | Try |
716 | 718 | |
717 | - Dim ncxFilePath As String = "C:\Users\DTC_PC07\Downloads\NZ\" | |
719 | + Dim ncxFilePath As String = "C:\Users\DTC_PC07\Downloads\JL\" | |
718 | 720 | |
719 | 721 | Dim fs As System.IO.FileStream = New System.IO.FileStream(ncxFilePath & "toc.ncx", System.IO.FileMode.Open) |
720 | 722 | Dim serializer As System.Xml.Serialization.XmlSerializer = New System.Xml.Serialization.XmlSerializer(GetType(ncx)) |
@@ -765,15 +767,7 @@ | ||
765 | 767 | mChapter.Scr = fileChapter.content.src |
766 | 768 | mChapter.Scr = mChapter.Scr.Split("#")(0) |
767 | 769 | |
768 | - If mChapter.Title.IndexOf("王六郎") = -1 Then | |
769 | - Continue For | |
770 | - End If | |
771 | 770 | |
772 | - | |
773 | - | |
774 | - 'Dim sKey As Integer = cTools.listNav_SE(mChapter.Scr, "part", ".html", False)(0) + 1 | |
775 | - 'mChapter.Scr = "text/part" & sKey.ToString().PadLeft(4, "0") & ".html" | |
776 | - | |
777 | 771 | Dim sChapter As String = cTools.sFileReader(ncxFilePath & mChapter.Scr, cEpub6.encUTF8) |
778 | 772 | |
779 | 773 |
@@ -1277,5 +1271,283 @@ | ||
1277 | 1271 | |
1278 | 1272 | End Sub |
1279 | 1273 | |
1274 | + Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click | |
1280 | 1275 | |
1276 | + Dim sJson As String = cTools.sFileReader("D:\Soft\Json\Edit\B1.txt", cEpub6.encShift_JIS) | |
1277 | + Dim mEpub As List(Of modelVolume) = JsonConvert.DeserializeObject(sJson, GetType(List(Of modelVolume))) | |
1278 | + | |
1279 | + For iCtrVolume As Integer = 5 To mEpub.Count - 1 | |
1280 | + | |
1281 | + Dim emVolume As modelVolume = mEpub(iCtrVolume) | |
1282 | + | |
1283 | + For iCtrChapter As Integer = 0 To emVolume.listChapter.Count - 1 | |
1284 | + | |
1285 | + Dim emChapter As modelChapter = emVolume.listChapter(iCtrChapter) | |
1286 | + | |
1287 | + | |
1288 | + For iCtrLine As Integer = 0 To emChapter.listText.Count - 1 | |
1289 | + Dim listEditSp As List(Of String) = cTools.listNav_SE(emChapter.listText(iCtrLine), "<a id", "</sup></a>", True) | |
1290 | + | |
1291 | + For Each editLine As String In listEditSp | |
1292 | + | |
1293 | + Dim sKey1 As String = cTools.listNav_SE(editLine, "id=""", """><", False)(0) | |
1294 | + Dim sKey2 As String = cTools.listNav_SE(editLine, "href=""", """><", False)(0) | |
1295 | + Dim sKey3 As String = cTools.listNav_SE(editLine, "e7"">", "</sup>", False)(0) | |
1296 | + | |
1297 | + Dim sKeyReal As String = "<a id=""" & sKey1 & """ href=""" & sKey2 & """><sup class=""calibre7"">" & sKey3 & "</sup></a>" | |
1298 | + | |
1299 | + mEpub(iCtrVolume).listChapter(iCtrChapter).listText(iCtrLine) = mEpub(iCtrVolume).listChapter(iCtrChapter).listText(iCtrLine).Replace(editLine, sKeyReal) | |
1300 | + | |
1301 | + Next | |
1302 | + | |
1303 | + | |
1304 | + Next | |
1305 | + | |
1306 | + | |
1307 | + | |
1308 | + | |
1309 | + Next | |
1310 | + | |
1311 | + | |
1312 | + Next | |
1313 | + | |
1314 | + | |
1315 | + | |
1316 | + | |
1317 | + Dim mEpub5 As New List(Of modelVolume) | |
1318 | + mEpub5.Add(mEpub(5)) | |
1319 | + | |
1320 | + | |
1321 | + Dim cEpub As New cEpub6(emEpub6.emEncCode.GB2321, emEpub6.emLan.ZH, "聊斋志异详注新评222", "蒲松龄", "H_NZ_202004") | |
1322 | + cEpub.bConvertToMobi = True | |
1323 | + cEpub.CreateEpub(mEpub5) | |
1324 | + MessageBox.Show("Finished") | |
1325 | + System.Diagnostics.Process.Start(cEpub.sOutPutPathFolder) | |
1326 | + | |
1327 | + | |
1328 | + | |
1329 | + | |
1330 | + End Sub | |
1331 | + | |
1332 | + Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click | |
1333 | + | |
1334 | + Dim sHtml As String = cTools.sFileReader("C:\Users\DTC_PC07\Downloads\WW1.txt", cEpub6.encGB2321) | |
1335 | + | |
1336 | + sHtml = sHtml.Replace("*******", "") | |
1337 | + sHtml = sHtml.Replace("******", "") | |
1338 | + | |
1339 | + sHtml = sHtml.Replace(" ", " ") | |
1340 | + | |
1341 | + | |
1342 | + | |
1343 | + | |
1344 | + Dim listChapter As List(Of String) = sHtml.Split({vbCrLf & vbCrLf}, StringSplitOptions.None).ToList | |
1345 | + | |
1346 | + listChapter.RemoveAt(0) | |
1347 | + | |
1348 | + Dim mEpub As New List(Of modelChapter) | |
1349 | + | |
1350 | + | |
1351 | + For Each sChpater As String In listChapter | |
1352 | + | |
1353 | + Dim listLine As List(Of String) = sChpater.Split({vbCrLf}, StringSplitOptions.None).ToList | |
1354 | + | |
1355 | + Dim uChpater As New modelChapter | |
1356 | + | |
1357 | + Dim sKe As List(Of String) = listLine(1).Split(" ").ToList | |
1358 | + sKe.RemoveAt(1) | |
1359 | + | |
1360 | + | |
1361 | + uChpater.Title = String.Join(" ", sKe) | |
1362 | + | |
1363 | + listLine.RemoveRange(0, 2) | |
1364 | + | |
1365 | + uChpater.listText = listLine | |
1366 | + mEpub.Add(uChpater) | |
1367 | + | |
1368 | + | |
1369 | + Next | |
1370 | + | |
1371 | + Dim cEpub As New cEpub6(emEpub6.emEncCode.GB2321, emEpub6.emLan.ZH, "乌衣巷", "闫灵", "WYX_202004") | |
1372 | + cEpub.bConvertToMobi = True | |
1373 | + cEpub.CreateEpub(mEpub) | |
1374 | + MessageBox.Show("Finished") | |
1375 | + System.Diagnostics.Process.Start(cEpub.sOutPutPathFolder) | |
1376 | + | |
1377 | + End Sub | |
1378 | + | |
1379 | + Private Sub Button12_Click(sender As Object, e As EventArgs) Handles Button12.Click | |
1380 | + | |
1381 | + Dim sText As String = String.Empty | |
1382 | + Dim listLine As New List(Of String) | |
1383 | + Dim listSkip As New List(Of String) | |
1384 | + | |
1385 | + | |
1386 | + | |
1387 | + Dim bookPath As String = "C:\Users\DTC_PC07\Downloads\JL\" | |
1388 | + Dim ncxFilePath As String = Path.Combine(bookPath, "toc.ncx") | |
1389 | + | |
1390 | + Dim fs As System.IO.FileStream = New System.IO.FileStream(ncxFilePath, System.IO.FileMode.Open) | |
1391 | + Dim serializer As System.Xml.Serialization.XmlSerializer = New System.Xml.Serialization.XmlSerializer(GetType(ncx)) | |
1392 | + Dim model As ncx = CType(serializer.Deserialize(fs), ncx) | |
1393 | + | |
1394 | + Dim mEpub As New List(Of modelVolume) | |
1395 | + | |
1396 | + For iCtr As Integer = 0 To 0 | |
1397 | + Dim unitOne As ncxNavPoint = model.navMap(iCtr) | |
1398 | + Dim unitVolume As New modelVolume | |
1399 | + unitVolume.Title = unitOne.navLabel.text | |
1400 | + | |
1401 | + If unitOne.navPoint Is Nothing Then | |
1402 | + | |
1403 | + Dim sHtml As String = cTools.sFileReader(bookPath & unitOne.content.src, cEpub6.encUTF8) | |
1404 | + | |
1405 | + Else | |
1406 | + | |
1407 | + For Each eachNax As ncxNavPointNavPoint In unitOne.navPoint | |
1408 | + | |
1409 | + Dim sPath As String = (bookPath & eachNax.content.src).Split("#").ToList(0) | |
1410 | + | |
1411 | + Dim mChapter As New modelChapter | |
1412 | + mChapter.Title = eachNax.navLabel.text | |
1413 | + Dim sHtml As String = cTools.sFileReader(sPath, cEpub6.encUTF8) | |
1414 | + | |
1415 | + Dim listChapterLine As List(Of String) = cTools.listText_P(sHtml) | |
1416 | + mChapter.listText = listChapterLine | |
1417 | + | |
1418 | + If mChapter.Title.IndexOf("感言") > -1 Then | |
1419 | + Continue For | |
1420 | + End If | |
1421 | + | |
1422 | + If mChapter.Title.IndexOf("版权信息") > -1 Then | |
1423 | + unitVolume.Title = listChapterLine(0).Split("·")(1) | |
1424 | + | |
1425 | + Else | |
1426 | + unitVolume.listChapter.Add(mChapter) | |
1427 | + End If | |
1428 | + | |
1429 | + | |
1430 | + Next | |
1431 | + | |
1432 | + End If | |
1433 | + | |
1434 | + mEpub.Add(unitVolume) | |
1435 | + | |
1436 | + Next | |
1437 | + | |
1438 | + | |
1439 | + Dim cEpub As New cEpub6(emEpub6.emEncCode.SHIFT_JIS, emEpub6.emLan.ZH, "剑来", "烽火戏诸侯", "JL_202005") | |
1440 | + cEpub.bConvertToMobi = True | |
1441 | + | |
1442 | + cEpub.CreateEpub(mEpub) | |
1443 | + MessageBox.Show("Finished") | |
1444 | + | |
1445 | + | |
1446 | + End Sub | |
1447 | + | |
1448 | + Private Sub Button13_Click(sender As Object, e As EventArgs) Handles Button13.Click | |
1449 | + Dim bookPath As String = "C:\Users\DTC_PC07\Downloads\sdmMM\" | |
1450 | + Dim ncxFilePath As String = Path.Combine(bookPath, "toc.ncx") | |
1451 | + | |
1452 | + Dim fs As System.IO.FileStream = New System.IO.FileStream(ncxFilePath, System.IO.FileMode.Open) | |
1453 | + Dim serializer As System.Xml.Serialization.XmlSerializer = New System.Xml.Serialization.XmlSerializer(GetType(ncx)) | |
1454 | + Dim model As ncx = CType(serializer.Deserialize(fs), ncx) | |
1455 | + | |
1456 | + Dim mEpub As New List(Of modelChapter) | |
1457 | + | |
1458 | + For iCtr As Integer = 1 To 2 | |
1459 | + Dim unitOne As ncxNavPoint = model.navMap(iCtr) | |
1460 | + | |
1461 | + | |
1462 | + If unitOne.navPoint Is Nothing Then | |
1463 | + | |
1464 | + Dim sHtml As String = cTools.sFileReader(bookPath & unitOne.content.src, cEpub6.encUTF8) | |
1465 | + | |
1466 | + Else | |
1467 | + | |
1468 | + For Each eachNax As ncxNavPointNavPoint In unitOne.navPoint | |
1469 | + | |
1470 | + Dim sPath As String = (bookPath & eachNax.content.src).Split("#").ToList(0) | |
1471 | + | |
1472 | + Dim mChapter As New modelChapter | |
1473 | + | |
1474 | + mChapter.Title = eachNax.navLabel.text | |
1475 | + Dim sHtml As String = cTools.sFileReader(sPath, cEpub6.encUTF8) | |
1476 | + | |
1477 | + If sHtml.IndexOf("h1") > -1 Then | |
1478 | + Dim sTitle As String = cTools.listNav_SE(sHtml, "<h1", "</h1>", True)(0) | |
1479 | + If sTitle.IndexOf("href") > -1 Then | |
1480 | + Dim listHref As List(Of String) = cTools.listNav_SE(sTitle, "href=""", """>", True) | |
1481 | + For Each eachHref As String In listHref | |
1482 | + Dim sKey As String = eachHref.Split("#")(1).Replace(""">", "") | |
1483 | + sTitle = sTitle.Replace(eachHref, "href=""#" & sKey & """>") | |
1484 | + Next | |
1485 | + mChapter.TitleSP = mChapter.Title & "<a" & cTools.listNav_SE(sTitle, "<a", "</h1>", False)(0) | |
1486 | + End If | |
1487 | + End If | |
1488 | + | |
1489 | + | |
1490 | + | |
1491 | + | |
1492 | + | |
1493 | + Dim listHref_Titl As List(Of String) = cTools.listNav_SE(sHtml, "<a href", """>", True).Where(Function(x) x.IndexOf("#") > -1).ToList() | |
1494 | + | |
1495 | + | |
1496 | + For Each uHref As String In listHref_Titl | |
1497 | + | |
1498 | + Dim sKeyHref As String = uHref.Split("#")(1).Split("""")(0) | |
1499 | + | |
1500 | + sHtml = sHtml.Replace(uHref, "<a href=""#" & sKeyHref & """>") | |
1501 | + | |
1502 | + Next | |
1503 | + | |
1504 | + | |
1505 | + | |
1506 | + | |
1507 | + | |
1508 | + | |
1509 | + | |
1510 | + Dim listImg As List(Of String) = cTools.listNav_SE(sHtml, "<img", "/>", True) | |
1511 | + | |
1512 | + For Each uImg As String In listImg | |
1513 | + Dim sImgUrl As String = cTools.listNav_SE(uImg, "src=""", """/>", False)(0) | |
1514 | + If uImg.IndexOf("alone") > -1 Then | |
1515 | + Dim sImgKey As String = cTools.sMapImg(sImgUrl, emEpub6.emUrlImgDep.Chapter) | |
1516 | + sHtml = sHtml.Replace(uImg, sImgKey) | |
1517 | + Else | |
1518 | + Dim sImgKey As String = cTools.sGaiji(sImgUrl, emEpub6.emUrlImgDep.Chapter) | |
1519 | + sHtml = sHtml.Replace(uImg, sImgKey) | |
1520 | + End If | |
1521 | + Next | |
1522 | + | |
1523 | + | |
1524 | + | |
1525 | + | |
1526 | + Dim listChapterLine As List(Of String) = cTools.listText_P(sHtml) | |
1527 | + mChapter.listText = listChapterLine | |
1528 | + | |
1529 | + mEpub.Add(mChapter) | |
1530 | + | |
1531 | + | |
1532 | + Next | |
1533 | + | |
1534 | + End If | |
1535 | + | |
1536 | + | |
1537 | + | |
1538 | + Next | |
1539 | + | |
1540 | + | |
1541 | + Dim cEpub As New cEpub6(emEpub6.emEncCode.SHIFT_JIS, emEpub6.emLan.ZH, "红楼梦", "曹雪芹", "SDMZ_HLM_202005") | |
1542 | + cEpub.bConvertToMobi = False | |
1543 | + | |
1544 | + cEpub.CreateEpub(mEpub) | |
1545 | + MessageBox.Show("Finished") | |
1546 | + System.Diagnostics.Process.Start(cEpub.sOutPutPathFolder) | |
1547 | + | |
1548 | + | |
1549 | + | |
1550 | + End Sub | |
1551 | + | |
1552 | + | |
1281 | 1553 | End Class |
\ No newline at end of file |
@@ -213,6 +213,21 @@ | ||
213 | 213 | width: 1em; |
214 | 214 | padding-bottom :5px; |
215 | 215 | } |
216 | + | |
217 | +.mobiImgChar_inline { | |
218 | + height: 1em; | |
219 | + margin-bottom: -0.1em; | |
220 | + width: auto | |
221 | +} | |
222 | + | |
223 | +.mobiImgChar_inline1 { | |
224 | + height: 1em; | |
225 | + line-height: 1.2; | |
226 | + margin-bottom: -0.1em; | |
227 | + width: auto | |
228 | +} | |
229 | + | |
230 | + | |
216 | 231 | span.notes {font-size: smaller} |
217 | 232 | img.gaiji { width: 1em; height: 1em; align: top; } |
218 | 233 |
@@ -1196,7 +1196,7 @@ | ||
1196 | 1196 | sScr = "../" & sScr |
1197 | 1197 | End If |
1198 | 1198 | |
1199 | - sGaiji = "<img class=""mobiImgChar_Bottom_5px"" alt="""" src=""" & sScr & """/>" | |
1199 | + sGaiji = "<img class=""mobiImgChar_inline"" alt="""" src=""" & sScr & """/>" | |
1200 | 1200 | |
1201 | 1201 | End Function |
1202 | 1202 |