Browse Source

Fix problems

pull/22430/head
liangshiwei 1 year ago
parent
commit
e27b48c542
  1. 20
      modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/DocsProjectPdfGeneratorOptions.cs
  2. 8
      modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs

20
modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/DocsProjectPdfGeneratorOptions.cs

@ -62,16 +62,18 @@ public class DocsProjectPdfGeneratorOptions
</html>";
HtmlStyle = @"
body { margin: 20px; line-height: 1.6; font-family: Arial, sans-serif;}
a { text-decoration: none; }
body { margin: 15px; line-height: 1.5; font-family: Arial, sans-serif;}
a { text-decoration: none; word-break: break-all; overflow-wrap: break-word;}
li { word-break: break-all; overflow-wrap: break-word; }
.page {
page-break-after: always;
margin-bottom: 30px;
padding: 15px;
}
img {
max-width:100%;
height: auto;
max-width: 100%;
max-height: 850px;
object-fit: contain;
display: block;
}
code, pre {
@ -97,6 +99,16 @@ public class DocsProjectPdfGeneratorOptions
margin: 20px 0;
padding: 10px 20px;
background: #f8fafc;
}
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
table img { width: 100% !important; height: auto; display: block; }
th { font-weight: bold; background-color: #f5f5f5; }
th, td {
border: 1px solid #333;
padding: 6px 10px;
word-break: break-all;
overflow-wrap: break-word;
width: 100%;
}";
CalculatePdfFileName = (project, version, languageCode) => $"{project.ShortName}-{version}-{languageCode}.pdf";

8
modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Pdf/ProjectPdfGenerator.cs

@ -184,11 +184,11 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency
if (parentPdfDocument == null)
{
AllPdfDocuments.Add(pdfDocument);
AllPdfDocuments.AddIfNotContains(pdfDocument);
}
else
{
parentPdfDocument.Children.Add(pdfDocument);
parentPdfDocument.Children.AddIfNotContains(pdfDocument);
}
if (navigation.HasChildItems)
@ -214,11 +214,11 @@ public class ProjectPdfGenerator : IProjectPdfGenerator, ITransientDependency
{
if (parentPdfDocument == null)
{
AllPdfDocuments.AddRange(combinations.Value);
AllPdfDocuments.AddIfNotContains(combinations.Value);
}
else
{
parentPdfDocument.Children.AddRange(combinations.Value);
parentPdfDocument.Children.AddIfNotContains(combinations.Value);
}
}
}

Loading…
Cancel
Save