Change docx4j Table Cell Background Color - java

I am currently trying to create a .docx Document using docx4j.
I have already created a few tables, and want to change the background- and text-color of the first table row.
table in question
I would like to create a void function which gets a Tc (table cell) and String (color) as an argument.
I actually havent found any help online.
Thanks in advance :)

You could use the Docx4j Helper WordAddin or webapp to generate Java code from a suitable example docx.

Related

Creating sub sections in the Table of Contents in iText pdf

Hi I created a PDF with Table of contents with given example in this link. But unfortunately I have no clue for doing it with sub sections in the TOC. I want structure like this
so please help me out. Thanks in advance

Adding Hyperlink to text inside Boxable Cell - PDFBox

Hope all are good. I am relatively new to Boxable and PDFBox and was hoping someone could help me in this regard. I am trying to generate a PDF using PDFBox and since I was required to create tables which I did, now I need to put a hyperlink text in it. I am trying but unable to find any help on this. I know PDFBox has a way of doing it using 'PDAnnotationLink' but that is not working when I'm trying to insert it into a Boxable Cell since that requires only String values.
Bit of my code is something like this,
Row<PDPage> row = table.createRow(rowHeight);
Cell<PDPage> cell = otherDocumentsRow.createCell(30, "Other Documents");
String str = "Attachment link here";
cell = row.createCell(70, str);
Now instead of str text, I am looking to insert a hyperlink text which points to some location (www.example.com). Is this possible or is there a workaround around this.
Thank you in advance and looking forward to hearing from you

How to read the table styles using apache POI from powerpoint

I am trying to read the table styles that is in a pptx template.
Tried using XSLFTableStyle xslfTableStyle = xslfTableStyles.getStyles() but that returns empty list.
I am able to see the file which has the table styles in the pptx package in the location ppt/tableStyles.xml which has the styles for all the available tables and also the selected style for this template.
Even if I write some custom code to read this xml, I don't see a way to create a table in a slide using this style. XSLFTable tbl = tableSlide.createTable(); this does not take any style inputs
Any out of the box way to create a table using the available table style?
Think this is not yet developed by Apache POI team, should be in their roadmap
Thanks,

Display complete jtextarea content into single cell of excel file during export.

i am developing one desktop application with the functionality of exporting jtable content into an excel file.
Now here is the flow of project code that i am implementing:-
After importing jtable into excel, data is written in this way:- (only single record is in jtable)
Now here all data is exporting in proper way except OUR REMARKS & CLIENT REPORT.
I have also tried to implement setLineWrap() and setWrapStyleWord() but still its not working.
Here is my code for above functions for OUR REMARKS textarea:-
txtOurRemarks.setLineWrap(true);
txtOurRemarks.setWrapStyleWord(true);
Can anyone help me out in this?
Thanks.
I would guess the problem is that you have new line characters in your output file. So you would need to replace those characters with a blank character so they appear together on a single line in Excel.

Insert comment on pdf using java

I want to insert sticky notes for particular text in existing pdf file using java.i have to search all particular words in pdf and mark it as comment. when i mouse over on comment stored words should be displayed.
can anyone help me on this..
Have a look at iText. You can add an annotation to the PDF.

Categories