Skip to content

Commit 692396a

Browse files
Add support for itext8 and .NET (#828)
* Add support for itext8 and .NET * HTML and Image rendering fixes * Resolve merge with master and PDFA implementation. * Fixed text wrapping * Fixed justification error and code cleanup * Code cleanup * Register font provider for HTML elements. Rename PDFReportItext7 to PDFReportItext8 * Remove unused fontProvider parameter. * Set fontProvider for document. Reorder ProcessHTMLElement conditions. * Removed manual right alignment of list block element * Avoid unnecessary casts. * Some of the <div> elements generated by HtmlConverter.ConvertToElements do not contain any child elements; instead, they solely contain formatting properties (e.g., <h1>, horizontal rule <hr>). Rendering these <div> elements results in a format closer to the original HTML. However, these changes mean that if a <div> extends beyond the available drawing area, it won't be displayed. This was the previous behavior. * Remove unused using. * Remove unused usings. * Improve HTML rendering. Break page for long HTMLs. * Add new test case for SAC# 47946 * The iText dependency needs to be added to DependencyContext.Default so that iText can locate resources like iText.IO.Font.Cmap.cjk_registry.properties when searching within DependencyContext.Default.GetRuntimeAssemblyNames(runtimeIdentifier). --------- Co-authored-by: tomas-sexenian <tsexenian@genexus.com>
1 parent 4310766 commit 692396a

File tree

21 files changed

+4477
-1641
lines changed

21 files changed

+4477
-1641
lines changed

dotnet/DotNetStandardClasses.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GXAzureEventGrid", "src\dot
249249
EndProject
250250
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetCoreAttackMitigationTest", "test\DotNetCoreAttackMitigationTest\DotNetCoreAttackMitigationTest.csproj", "{2D615969-53E2-4B77-9A9A-75C33865CF76}"
251251
EndProject
252+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetPDFUnitTest", "test\DotNetPdfTest\DotNetPDFUnitTest.csproj", "{0FCFB078-5584-469F-92CC-61B0A6216D0D}"
253+
EndProject
252254
Global
253255
GlobalSection(SolutionConfigurationPlatforms) = preSolution
254256
Debug|Any CPU = Debug|Any CPU
@@ -603,6 +605,10 @@ Global
603605
{2D615969-53E2-4B77-9A9A-75C33865CF76}.Debug|Any CPU.Build.0 = Debug|Any CPU
604606
{2D615969-53E2-4B77-9A9A-75C33865CF76}.Release|Any CPU.ActiveCfg = Release|Any CPU
605607
{2D615969-53E2-4B77-9A9A-75C33865CF76}.Release|Any CPU.Build.0 = Release|Any CPU
608+
{0FCFB078-5584-469F-92CC-61B0A6216D0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
609+
{0FCFB078-5584-469F-92CC-61B0A6216D0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
610+
{0FCFB078-5584-469F-92CC-61B0A6216D0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
611+
{0FCFB078-5584-469F-92CC-61B0A6216D0D}.Release|Any CPU.Build.0 = Release|Any CPU
606612
EndGlobalSection
607613
GlobalSection(SolutionProperties) = preSolution
608614
HideSolutionNode = FALSE
@@ -722,6 +728,7 @@ Global
722728
{5BBC75F0-E51A-4EBD-A628-92498D319B1D} = {4C43F2DA-59E5-46F5-B691-195449498555}
723729
{7250CDB1-95C4-4822-B01B-3CBD73324CC9} = {30159B0F-BE61-4DB7-AC02-02851426BE4B}
724730
{2D615969-53E2-4B77-9A9A-75C33865CF76} = {1D6F1776-FF4B-46C2-9B3D-BC46CCF049DC}
731+
{0FCFB078-5584-469F-92CC-61B0A6216D0D} = {1D6F1776-FF4B-46C2-9B3D-BC46CCF049DC}
725732
EndGlobalSection
726733
GlobalSection(ExtensibilityGlobals) = postSolution
727734
SolutionGuid = {E18684C9-7D76-45CD-BF24-E3944B7F174C}

dotnet/src/dotnetcore/GxNetCoreStartup/GxNetCoreStartup.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
<PackageReference Include="Azure.Monitor.OpenTelemetry.Exporter" Version="1.0.0-beta.13" NoWarn="NU5104" PrivateAssets ="All"/>
2323
<PackageReference Include="OpenTelemetry" Version="1.5.1" PrivateAssets ="All"/>
2424
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.5.1" PrivateAssets ="All"/>
25+
26+
<PackageReference Include="itext7" Version="8.0.0" PrivateAssets="All" />
27+
<PackageReference Include="itext7.font-asian" Version="8.0.0" PrivateAssets="All" />
28+
<PackageReference Include="itext7.pdfhtml" Version="5.0.0" PrivateAssets="All"/>
29+
2530
</ItemGroup>
2631
<ItemGroup>
2732
<ProjectReference Include="..\GxClasses.Web\GxClasses.Web.csproj" />

dotnet/src/dotnetcore/GxPdfReportsCS/GlobalSuppressions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@
1616
[assembly: SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "<Pending>", Scope = "member", Target = "~M:com.genexus.reports.NativeSharpFunctionsMS.getRegistrySubValues(System.String,System.String)~System.Collections.ArrayList")]
1717
[assembly: SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "<Pending>", Scope = "member", Target = "~M:com.genexus.reports.NativeSharpFunctionsMS.ReadRegKey(System.String)~System.String")]
1818
[assembly: SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "<Pending>", Scope = "member", Target = "~M:com.genexus.reports.MSPDFFontDescriptor.getTrueTypeFontLocation(System.String)~System.String")]
19+
[assembly: SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "<Pending>", Scope = "member", Target = "~M:com.genexus.reports.PDFReportItextBase.getAcrobatLocation~System.String")]
20+
[assembly: SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "<Pending>", Scope = "member", Target = "~M:com.genexus.reports.PDFReportItextBase.loadSubstituteTable")]

dotnet/src/dotnetcore/GxPdfReportsCS/GxPdfReportsCS.csproj

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,19 @@
99

1010
<ItemGroup>
1111
<Compile Include="..\..\dotnetframework\GxPdfReportsCS\PdfReportInterface.cs" Link="PdfReportInterface.cs" />
12-
<Compile Include="..\..\dotnetframework\GxPdfReportsCS\PDFReportItext.cs" Link="PDFReportItext.cs" />
12+
<Compile Include="..\..\dotnetframework\GxPdfReportsCS\PDFReportCommon.cs" Link="PDFReportCommon.cs" />
13+
<Compile Include="..\..\dotnetframework\GxPdfReportsCS\PDFReportItext4.cs" Link="PDFReportItext4.cs" />
1314
</ItemGroup>
14-
1515
<ItemGroup>
1616
<EmbeddedResource Include="..\..\dotnetframework\GxPdfReportsCS\sRGB Color Space Profile.icm" Link="sRGB Color Space Profile.icm" />
1717
</ItemGroup>
1818

1919
<ItemGroup>
20-
<PackageReference Include="iTextSharp-LGPL" Version="4.1.6" />
20+
<PackageReference Include="itext7" Version="8.0.0" PrivateAssets="All" />
21+
<PackageReference Include="itext7.font-asian" Version="8.0.0" PrivateAssets="All" />
22+
<PackageReference Include="itext7.pdfhtml" Version="5.0.0" PrivateAssets="All"/>
23+
24+
<PackageReference Include="iTextSharp-LGPL" Version="4.1.6" PrivateAssets="All" />
2125
<PackageReference Include="log4net" Version="2.0.15" />
2226
<PackageReference Include="Microsoft.DotNet.Analyzers.Compatibility" Version="0.2.12-alpha">
2327
<PrivateAssets>all</PrivateAssets>

0 commit comments

Comments
 (0)