Skip to content

Commit

Permalink
Merge pull request #662 from bcgov/dev-DV-4859
Browse files Browse the repository at this point in the history
document comments fixes and package upgrades
  • Loading branch information
divyav-aot authored Dec 18, 2023
2 parents 0cf9a0e + 0e1c56e commit 34057bb
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageReference Include="SkiaSharp" Version="2.88.6" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.88.6" />
<PackageReference Include="Syncfusion.HtmlToPdfConverter.QtWebKit.Net.Core" Version="19.1.0.63" />
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="23.1.40" />
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="23.2.7" />
</ItemGroup>

</Project>
38 changes: 9 additions & 29 deletions MCS.FOI.S3FileConversion/MCS.FOI.DocToPDF/DocFileProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,42 +43,22 @@ public DocFileProcessor(Stream SourceStream)
{
using (WordDocument wordDocument = new WordDocument(SourceStream, Syncfusion.DocIO.FormatType.Automatic))
{

wordDocument.RevisionOptions.CommentDisplayMode = CommentDisplayMode.ShowInBalloons;
wordDocument.RevisionOptions.CommentColor = RevisionColor.Blue;

foreach(var entity in wordDocument.ChildEntities)

using (DocIORenderer renderer = new DocIORenderer())
{
if(entity.GetType().FullName == "Syncfusion.DocIO.DLS.WSection")
{
Syncfusion.DocIO.DLS.WSection _wsection = (Syncfusion.DocIO.DLS.WSection)entity;

foreach (IWTable table in _wsection.Tables)
{
table.TableFormat.IsAutoResized = false;
table.TableFormat.WrapTextAround = true;
}

}
using PdfDocument pdfDocument = renderer.ConvertToPDF(wordDocument);
//Save the PDF file
//Close the instance of document objects
pdfDocument.Save(output);
pdfDocument.Close(true);
converted = true;

}

using (Stream wordstream = new MemoryStream())
{
wordDocument.Save(wordstream, wordDocument.ActualFormatType);

//Creates an instance of DocIORenderer.
using (DocIORenderer renderer = new DocIORenderer())
{

using PdfDocument pdfDocument = renderer.ConvertToPDF(wordstream);
//Save the PDF file
//Close the instance of document objects
pdfDocument.Save(output);
pdfDocument.Close(true);
converted = true;

}
}
}
}
catch (Exception e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.DocIO.Net.Core" Version="23.1.40" />
<PackageReference Include="Syncfusion.DocIO.Net.Core" Version="23.2.7" />
<PackageReference Include="SkiaSharp" Version="2.88.6" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.88.6" />

<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="3.0.1" />
<!--<PackageReference Include="System.Drawing.Common" Version="5.0.2" />-->
<PackageReference Include="Syncfusion.DocIORenderer.Net.Core" Version="23.1.40" />
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="23.1.40" />
<PackageReference Include="Syncfusion.DocIORenderer.Net.Core" Version="23.2.7" />
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="23.2.7" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Syncfusion.XlsIO.Net.Core" Version="23.1.40" />
<PackageReference Include="Syncfusion.XlsIORenderer.Net.Core" Version="23.1.40" />
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="23.1.40" />
<PackageReference Include="Syncfusion.XlsIO.Net.Core" Version="23.2.7" />
<PackageReference Include="Syncfusion.XlsIORenderer.Net.Core" Version="23.2.7" />
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="23.2.7" />
<PackageReference Include="SkiaSharp" Version="2.88.6" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.88.6" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.88.3" />
<PackageReference Include="MsgReader" Version="4.5.0" />
<PackageReference Include="Syncfusion.HtmlToPdfConverter.QtWebKit.Net.Core" Version="20.3.0.56" />
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="21.2.9" />
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="23.2.7" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="5.0.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageReference Include="HarfBuzzSharp.NativeAssets.Linux" Version="2.8.2.3" />
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.88.6" />
<PackageReference Include="Syncfusion.PresentationRenderer.Net.Core" Version="23.1.40" />
<PackageReference Include="Syncfusion.PresentationRenderer.Net.Core" Version="23.2.7" />
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Npgsql" Version="7.0.0" />
<PackageReference Include="StackExchange.Redis" Version="2.6.70" />
<PackageReference Include="Syncfusion.HtmlToPdfConverter.Net.Linux" Version="21.2.9" />
<PackageReference Include="Syncfusion.HtmlToPdfConverter.Net.Windows" Version="21.2.9" />
<PackageReference Include="Syncfusion.HtmlToPdfConverter.Net.Linux" Version="23.2.7" />
<PackageReference Include="Syncfusion.HtmlToPdfConverter.Net.Windows" Version="23.2.7" />
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="3.0.1" />
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="23.1.40" />
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="23.2.7" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 34057bb

Please sign in to comment.