How display text fits with the width of column?

2018-11-29 Thread paoim101084
In Power point, I have a table with 4 rows and 6 columns. For example: ID, Name, Description, Price, Percent, Current Value 123,Car, It is new car in 2019, $4, 88%, $38000 How to make text fit to each columns? -- Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html --

How to truncate Text in Cell of XSLFTableCell

2018-11-29 Thread paoim101084
If the text is longer than cell's width then we can truncate it. Do you have any idea? -- Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html - To unsubscribe, e-mail: user-unsubscr...@poi.apache.org For a

Re: XSLF copy slides

2018-12-17 Thread paoim101084
Here is what I did: import java.io.FileInputStream; import java.io.FileOutputStream; import org.apache.poi.xslf.usermodel.XMLSlideShow; import org.apache.poi.xslf.usermodel.XSLFSlide; import org.apache.poi.xslf.usermodel.XSLFSlideLayout; import org.apache.poi.xslf.usermodel.XSLFSlideMaster; publi

Re: How display text fits with the width of column?

2018-12-17 Thread paoim101084
Do you know how to autoResize the column in XSLFTable? I got painful when I use XSLFTable. I cannot calculate the exact table height. -- Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html - To unsubscri

Re: XSLF copy slides

2018-12-18 Thread paoim101084
Well, I try with 4.0.1, I still got error: java.lang.ClassCastException: org.apache.poi.ooxml.POIXMLDocumentPart cannot be cast to org.apache.poi.xslf.usermodel.XSLFPictureData at org.apache.poi.xslf.usermodel.XSLFSheet.importBlip(XSLFSheet.java:651) at org.apache.poi.xslf.usermode

Re: How display text fits with the width of column?

2018-12-18 Thread paoim101084
Yes, I have two issues when I used XSLFTable. 1. Display text does not fit with column. For example, less text should display in small column. long text should display in big column. 2. Calculate table's height, so I can display two or more tables in the same slide. I mean after display one table

Re: How display text fits with the width of column?

2018-12-18 Thread paoim101084
@Kiwiwings: Now I have modified your code to make similar on what I did in actual project. Here is the whole demo code: import java.awt.Color; import java.awt.geom.Rectangle2D; import java.io.FileOutputStream; import java.util.Collections; import java.util.List; import java.util.stream.Collectors;

Re: How display text fits with the width of column?

2018-12-18 Thread paoim101084
Hi Andi, Thank for detail explanation. I am looking forward to getting the @2. -- Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html - To unsubscribe, e-mail: user-unsubscr...@poi.apache.org For addition

Re: XSLFTextRun definition

2018-12-18 Thread paoim101084
Do you know to add custom font to XSLFTextRun? For example, I have font file with extension '.ttf'. Currently, I did like this: XSLFTextParagraph p =... XSLFTextRun r = p.addNewTextRun(); r.setFontFamily("input/myfont.ttf"); Please advise? -- Sent from: http://apache-poi.1045710.n5.nabble.co

Re: XSLFTextRun definition

2018-12-18 Thread paoim101084
1. Register Font Font font = Font.createFont(Font.TRUETYPE_FONT, new File("input/myfont.ttf")); GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); ge.registerFont(font); String[] names = ge.getAvailableFontFamilyNames(); 2. Set font name as font family: XSLFTextParagraph p

Re: XSLFTextRun definition

2018-12-18 Thread paoim101084
Hi Andi, Thank for your detail information. Yes, I want to calculate the table height. Could you help to provide some idea about that? Here is what I did but it seems not work well: static void calculateTableHeight(XSLFTable tab, Rectangle2D anchor) {//FIXME - issue? double total

Re: XSLFTextRun definition

2018-12-21 Thread paoim101084
Hi Andi, When will be available for those updated? For 4.x.x version, I cannot find these methods: XSLFTable tab =... tab.removeRow(.) tab.updateCellAnchor() ... Anywhere, thank for those things. Well, great if *XSLFTable* or *Slide* can know if /content/ fits with one *slide* and then /remain

Re: XSLFTextRun definition

2019-01-03 Thread paoim101084
Hi Andi, I have used a nightly [1] and run your program [2], I found description displays out of red bordered box. I think calculation of: XSLFSlide slide =... // a red bordered box in the background, to show/verify the table dimensions XSLFAutoShape as = slide.createAutoShape(); as.setShapeType(S

Re: XSLFTextRun definition

2019-01-03 Thread paoim101084
Hi Andi, I am so happy because we can render table into different slides. Thanks for your efforts. Here is what I have: 1. Java 1.8 2. Use system font - I did not change 3. Operating system: window 10 Sorry, I just make the code can run like this: import java.awt.Color; import java.awt.geom.Re

Re: XSLFTextRun definition

2019-01-03 Thread paoim101084
Hi Andi, Thank for providing more details. Well, I am looking forward to getting new release on February. Thanks -- Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html - To unsubscribe, e-mail: user-unsu

How to add image's width and height in XSLFTableCell

2019-01-17 Thread paoim101084
Hi, I have read the tip from: https://stackoverflow.com/questions/14495288/how-to-add-image-to-powerpoint-ppt-table-cell-using-apache-poi-hslf-xslf I can add image in XSLFTableCell but I don't know how to that image bigger. Here is what I did: import java.awt.geom.Rectangle2D; import java.io.Fil