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
// Load the input Word document | |
Aspose.Words.Document doc = new Aspose.Words.Document("Words.docx"); | |
// Initialize an object of ImageSaveOptions class | |
Aspose.Words.Saving.ImageSaveOptions options = new Aspose.Words.Saving.ImageSaveOptions(Aspose.Words.SaveFormat.Jpeg); | |
// Set the "PageSet" to "0" to convert only the first page of a document. | |
options.PageSet = new Aspose.Words.Saving.PageSet(0); | |
// Set the image's brightness and contrast. |
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 Archive class object | |
var arch = new Archive(); | |
// Specify file names and create entry | |
arch.CreateEntry(dataDir + "input.csv", dataDir + "Sample.csv"); | |
// Save compressed ZIP archive containing CSV data | |
arch.Save(dataDir + "csv_archive.zip"); |
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
// Parse RGB color | |
Aspose.Svg.Drawing.Color rgb = Aspose.Svg.Drawing.Color.FromRgb(150, 121, 199); | |
// Convert RGB to CMYK | |
var cmyk = rgb.Convert(Aspose.Svg.Drawing.ColorModel.Cmyk); | |
// Print the CMYK color | |
Console.WriteLine("CMYK: " + cmyk.ToString()); |
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
// Load input DWG drawing | |
com.aspose.cad.Image image = com.aspose.cad.Image.load("sample.dwg"); | |
// Create an instance of PdfOptions | |
com.aspose.cad.imageoptions.PdfOptions pdfOptions = new com.aspose.cad.imageoptions.PdfOptions(); | |
// Create an instance of CadRasterizationOptions and set its various properties | |
com.aspose.cad.imageoptions.CadRasterizationOptions rasterizationOptions = new com.aspose.cad.imageoptions.CadRasterizationOptions(); |
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
// Initialize an HTML document from the file | |
using var document = new Aspose.Html.HTMLDocument("spring.html"); | |
// Initialize ImageSaveOptions | |
var options = new Aspose.Html.Saving.ImageSaveOptions(Aspose.Html.Rendering.Image.ImageFormat.Jpeg); | |
// Convert HTML to JPG | |
Aspose.Html.Converters.Converter.ConvertHTML(document, options, "spring-output.jpg"); |
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
// Instantiate viewer | |
using (Viewer viewer = new Viewer("resume.docx")) | |
{ | |
// Set output HTML options | |
HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(); | |
// Render DOCX to HTML with embedded resources | |
viewer.View(options); | |
} |
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
// Load a PSD file | |
Aspose.PSD.Image image = Aspose.PSD.Image.Load("sample.psd"); | |
// Define the compression method | |
Aspose.PSD.ImageOptions.PsdOptions options = new Aspose.PSD.ImageOptions.PsdOptions(); | |
options.CompressionMethod = Aspose.PSD.FileFormats.Psd.CompressionMethod.Raw; | |
// Save compressed PSD image | |
image.Save("compressed.psd" , options); |
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
// Open document | |
Document pdfDocument = new Document(dataDir + "merged.pdf"); | |
// Create page number stamp | |
com.aspose.pdf.PageNumberStamp pageNumberStamp = new com.aspose.pdf.PageNumberStamp(); | |
// Whether the stamp is background | |
pageNumberStamp.setBackground(false); | |
pageNumberStamp.setFormat("Page # of " + pdfDocument.getPages().size()); | |
pageNumberStamp.setBottomMargin (10); |
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
// Load an image using the RasterImage class | |
Aspose.Imaging.RasterImage rasterImage = (Aspose.Imaging.RasterImage)Aspose.Imaging.Image.Load("aspose_logo.jpg"); | |
// Cache the image for better performance | |
if (!rasterImage.IsCached) | |
{ | |
rasterImage.CacheData(); | |
} | |
// Set the coordinates with the Rectangle class |
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
// Load input Word documents | |
Aspose.Words.Document doc1 = new Aspose.Words.Document("Input.docx"); | |
Aspose.Words.Document doc2 = new Aspose.Words.Document("Input1.docx"); | |
// Merge Word DOCX documents | |
doc1.AppendDocument(doc2, Aspose.Words.ImportFormatMode.KeepSourceFormatting); | |
// Save merged document as DOCX file | |
doc1.Save("merged.docx", Aspose.Words.SaveFormat.Docx); |