Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
GroupDocsGists / ConvertCsvToJSON.cs
Created Jun 17, 2021
Convert JSON to CSV & CSV to JSON using C#
View ConvertCsvToJSON.cs
// Convert CSV file to JSON format in C#
var loadOptions = new CsvLoadOptions
{
Separator = ','
};
using (Converter converter = new Converter(@"path/sample.csv", ()=> loadOptions))
{
DataConvertOptions options = new DataConvertOptions
{
@GroupDocsGists
GroupDocsGists / CompareImages.java
Last active Jun 16, 2021
Compare Images and highlight the differences in Java
View CompareImages.java
// Compare two Images and highlight the differences in Java
Comparer comparer = new Comparer("image-a.jpg")
comparer.add("image-b.jpg");
comparer.compare("result-Image.jpg"); // This will return the path of the resultant image.
@GroupDocsGists
GroupDocsGists / MergeDifferentFiles.java
Last active Jun 16, 2021
Merge two or more difference types of files into one file in Java
View MergeDifferentFiles.java
// Combine two or more different types of files into one using Java
Merger merger = new Merger("pdf_document.pdf");
{
merger.join("word_document.docx");
merger.join("spreadsheet.xlsx");
merger.save("merged-document.pdf");
}
@GroupDocsGists
GroupDocsGists / ImageWatermarkToPresentation.java
Last active Jun 13, 2021
Apply Text and Image Watermarks to Presentations & Slides in Java | PPT, PPTX
View ImageWatermarkToPresentation.java
// Add image watermark to presentation slides in Java
Watermarker watermarker = new Watermarker("path/presentation.pptx");
// Prepare image, its size, location and appearance
ImageWatermark imageWatermark = new ImageWatermark("path/watermarkImage.png");
imageWatermark.setX(80);
imageWatermark.setY(110);
imageWatermark.setOpacity(0.7);
PresentationWatermarkSlideOptions imageWatermarkOptions = new PresentationWatermarkSlideOptions();
@GroupDocsGists
GroupDocsGists / HighlightSearchResults.cs
Last active Jun 4, 2021
Search and highlight text in all the documents of folder using C#
View HighlightSearchResults.cs
string indexFolder = @"indexPath/GroupDocs/index/";
string documentFolder = @"documentPath/GroupDocs/source/";
string query = "draw";
// Create an index in the specified folder and add documents folder to Index
Index index = new Index(indexFolder);
index.Add(documentFolder);
// Search for the word of query
SearchResult result = index.Search(query);
@GroupDocsGists
GroupDocsGists / ConvertEmlToPdf.cs
Last active May 28, 2021
Convert MSG and EML to PDF in C# | Email Messages to PDF
View ConvertEmlToPdf.cs
// Convert EML message to PDF in C#
using (Converter converter = new Converter("emailMessage.eml"))
{
PdfConvertOptions options = new PdfConvertOptions();
converter.Convert("eml-Message.pdf", options);
}
@GroupDocsGists
GroupDocsGists / ConvertPdfToExcel.java
Created May 22, 2021
Convert PDF or Word file to Excel Spreadsheet in Java
View ConvertPdfToExcel.java
// Convert PDF document to Excel Spreadsheet in Java
Converter converter = new Converter("document.pdf");
SpreadsheetConvertOptions options = new SpreadsheetConvertOptions();
converter.convert("pdfToExcel.xlsx", options);
@GroupDocsGists
GroupDocsGists / ConvertImageToPDF.cs
Last active May 19, 2021
Convert Images to PDF in C#
View ConvertImageToPDF.cs
// Convert any Image to PDF in C#. PNG, WebP, JPG, GIF, TGA and many more ...
using (Converter converter = new Converter("image.png"))
{
PdfConvertOptions options = new PdfConvertOptions();
converter.Convert("imageToPdf.pdf", options);
}
@GroupDocsGists
GroupDocsGists / ReadHeifExif.java
Last active May 12, 2021
Read EXIF and XMP data of HEIF and HIEC images in Java
View ReadHeifExif.java
// Read EXIF, EXIF IFD, EXIF GPS Package of HEIF / HEIC images in Java
Metadata metadata = new Metadata("image.heic");
IExif root = (IExif) metadata.getRootPackage();
if (root.getExifPackage() != null) {
String pattern = "%s : %s";
// Get EXIF Package information
for (TiffTag tag : root.getExifPackage().toList()) {
System.out.println(String.format(pattern, tag.getName(), tag.getInterpretedValue()));
}
// Get EXIF IFD Package Information
@GroupDocsGists
GroupDocsGists / MergeDifferentFiles.cs
Last active May 4, 2021
Merge two or more difference types of files into one file in C# using .NET API
View MergeDifferentFiles.cs
// Combine two or more different types of files into one using C#
using (Merger merger = new Merger("document.pdf"))
{
merger.Join("document.docx");
merger.Join("spreadsheet.xlsx");
merger.Save("merge_document.pdf");
}