I've decided to use Glen K Peterson's Pdf Layout Manager available on GitHub(https://github.com/GlenKPeterson/PdfLayoutManager) to generate PDF documents with my app, I've imported the source files and the pom.xml dependencies and everything, it's working just fine.
The problem is, I'm trying to build a table in one of the documents I want to generate with a button click. I have no idea how to extract(use) the TableBuilder, as I'm getting the error message inside my JDeveloper IDE, that the class has private access.
Here's my code:
private void jBtnSalvareVerMetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnSalvareVerMetActionPerformed
// TODO add your handling code here:
PDDocument document = new PDDocument();
try {
PDPage page = new PDPage();
document.addPage(page);
PDFont font = PDType1Font.COURIER;
PDPageContentStream contents = new PDPageContentStream(document, page);
contents.beginText();
contents.setFont(font, 14);
contents.newLineAtOffset(50, 500);
Coord coordinate = new Coord(10, 700);
PdfLayoutMgr pageMgr = PdfLayoutMgr.newRgbPageMgr();
LogicalPage locatieTabel = pageMgr.logicalPageStart();
TableBuilder tabel = new TableBuilder(locatieTabel, coordinate); // Getting the error at this point
contents.newLineAtOffset(10, 700);
contents.showText(tabel.toString());
contents.endText();
contents.close();
} catch (IOException ex) {
java.util.logging.Logger.getLogger(MeniuTaburi.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} finally {
try {
document.close();
} catch (IOException ex) {
java.util.logging.Logger.getLogger(MeniuTaburi.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
}
jLabelAverstismenteVerMet.setText("<html><center>Datele au fost salvate cu succes!</center></html>");
}//GEN-LAST:event_jBtnSalvareVerMetActionPerformed
I thought of changing the type of access permission from private to public, for the TableBuilder, but I don't think, that's the way it's actually supposed to work...
Is there any other way, I can build the table I need, without resorting to changing the access modifier, inside the TableBuilder class??
question from:
https://stackoverflow.com/questions/65847118/i-want-to-build-a-pdf-doc-using-glen-k-petersons-pdf-layout-manager-but-im 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…