Skip to content

Commit 1b25a97

Browse files
committed
GroupDocs.Conversion for .NET 24.10 samples update
1 parent 483072d commit 1b25a97

File tree

439 files changed

+498
-501
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

439 files changed

+498
-501
lines changed

Examples/GroupDocs.Conversion.Examples.CSharp.Core/GroupDocs.Conversion.Examples.CSharp.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<PackageReference Include="AWSSDK.Core" Version="3.7.400.26" />
1818
<PackageReference Include="AWSSDK.S3" Version="3.7.403.5" />
1919
<PackageReference Include="Azure.Storage.Blobs" Version="12.22.1" />
20-
<PackageReference Include="GroupDocs.Conversion.CrossPlatform" Version="24.9.0" />
20+
<PackageReference Include="GroupDocs.Conversion.CrossPlatform" Version="24.10.0" />
2121
<PackageReference Include="StackExchange.Redis" Version="2.8.16" />
2222
</ItemGroup>
2323

Examples/GroupDocs.Conversion.Examples.CSharp.Framework/GroupDocs.Conversion.Examples.CSharp.Framework.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
<Version>12.21.2</Version>
7070
</PackageReference>
7171
<PackageReference Include="GroupDocs.Conversion">
72-
<Version>24.9.0</Version>
72+
<Version>24.10.0</Version>
7373
</PackageReference>
7474
<PackageReference Include="StackExchange.Redis">
7575
<Version>2.8.0</Version>

Examples/GroupDocs.Conversion.Examples.CSharp/AdvancedUsage/Converting/Common/ConvertToStream.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ public static void Run()
1919
using (Converter converter = new Converter(Constants.SAMPLE_DOCX))
2020
{
2121
var convertOptions = new PdfConvertOptions();
22-
converter.Convert(() => new MemoryStream(), (sourceFileName, convertedFileType, convertedStream) =>
22+
converter.Convert(convertOptions, (ConvertedContext convertedContext) =>
2323
{
24-
convertedStream.CopyTo(outputStream);
25-
} ,convertOptions);
24+
convertedContext.ConvertedStream.CopyTo(outputStream);
25+
});
2626
}
2727
}
2828

Examples/GroupDocs.Conversion.Examples.CSharp/AdvancedUsage/Converting/ConvertCsvToJson.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static void Run()
2121
Separator = ','
2222
};
2323

24-
using (Converter converter = new Converter(Constants.SAMPLE_CSV, ()=> loadOptions))
24+
using (Converter converter = new Converter(Constants.SAMPLE_CSV, (LoadContext loadContext)=> loadOptions))
2525
{
2626
WebConvertOptions options = new WebConvertOptions
2727
{

Examples/GroupDocs.Conversion.Examples.CSharp/AdvancedUsage/Converting/ConvertEachEmailAttachmentToDifferentFormat.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ public static void Run()
1717

1818
var index = 1;
1919

20-
LoadOptions LoadOptionsProvider(FileType sourceType)
20+
LoadOptions LoadOptionsProvider(LoadContext loadContext)
2121
{
22-
if (sourceType == EmailFileType.Eml)
22+
if (loadContext.SourceFormat == EmailFileType.Eml)
2323
{
2424
return new EmailLoadOptions
2525
{
@@ -32,20 +32,21 @@ LoadOptions LoadOptionsProvider(FileType sourceType)
3232
return null;
3333
}
3434

35-
Stream ConvertedStreamProvider(FileType targetType)
35+
Stream ConvertedStreamProvider(SaveContext saveContext)
3636
{
37-
string outputFile = Path.Combine(outputFolder, $"converted-{index++}.{targetType.Extension}");
37+
string outputFile = Path.Combine(outputFolder, $"converted-{index++}.{saveContext.TargetFormat.Extension}");
38+
3839
return new FileStream(outputFile, FileMode.Create);
3940
}
4041

41-
ConvertOptions ConvertOptionsProvider(string sourceDocumentName, FileType sourceType)
42+
ConvertOptions ConvertOptionsProvider(ConvertContext convertContext)
4243
{
43-
if (sourceType == EmailFileType.Eml)
44+
if (convertContext.SourceFormat == EmailFileType.Eml)
4445
{
4546
return new WordProcessingConvertOptions();
4647
}
4748

48-
if (sourceType == WordProcessingFileType.Txt)
49+
if (convertContext.SourceFormat == WordProcessingFileType.Txt)
4950
{
5051
return new PdfConvertOptions();
5152
}

Examples/GroupDocs.Conversion.Examples.CSharp/AdvancedUsage/Converting/ConvertFromRarToPdfAndCompress.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static void Run()
1515
string outputFolder = Constants.GetOutputDirectoryPath();
1616

1717
FluentConverter.Load(Constants.SAMPLE_RAR)
18-
.ConvertTo(p => new MemoryStream()).WithOptions(new PdfConvertOptions())
18+
.ConvertTo((SaveContext p) => new MemoryStream()).WithOptions(new PdfConvertOptions())
1919
.Compress(new CompressionConvertOptions { Format = CompressionFileType.Zip }).OnCompressionCompleted(
2020
compressedStream =>
2121
{

Examples/GroupDocs.Conversion.Examples.CSharp/AdvancedUsage/Converting/ConvertImageUsingOcr.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static void Run()
2323
var imageLoadOptions = new RasterImageLoadOptions();
2424
imageLoadOptions.SetOcrConnector(new OcrConnector());
2525

26-
using (Converter converter = new Converter(Constants.SAMPLE_JPEG, () => imageLoadOptions))
26+
using (Converter converter = new Converter(Constants.SAMPLE_JPEG, (LoadContext loadContext) => imageLoadOptions))
2727
{
2828
PdfConvertOptions options = new PdfConvertOptions();
2929
converter.Convert(outputFile, options);

Examples/GroupDocs.Conversion.Examples.CSharp/AdvancedUsage/Converting/ConvertOstDocumentMessagesToDifferentFormats.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ public static void Run()
1717

1818
var index = 1;
1919

20-
LoadOptions LoadOptionsProvider(FileType sourceType)
20+
LoadOptions LoadOptionsProvider(LoadContext loadContext)
2121
{
22-
if (sourceType == EmailFileType.Ost)
22+
if (loadContext.SourceFormat == EmailFileType.Ost)
2323
{
2424
return new PersonalStorageLoadOptions
2525
{
@@ -31,15 +31,15 @@ LoadOptions LoadOptionsProvider(FileType sourceType)
3131
return null;
3232
}
3333

34-
Stream ConvertedStreamProvider(FileType targetType)
34+
Stream ConvertedStreamProvider(SaveContext saveContext)
3535
{
36-
string outputFile = Path.Combine(outputFolder, $"converted-{index++}.{targetType.Extension}");
36+
string outputFile = Path.Combine(outputFolder, $"converted-{index++}.{saveContext.TargetFormat.Extension}");
3737
return new FileStream(outputFile, FileMode.Create);
3838
}
3939

40-
ConvertOptions ConvertOptionsProvider(string sourceDocumentName, FileType sourceType)
40+
ConvertOptions ConvertOptionsProvider(ConvertContext convertContext)
4141
{
42-
if (sourceType == EmailFileType.Msg)
42+
if (convertContext.SourceFormat == EmailFileType.Msg)
4343
{
4444
return new PdfConvertOptions();
4545
}

Examples/GroupDocs.Conversion.Examples.CSharp/AdvancedUsage/Converting/ConvertToHtmlWithAdvancedOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static void Run()
1515
string outputFolder = Constants.GetOutputDirectoryPath();
1616
string outputFile = Path.Combine(outputFolder, "converted.html");
1717

18-
Func<LoadOptions> getLoadOptions = () => new WordProcessingLoadOptions
18+
Func<LoadContext, LoadOptions> getLoadOptions = loadContext => new WordProcessingLoadOptions
1919
{
2020
Password = "12345"
2121
};

Examples/GroupDocs.Conversion.Examples.CSharp/AdvancedUsage/Converting/ConvertToImageWithAdvancedOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static void Run()
1616
string outputFolder = Constants.GetOutputDirectoryPath();
1717
string outputFileTemplate = Path.Combine(outputFolder, "converted-page-{0}.png");
1818

19-
Func<int, Stream> getPageStream = page => new FileStream(string.Format(outputFileTemplate, page), FileMode.Create);
19+
Func<SavePageContext, Stream> getPageStream = saveContext => new FileStream(string.Format(outputFileTemplate, saveContext.Page), FileMode.Create);
2020

2121
using (Converter converter = new Converter(Constants.SAMPLE_PDF))
2222
{

0 commit comments

Comments
 (0)