Hi,
I need guidance with regards to adding a paragraph in my PDF. So far i am doing something like this:
Page page = doc.getPages().getList().get(1);
Paragraph paragraph = new Paragraph();
Rectangle rect = new Rectangle();
rect.setLLX(250.0);
rect.setLLY(718.0);
rect.setURX(560.0);
rect.setURY(770.0);
paragraph.setSubsequentLinesIndent(0.0);
paragraph.setRectangle(rect);
paragraph.setHorizontalAlignment(TextHorizontalAlignment.LEFT);
paragraph.setVerticalAlignment(VerticalAlignment.BOTTOM);
paragraph.setWrapMode(WrapMode.BYWORDS);
TextState textState = new TextState();
textState.setFontSize(16.0);
Segment segment = new Segment();
segment.setValue(desc);
segment.setTextState(textState);
List<TextLine> lines = new ArrayList<>();
TextLine line = new TextLine();
line.addSegmentsItem(segment);
lines.add(line);
paragraph.setLines(lines);
For Aspose.pdf (not cloud based API) we used to add a textbuilder and then append the paragraph to the textbuilder. However, i can’t find the same functionality on pdf-cloud. Kindly help how i can achieve to make a paragraph
Please use PutAddText API method to add a text paragraph in PDF with Java using Aspose.PDF Cloud. Kindly check the following sample code for reference.