Skip to content

Instantly share code, notes, and snippets.

@sohail-aspose
sohail-aspose / Converting-PPT-Presentation-to-PPTX-Presentation.java
Created May 10, 2016 10:10
Converting PPT Presentation to PPTX Presentation
//Instantiate a Presentation object that represents a PPTX file
Presentation pres = new Presentation("Aspose.ppt");
//Saving the PPTX presentation to PPTX format
pres.save("Aspose.pptx",SaveFormat.Pptx);
@sohail-aspose
sohail-aspose / Converting-Presentation-to-PDF-using-the-Default-Options.java
Created May 10, 2016 12:16
Converting Presentation to PDF using the Default Options
//Instantiate a Presentation object that represents a presentation file
Presentation pres = new Presentation("demo.pptx");
//Save the presentation to PDF with default options
pres.save("demoDefault.pdf", SaveFormat.Pdf);
@sohail-aspose
sohail-aspose / Converting-Presentation-to-PDF-using-Custom-Options.java
Last active May 10, 2016 12:20
Converting Presentation to PDF using Custom Options
//Instantiate a Presentation object that represents a presentation file
Presentation pres = new Presentation("demo.pptx");
//Instantiate the PdfOptions class
PdfOptions opts = new PdfOptions();
//Set Jpeg Quality
opts.setJpegQuality ((byte) 90);
//Define behavior for metafiles
@sohail-aspose
sohail-aspose / Converting-Presentation-to-Password-Protected-PDF.java
Created May 10, 2016 12:22
Converting Presentation to Password Protected PDF
//Instantiate a Presentation object that represents a presentation file
Presentation pres = new Presentation("demo.pptx");
//Instantiate the PdfOptions class
PdfOptions opts = new PdfOptions();
//Setting PDF password
opts.setPassword ( "password");
//Save the presentation to password protected PDF
@sohail-aspose
sohail-aspose / Converting a Specific Slide to PDF.java
Created May 10, 2016 12:23
Converting a Specific Slide to PDF
//Instantiate a Presentation object that represents a presentation file
Presentation pres = new Presentation("demo.pptx");
//Setting array of slides positions
int[] slides = new int[] { 2, 3, 5 };
//Save the presentation to PDF
pres.save("demo.pdf", slides, SaveFormat.Pdf);
@sohail-aspose
sohail-aspose / Examples-CSharp-Email-SaveMessageAsOFT-SaveMessageAsOFT.cs
Last active May 19, 2016 13:31 — forked from aspose-email/AppConfigSMTPClientActivityLogging.config
This Gist contains code snippets for sample code of Aspose.Email
// For complete examples and data files, please go to https://github.com/aspose-email/Aspose.Email-for-.NET
/// <summary>
/// This exmpale shows how to save an email as Outlook Template (.OFT) file using the MailMesasge API
/// MsgSaveOptions.SaveAsTemplate - Set to true, if need to be saved as Outlook File Template(OFT format).
/// Available from Aspose.Email for .NET 6.4.0 onwards
/// </summary>
using (MailMessage eml = new MailMessage("test@from.to", "test@to.to", "template subject", "Template body"))
{
string oftEmlFileName = "EmlAsOft.oft";
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Java
// Open source PDF document
Document pdfDocument = new Document("input.pdf");
// Delete all annotation
pdfDocument.getPages().get_Item(1).getAnnotations().delete();
// Save the update document
pdfDocument.save("output.pdf");
// For complete examples and data files, please go to https://github.com/aspose-cad/Aspose.CAD-for-Java
// The path to the resource directory.
String dataDir = Utils.getDataDir(ConvertAllCADLayersToSeparateImages.class) + "CADConversion/";
String srcFile = dataDir + "conic_pyramid.dxf";
// Load a CAD drawing in an instance of CadImage
CadImage image = (CadImage) Image.load(srcFile);
// Create an instance of CadRasterizationOptions
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
// For complete examples and data files, please go to https://github.com/aspose-slides/Aspose.Slides-for-Java
// Create empty presentation instance
Presentation newPptx = new Presentation();
// Adding the Media Player ActiveX control
newPptx.getSlides().get_Item(0).getControls().addControl(ControlType.WindowsMediaPlayer, 100, 100, 400, 400);
// Access the Media Player ActiveX control and set the video path
newPptx.getSlides().get_Item(0).getControls().get_Item(0).getProperties().set_Item("URL", "Wildlife.wmv");
@sohail-aspose
sohail-aspose / Examples-CSharp
Created December 22, 2016 04:38 — forked from aspose-cells/Aspose.Cells for .NET
This Gist contains CSharp code snippets for examples of Aspose.Cells for .NET.
Examples-CSharp