String dataDir = Utils.getSharedDataDir(BuildDocAndInsertImageUsingImageStream.class) + "images/"; // create an object of the Document class Document doc = new Document(); // initialize Page class object Page page = new Page(doc); Outline outline1 = new Outline(doc); outline1.setVerticalOffset(600); outline1.setHorizontalOffset(0); OutlineElement outlineElem1 = new OutlineElement(doc); InputStream fs = null; try { fs = new FileInputStream(dataDir + "image.jpg"); } catch (FileNotFoundException e) { e.printStackTrace(); } // Load the second image using the image name, extension and stream. Image image = new Image(doc, dataDir + "image1.jpg"); // set image alignment image.setAlignment(HorizontalAlignment.Right); outlineElem1.appendChildLast(image); outline1.appendChildLast(outlineElem1); page.appendChildLast(outline1); doc.appendChildLast(page); // save OneNote document try { doc.save("D://Aspose_JavaProjects//OneNote//out3.pdf",SaveFormat.Pdf); } catch (IOException e) { e.printStackTrace(); }