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); |
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 instance of OCR API | |
com.aspose.ocr.AsposeOCR api = new com.aspose.ocr.AsposeOCR(); | |
// Specify recognition settings | |
com.aspose.ocr.RecognitionSettings settings = new com.aspose.ocr.RecognitionSettings(); | |
settings.setDetectAreasMode(com.aspose.ocr.DetectAreasMode.PHOTO); | |
settings.setUpscaleSmallFont(true); | |
// Set processing filters | |
com.aspose.ocr.PreprocessingFilter filters = new com.aspose.ocr.PreprocessingFilter(); |
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 Excel file | |
Workbook wb = new Workbook("workbook.xlsx"); | |
// Get all worksheets | |
WorksheetCollection collection = wb.getWorksheets(); | |
// Loop through all the worksheets | |
for (int worksheetIndex = 0; worksheetIndex < collection.getCount(); worksheetIndex++) { | |
// Get worksheet using its index |
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 source HTML file | |
using (Converter converter = new Converter("input.html")) | |
{ | |
// Set the convert options for XLS format | |
GroupDocs.Conversion.Options.Convert.SpreadsheetConvertOptions options = new GroupDocs.Conversion.Options.Convert.SpreadsheetConvertOptions() | |
{ | |
PagesCount = 1, | |
Format = GroupDocs.Conversion.FileTypes.SpreadsheetFileType.Xls | |
}; |
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 source DOCX file | |
using (Converter converter = new Converter("sample.docx")) | |
{ | |
// Set custom properties of PresentationConvertOptions class | |
GroupDocs.Conversion.Options.Convert.PresentationConvertOptions options = new GroupDocs.Conversion.Options.Convert.PresentationConvertOptions | |
{ | |
PageNumber = 2, | |
PagesCount = 1, | |
Format = GroupDocs.Conversion.FileTypes.PresentationFileType.Ppt | |
}; |
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 desired workbook from disk | |
Workbook workbook = new Workbook(dataDir + "Data.xlsx"); | |
// Save the workbook to Memory Stream in HTML format | |
MemoryStream ms = new MemoryStream(); | |
workbook.Save(ms, Aspose.Cells.SaveFormat.Html); | |
ms.Position = 0; | |
// Define a StreamReader object with the above MemoryStream | |
StreamReader sr = new StreamReader(ms); |
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 PDF output stream | |
using (System.IO.Stream pdfStream = System.IO.File.Open(dataDir + "XPStoDOCX.pdf", System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Write)) | |
{ | |
// Initialize XPS input stream | |
System.IO.Stream xpsStream = System.IO.File.Open(dataDir + "sample.xps", System.IO.FileMode.Open); | |
// Load input XPS document | |
Aspose.Page.XPS.XpsDocument document = new Aspose.Page.XPS.XpsDocument(xpsStream, new Aspose.Page.XPS.XpsLoadOptions()); |
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 linear barcode object, Set the Code text and symbology type for the barcode | |
Aspose.BarCode.Generation.BarcodeGenerator generator = new Aspose.BarCode.Generation.BarcodeGenerator(Aspose.BarCode.Generation.EncodeTypes.Code39Standard, "1234567890"); | |
// Creating memory stream and save barcode image to memory stream | |
Stream ms = new MemoryStream(); | |
generator.Save(ms, Aspose.BarCode.Generation.BarCodeImageFormat.Bmp); | |
// Create a new Word document | |
Aspose.Words.Document doc = new Aspose.Words.Document(); |