public List<Paragraph> getParagraphs(){ List<Paragraph> result = new ArrayList<Paragraph>(); for( Section s: sections ) result.addAll( s.getParagraphs() ); return result; }
//Instantiate a Pdf object by calling its empty constructor Pdf pdf1 = new Pdf(); //Create a section in the Pdf object Section sec1 = pdf1.getSections().add(); //Create an image object in the section aspose.pdf.Image img1 = new aspose.pdf.Image(sec1); //Add image object into the Paragraphs collection of the section sec1.getParagraphs().add(img1); //Set the path of image file img1.getImageInfo().setFile("C:/Images/Apple.jpg"); //Set the path of image file img1.getImageInfo().setTitle("JPEG image"); //Save the Pdf pdf1.save("d:/pdftest/JPEG_image_toPDF.pdf");
Section section = sectionList.get(0); List<Paragraph> paragraphs = section.getParagraphs(); Paragraph firstPar = new Paragraph();
for( Paragraph p: s.getParagraphs() ) handleContent( p, hpx, sb );