bleik urrego
bleik urrego

Reputation: 90

PDFBox PDDocument add a pdf-layout Document?

I am getting familiar with the flavors out there for PDFBox. I would like to know if there is a way to get pdf-layout elements into a PDDocument object. the pdf-layout elements use Document as the parent and PDFBox use PDDocument as parent.

PDDodcument doc = new PDDocument();
Paragraph someText = new Paragraph();
Frame shape = new Frame(someText);
//Im looking for something like doc.add(shape);

Libraries used: https://pdfbox.apache.org/2.0/examples.html & https://github.com/ralfstuckert/pdfbox-layout

Upvotes: 2

Views: 1362

Answers (1)

bleik urrego
bleik urrego

Reputation: 90

Solved: Turns out that you have to make the rst.pdfbox.layout.elements.Document the parent i.e:

Document ParentDoc = new Document();
Shape rec = new rec(10);
ParentDoc.add(rec);
//ParentDoc.getPDDocument()... use for PDFBox Items

Upvotes: 1

Related Questions