Skip to content

Instantly share code, notes, and snippets.

Aspose.com Gists aspose-com-gists

View GitHub Profile
@aspose-com-gists
aspose-com-gists / MainActivity.java
Created Aug 3, 2020
Build Word to PDF Converter APP in Android
View MainActivity.java
package com.example.wordtopdf;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
@aspose-com-gists
aspose-com-gists / pdf-to-pptx-images.java
Created Jul 22, 2020
Convert PDF to PPTX using Java
View pdf-to-pptx-images.java
// Load PDF document
Document pdfDocument = new Document("document.pdf");
// Set PPTX save options
PptxSaveOptions pptxOptions = new PptxSaveOptions();
pptxOptions.setSlidesAsImages(true);
// Save PDF as PPTX
pdfDocument.save("PDF to PPT.pptx", pptxOptions);
@aspose-com-gists
aspose-com-gists / 01_Aspose.Cells.GridDesktop
Last active Jul 20, 2020
This Gist contains code snippets for examples of Aspose.Cells.GridDesktop.
View 01_Aspose.Cells.GridDesktop
This Gist contains code snippets for examples of Aspose.Cells.GridDesktop.
View digitally-sign-PDF-timestamp.java
// Create a Document object
Document doc = new Document("input.pdf");
PdfFileSignature signature = new PdfFileSignature(doc);
PKCS7 pkcs = new PKCS7("certificate.pfx", "1234567890"); // Use PKCS7/PKCS7Detached objects
TimestampSettings timestampSettings = new TimestampSettings("https:\\your_timestamp_settings", "user:password"); // User/Password can be omitted
pkcs.setTimestampSettings(timestampSettings);
Rectangle rect = new Rectangle(100, 600, 400, 100);
// Set signature appearance
signature.setSignatureAppearance("aspose-logo.png");
// Create any of the three signature types
@aspose-com-gists
aspose-com-gists / HomeController.cs
Created Jul 7, 2020
Merge MS Word Documents in ASP.NET
View HomeController.cs
public FileResult UploadFiles(List<IFormFile> files, string outputFormat)
{
if (files.Count() <= 1)
{
// display some message
return null;
}
string fileName = "merged-document.docx";
string path = "wwwroot/uploads";
List<Document> documents = new List<Document>();
@aspose-com-gists
aspose-com-gists / HomeController.cs
Last active Jul 6, 2020
Compare Word Documents in ASP.NET Core
View HomeController.cs
[HttpPost]
public FileResult UploadFiles(List<IFormFile> files, string outputFormat)
{
if(files.Count()==0)
{
return null;
}
string fileName = "result.docx";
// Upload files
var file1 = Path.Combine("wwwroot/uploads", files[0].FileName);
@aspose-com-gists
aspose-com-gists / create-image.cs
Created Jun 26, 2020
Create or update images using C#
View create-image.cs
// Create Bitmap object
Bitmap bitmap = new Bitmap(1000, 800, System.Drawing.Imaging.PixelFormat.Format32bppPArgb);
// Create and initialize Graphics
Graphics graphics = Graphics.FromImage(bitmap);
// Create Pen
Pen pen = new Pen(Color.FromKnownColor(KnownColor.Blue), 2);
// Draw arc
graphics.DrawArc(pen, 0, 0, 700, 700, 0, 180);
// Create another Pen
Pen pen1 = new Pen(Color.FromKnownColor(KnownColor.Red), 2);
View convert-pdf-to-xls.java
// Load source PDF file
Document doc = new Document("sampletable.pdf");
// Convert PDF to XLS
doc.save("workbook.xls", SaveFormat.Excel);
@aspose-com-gists
aspose-com-gists / AdvancedExportToXLSX.cs
Last active Jun 23, 2020
Aspose.Tasks for .NET with Excel
View AdvancedExportToXLSX.cs
var project = new Project("Commercial Construction.mpp");
var taskColumns = new List<ViewColumn>
{
new GanttChartColumn("Task Mode", 50, Field.TaskManual),
new GanttChartColumn("Id", 50, Field.TaskID),
new GanttChartColumn("Name", 100, Field.TaskName),
new GanttChartColumn("Start", 100, Field.TaskStart),
new GanttChartColumn("Finish", 100, Field.TaskFinish),
new GanttChartColumn("% Complete", 50, Field.TaskPercentComplete),
new GanttChartColumn("Task Info", 100, Field.TaskText4),
You can’t perform that action at this time.