Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
GroupDocsGists / ConvertWebPToJPG.java
Created January 20, 2021 07:52
Convert WebP to JPG, PNG, GIF, TIFF, or PDF in Java
// Convert WebP to JPG in Java using GroupDocs.Conversion API
Converter converter = new Converter("filePath/WebPImage.webp");
ImageConvertOptions options = new ImageConvertOptions();
options.setFormat(ImageFileType.Jpg);
converter.convert("path/WebPToJPG.jpg", options);
@GroupDocsGists
GroupDocsGists / AddTilingWatermark.java
Last active July 24, 2024 09:07
How To Add Tiling Watermark to a PDF in Java
// Specify an absolute or relative path to your document. Ex: "C:\\Docs\\photo.png"
Watermarker watermarker = new Watermarker("photo.png");
// Use path to the image as constructor parameter
ImageWatermark watermark = new ImageWatermark("watermark.jpg");
// Add watermark to the document
watermarker.add(watermark);
watermarker.save("destin.png");
watermark.close();
watermarker.close();
@GroupDocsGists
GroupDocsGists / AddTilingWatermark.cs
Last active July 24, 2024 09:06
How To Add Tiling Watermark to a PDF in C#
using (var watermarker = new Watermarker(“source.pdf”))
{
// Create the image watermark object
var watermark = new ImageWatermark(“lock-key.png”);
// Configure tile options
watermark.TileOptions = new TileOptions()
{
LineSpacing = new MeasureValue()
{
@GroupDocsGists
GroupDocsGists / AddImageWatermarkToDocument.js
Last active May 22, 2024 21:15
How To Add Image Watermark to a Document in Node.js solutions
// require the GroupDocs.Watermark module
const groupdocsWatermark = require('@groupdocs/groupdocs.watermark')
// Initialize the Watermarker class
const watermarker = new groupdocsWatermark.Watermarker(inDocumentPath);
// Create an Image Watermark
const imageWatermark = new groupdocsWatermark.ImageWatermark(imageFilePath);
// Set Watermark Alignment
@GroupDocsGists
GroupDocsGists / AddTextWatermarkToDocument.js
Last active May 22, 2024 21:15
How To Add Text Watermark to a Document in Node.js solutions
// require the GroupDocs.Watermark module
const groupdocsWatermark = require('@groupdocs/groupdocs.watermark')
// Initialize the Watermarker class
const watermarker = new groupdocsWatermark.Watermarker(inDocumentPath);
// Create a Text Watermark
const watermark = new groupdocsWatermark.TextWatermark('top secret', new groupdocsWatermark.Font('Arial', 36));
// Set Watermark Properties
@GroupDocsGists
GroupDocsGists / GroupDocsWatermarkNodeJsExample.js
Last active May 22, 2024 21:04
Simple Example of GroupDocs.Watermark for Node.js via Java
// require the GroupDocs.Watermark module
const groupdocsWatermark = require('@groupdocs/groupdocs.watermark')
// Initialize the watermarker object
const watermarker = new groupdocsWatermark.Watermarker('Example.docx');
// Create the font object which will be used for the watermark text
const font = new groupdocsWatermark.Font('Arial', 36, groupdocsWatermark.FontStyle.Bold);
// Instantiate the watermark class
@GroupDocsGists
GroupDocsGists / AcceptRejectChangesComparingJSON.cs
Created May 17, 2024 21:02
How to accept or reject changes when comparing JSON files with C#
using (Comparer comparer = new Comparer(inFile1))
{
comparer.Add(inFile2);
comparer.Compare();
ChangeInfo[] changes = comparer.GetChanges();
foreach (var change in changes)
{
if ( change.SourceText != null
@GroupDocsGists
GroupDocsGists / CompareJSONFiles.js
Last active May 17, 2024 21:01
How to compare JSON files with Node.js
const comparer = new groupdocs.comparison.Comparer("source.json")
comparer.add("destin.json");
comparer.compare("output.json");
@GroupDocsGists
GroupDocsGists / CompareJSONFiles.java
Last active May 17, 2024 21:01
How to compare JSON files with Java
try(Comparer comparer = new Comparer("source.json"))
{
comparer.add("destin.json");
comparer.compare();
}
@GroupDocsGists
GroupDocsGists / CompareJSONFiles.cs
Last active May 17, 2024 20:59
How to compare JSON files with C#
using (var comparer = new Comparer(“source.json”))
{
comparer.Add(“destin.json”);
comparer.Compare(“output.json”);
}