Re: POI 3.17 Problems with border and fill styles in generating XSSF/xlsx files, viewed in MS Office 365 ProPlus

2018-03-06 Thread Mark Murphy
The Cell Style overrides the Row Style. When you are setting a style in
POI, no new styles are created. The style being set is used as is. Be
careful of changing your style after you have used it. The change will
affect every cell that the style has been applied to. Instead I manually
create all the styles I will need, and apply the appropriate style to the
cell. This seems a little brute force, but performs significantly better.

On Tue, Mar 6, 2018 at 12:58 PM, Dagnon, William 
wrote:

> Perfect, thank you for the explanation and details - it worked!
>
> There is still the oddity about:
> > row.setRowStyle(codeFill)
> Only affecting cells AFTER the last one I created in the row.  I've been
> using a limited work-around.
>
> Lastly: are row and cell styles ever combined/aggregated as they would be
> in Excel? Eg. if I set a row style with a background and a cell style with
> a border, will the cell have the background and the border, or do I need to
> specify the cell's style with the background as well for it to not get
> overwritten depending on what order I set them?
>
> Thanks!
>
> CONFIDENTIALITY NOTICE: This e-mail, including any attachments, may
> contain confidential, privileged and/or proprietary information which is
> solely for the use of the intended recipient(s). Any review, use,
> disclosure, or retention by others is strictly prohibited. If you are not
> an intended recipient, please contact the sender and delete this e-mail,
> any attachments, and all copies.
>


RE: POI 3.17 Problems with border and fill styles in generating XSSF/xlsx files, viewed in MS Office 365 ProPlus

2018-03-06 Thread Dagnon, William
Perfect, thank you for the explanation and details - it worked!

There is still the oddity about:
> row.setRowStyle(codeFill)
Only affecting cells AFTER the last one I created in the row.  I've been using 
a limited work-around.

Lastly: are row and cell styles ever combined/aggregated as they would be in 
Excel? Eg. if I set a row style with a background and a cell style with a 
border, will the cell have the background and the border, or do I need to 
specify the cell's style with the background as well for it to not get 
overwritten depending on what order I set them?

Thanks!

CONFIDENTIALITY NOTICE: This e-mail, including any attachments, may contain 
confidential, privileged and/or proprietary information which is solely for the 
use of the intended recipient(s). Any review, use, disclosure, or retention by 
others is strictly prohibited. If you are not an intended recipient, please 
contact the sender and delete this e-mail, any attachments, and all copies.


Background color missing when converting Powerpoint to PNG

2018-03-06 Thread fridayeva
Hi,

I am using 3.17, trying to convert a PPT file to PNG, but some page preview
image is missing background colors while others work fine. Similar things
happens for PPTX files. The image background theme is black but it is
supposed to be blue.

My code to generate page preview is :

public BufferedImage pdPageToBufferedImage(int pageNumber, int height, int
width) {
BufferedImage img = new BufferedImage(width, height,
BufferedImage.TYPE_INT_RGB);
Graphics2D graphics = img.createGraphics();
//here I give examples for PPT files, for PPTX it is XSLFSlide instead of
HSLFSlide, rest code is same.
HSLFSlide slide = presentation.getSlides().get(pageNumber);
graphics.setPaint(Color.white);
graphics.fill(new Rectangle2D.Float(0, 0, width, height));
slide.draw(graphics);
return img;
}


Also, I have attached the two comparison images to show the difference. Left
is png view, and right is powerpoint view.

 



 

Thanks.



--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html

-
To unsubscribe, e-mail: user-unsubscr...@poi.apache.org
For additional commands, e-mail: user-h...@poi.apache.org