Skip to content

Instantly share code, notes, and snippets.

// create a new PPTX file
FileOutputStream fileOutputStream = new FileOutputStream(new File("Slidelayout.pptx"));
// create a new slide show
XMLSlideShow xmlSlideShow = new XMLSlideShow();
// initialize slide master object
XSLFSlideMaster xslfSlideMaster = xmlSlideShow.getSlideMasters().get(0);
// set Title layout
XSLFSlideLayout xslfSlideLayout = xslfSlideMaster.getLayout(SlideLayout.TITLE);
// create a new slide with title layout
XSLFSlide xslfSlide = xmlSlideShow.createSlide(xslfSlideLayout);
// Using Apache POI you can create a word document using XWPFDocument and insert a paragraph in it using the XWPFParagraph class.
// The following code snippet shows how to create a Word document using the API.
// initialize a blank document
XWPFDocument document = new XWPFDocument();
// create a new file
FileOutputStream out = new FileOutputStream(new File("createdocument.docx"));
// create a new paragraph paragraph
XWPFParagraph paragraph = document.createParagraph();
XWPFRun run = paragraph.createRun();
// Initialize a blank Document
XWPFDocument document = new XWPFDocument();
// Create a new file
FileOutputStream out = new FileOutputStream(new File("createdocument.docx"));
// Create an intro paragraph
XWPFParagraph intro = document.createParagraph();
intro.setAlignment(ParagraphAlignment.CENTER);
XWPFRun introRun = intro.createRun();
// Set text
introRun.setText("Getting Started with Apache POI");
/// <summary>
/// Select single object under current node using XPath-like query syntax.
/// </summary>
/// <param name="path"></param>
/// <exception cref="ParseException">ParseException will be thrown if the path contains malformed query.</exception>
/// <returns></returns>
public Aspose.ThreeD.A3DObject SelectSingleObject(string path)
//URL https://products.groupdocs.com/assembly/java
//Code Snippet Name: Insert nested external documents in a Word document
//Please use the following code snippet
// Instantiate DocumentAssembler class
DocumentAssembler assembler = new DocumentAssembler();
//Call AssembleDocument to generate report
assembler.assembleDocument("D:\\WordTemplates\\Nested External Document.docx", "D:\\WordReports\\Nested External Document.docx", new DataSourceInfo( new DataStorage(), null));
//(See new DataStorage() method details at https://github.com/groupdocs-assembly/GroupDocs.Assembly-for-Java )
//URL https://products.groupdocs.com/assembly/net
//Code Snipet Name: Report Generation in Open Document Format using C#
//Please use the following code snippet
//Instantiate DocumentAssembler class
DocumentAssembler assembler = new DocumentAssembler();
//Call AssembleDocument to generate report
assembler.AssembleDocument("D:\\WordTemplates\\Barcode.docx", "D:\\WordReports\\Barcode.docx", new DataSourceInfo(DataLayer.GetCustomerData(), "customer"));
//(See DataLayer.GetCustomerData() method details at https://github.com/groupdocs-assembly/GroupDocs.Assembly-for-.NET )
//URL https://products.groupdocs.com/metadata/java
//Code snippet title: Efficiently Fetch Metadata Properties using Java
//Please use the following code snippet, also please take care of code hierarchy
try (Mp3Format mp3Format = new Mp3Format("D:\\sample.mp3"))
{
// read album in ID3 v1
System.out.printf("Album: %", mp3Format.getId3v1Properties().getAlbum());
//URL https://products.groupdocs.com/metadata/net
//Code Snippet Title: Remove Photoshop Metadata from JPEG Image using C#
//Please use the following code snippet, also please take care of code hierarchy
// Initialize JpegFormat
using (JpegFormat jpegFormat = new JpegFormat("sample.jpeg"))
{
// Remove photoshop metadata
jpegFormat.RemovePhotoshopData();
// URL : https://products.groupdocs.com/search/net
// Code Snippet Title: Index and Search with Default Parameters using C#
//Please use the following code snippet
// Create index
Index index = new Index(@"c:\MyIndex");
// Add documents to index
index.AddToIndex(@"c:\MyDocuments");
// Search in index
// URL : https://products.groupdocs.com/search/java
// Code Snippet Title: Perform Wild Card Search
//Please use the following code snippet
// Creating index
Index index = new Index("c:\\MyIndex");
// Adding documents to index
index.addToIndex("c:\\MyDocuments");