Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
GroupDocsGists / ViewWordDocument.cs
Last active March 25, 2025 07:40
How to Open Word Documents Programmatically
// View Word Documents using C#
using GroupDocs.Viewer.Options;
...
using (Viewer viewer = new Viewer("path/document.docx"))
{
PdfViewOptions options = new PdfViewOptions("path/Word-Document.pdf");
viewer.View(options);
}
@GroupDocsGists
GroupDocsGists / readme.md
Created December 31, 2024 04:57
Convert SVG to PNG using Node.js
@GroupDocsGists
GroupDocsGists / docx_to_pdf.js
Last active September 20, 2024 10:11
How to Convert Word to PDF using Node.js
// Convert the Word Document to PDF format using Node.js
// Load the source DOCX file
const converter = new groupdocs.conversion.Converter("sample.docx");
// Set the convert options for PDF format
const options = new groupdocs.conversion.PdfConvertOptions();
// Convert to PDF format
converter.convert("converted.pdf", 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");