This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try (Comparer comparer = new Comparer(sourceFile)) { | |
comparer.add(targetFile1); // 1st.xlsx | |
comparer.add(targetFile2); // 2nd.xlsx | |
final Path resultPath = comparer.compare(resultFile); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (Comparer comparer = new Comparer(File.OpenRead("source.docx"))) | |
{ | |
comparer.Add(File.OpenRead("target.docx")); | |
comparer.Compare(File.Create("result.docx")); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create an instance of Parser class | |
using (Parser parser = new Parser(Constants.SamplePdfWithBarcodes)) | |
{ | |
// Check if the file supports barcodes extraction | |
if (!parser.Features.Barcodes) | |
{ | |
Console.WriteLine("The file doesn't support barcodes extraction."); | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create an instance of Parser class | |
using (Parser parser = new Parser(Constants.SamplePdfWithBarcodes)) | |
{ | |
// Check if the file supports barcodes extraction | |
if (!parser.Features.Barcodes) | |
{ | |
Console.WriteLine("The file doesn't support barcodes extraction."); | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create an instance of Parser class | |
using (Parser parser = new Parser(filePath)) | |
{ | |
// Check if text extraction is supported | |
if (!parser.Features.Text) | |
{ | |
Console.WriteLine("Text extraction isn't supported."); | |
return; | |
} | |
// Check if toc extraction is supported |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create an instance of Parser class | |
using (Parser parser = new Parser(filePath)) | |
{ | |
// Extract attachments from the container | |
IEnumerable<ContainerItem> attachments = parser.GetContainer(); | |
// Check if container extraction is supported | |
if (attachments == null) | |
{ | |
Console.WriteLine("Container extraction isn't supported"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create an instance of Parser class | |
using (Parser parser = new Parser(filePath)) | |
{ | |
// Extract images | |
IEnumerable<PageImageArea> images = parser.GetImages(); | |
// Check if images extraction is supported | |
if (images == null) | |
{ | |
Console.WriteLine("Images extraction isn't supported"); | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using(Parser parser = new Parser(filePath)) | |
{ | |
// Extract a text into the reader | |
using(TextReader reader = parser.GetText()) | |
{ | |
// Print a text from the document | |
// If text extraction isn't supported, a reader is null | |
Console.WriteLine(reader == null ? "Text extraction isn't supported" : reader.ReadToEnd()); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class VideoConnector : IVideoConnector | |
{ | |
private readonly Dictionary<VideoFileType, Action<FFMpegArgumentOptions>> _optionsMap = new(); | |
public VideoConnector() | |
{ | |
_optionsMap.Add(VideoFileType.Avi, SetAviConvertOptions); | |
_optionsMap.Add(VideoFileType.Flv, SetFlvConvertOptions); | |
_optionsMap.Add(VideoFileType.Mkv, SetMkvConvertOptions); | |
_optionsMap.Add(VideoFileType.Mp4, SetMp4ConvertOptions); | |
_optionsMap.Add(VideoFileType.Wmv, SetWmvConvertOptions); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AudioConnector : IAudioConnector | |
{ | |
private readonly Dictionary<AudioFileType, Action<FFMpegArgumentOptions>> _optionsMap = new Dictionary<AudioFileType, Action<FFMpegArgumentOptions>>(); | |
public AudioConnector() | |
{ | |
_optionsMap.Add(AudioFileType.Mp3, SetMp3ConvertOptions); | |
_optionsMap.Add(AudioFileType.Ogg, SetOggConvertOptions); | |
_optionsMap.Add(AudioFileType.Aac, SetAacConvertOptions); | |
_optionsMap.Add(AudioFileType.Ac3, SetAc3ConvertOptions); |
NewerOlder