You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2019/03/27 11:46:44 UTC

[Bug 63290] New: PPTX To Png changes font sizes and colors

https://bz.apache.org/bugzilla/show_bug.cgi?id=63290

            Bug ID: 63290
           Summary: PPTX To Png changes font sizes and colors
           Product: POI
           Version: 4.0.x-dev
          Hardware: Macintosh
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLF
          Assignee: dev@poi.apache.org
          Reporter: tyler_cronin@yahoo.com
  Target Milestone: ---

Created attachment 36499
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36499&action=edit
This is the power point that we use and the results from running them through
poi.

When we run a power point through the xslf it changes the font sizes and
colors. This results in the text boxes being misaligned or moved. We appreciate
any help with this.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63290] PPTX To Png changes font sizes and colors

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63290

--- Comment #8 from Andreas Beeker <ki...@apache.org> ---
(In reply to jitendra from comment #7)
> Regarding r1878492, Is there any maven release for this bug fix ?

No ... the next official release (5.0.0) won't be available for the next few
weeks, as we work on providing a modular (jigsaw) version. Either you download
a nightly and install it
(http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html) or you
download the source and call "ant mvn-install"

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63290] PPTX To Png changes font sizes and colors

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63290

Andreas Beeker <ki...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #11 from Andreas Beeker <ki...@apache.org> ---
The 5.0.0 release is due to December '20.
As this was commented as resolved - I'm now closing it.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63290] PPTX To Png changes font sizes and colors

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63290

--- Comment #2 from Axel Richter <ax...@web.de> ---
Used PowerPoint presentation, see attachment.
This only contains one text field containing one paragraph having the issue.
Used Code:

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import javax.imageio.ImageIO;
import org.apache.poi.xslf.usermodel.XMLSlideShow;
import org.apache.poi.xslf.usermodel.XSLFSlide;
import java.util.List;

public class PptToImageSimplest {
 public static void main(String args[]) throws Exception {
  FileInputStream in =new FileInputStream("PPT.pptx");
  XMLSlideShow ppt = new XMLSlideShow(in);
  //get the dimension of size of the slide
  Dimension pgsize = ppt.getPageSize();
  //get slides
  List<XSLFSlide> slides = ppt.getSlides();
  BufferedImage img = null;
  FileOutputStream out = null;
  for (int i = 0; i < slides.size(); i++) {
   img = new BufferedImage((int)Math.ceil(pgsize.width),
(int)Math.ceil(pgsize.height), BufferedImage.TYPE_INT_RGB);
   Graphics2D graphics = img.createGraphics();
   //clear the drawing area
   graphics.setPaint(Color.white);
   graphics.fill(new Rectangle2D.Float(0, 0, pgsize.width, pgsize.height));
   //render
   slides.get(i).draw(graphics);
   //creating an image file as output
   out = new FileOutputStream("ppt_image_" + i + ".png");
   ImageIO.write(img, "png", out);
   out.close();    
  }
 }
}


Problem:
Apache POI .draw(graphics) does not draw the first text run in text field
properly.
Reason:
The text field contains a paragraph which uses Default Run Properties in 
Paragraph Properties. The first text run has no Run Properties of it's own. XML
looks like:

<a:p>
 <a:pPr>
  <a:defRPr lang="de-DE" sz="4000" dirty="0" err="1" smtClean="0">
   <a:solidFill>
    <a:srgbClr val="FF0000"/>
   </a:solidFill>
  </a:defRPr>
 </a:pPr>
 <a:r>
  <a:t>DefaultRunProperties </a:t>
 </a:r>
 <a:r>
  <a:rPr lang="de-DE" sz="4000" dirty="0" err="1" smtClean="0">
   <a:solidFill>
    <a:srgbClr val="00FF00"/>
   </a:solidFill>
  </a:rPr>
  <a:t>ExplicitRunProperties</a:t>
 </a:r>
</a:p>

PowerPoint renders it so that first run inherits the defRP. But Apache POI does
not.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63290] PPTX To Png changes font sizes and colors

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63290

--- Comment #7 from jitendra <jk...@gmail.com> ---
Regarding r1878492, Is there any maven release for this bug fix ?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63290] PPTX To Png changes font sizes and colors

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63290

--- Comment #4 from jitendra <jk...@gmail.com> ---
Created attachment 37263
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37263&action=edit
generated image

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63290] PPTX To Png changes font sizes and colors

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63290

--- Comment #5 from jitendra <jk...@gmail.com> ---
Created attachment 37271
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37271&action=edit
PPTx To image through Spire java libraries

the same PPTx converted through Spire java libraries is producing the correct
output.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63290] PPTX To Png changes font sizes and colors

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63290

--- Comment #3 from jitendra <jk...@gmail.com> ---
Created attachment 37262
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37262&action=edit
PPT file used for conversion

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63290] PPTX To Png changes font sizes and colors

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63290

--- Comment #1 from Axel Richter <ax...@web.de> ---
Created attachment 37259
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37259&action=edit
PowerPoint presentation containing one text field containing one paragraph
having the issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63290] PPTX To Png changes font sizes and colors

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63290

--- Comment #6 from Andreas Beeker <ki...@apache.org> ---
applied via r1878492
various fixes to HSLF
moved line spacing to the following line
refactored PropertyFetcher with lambdas

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63290] PPTX To Png changes font sizes and colors

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63290

--- Comment #10 from jitendra <jk...@gmail.com> ---
Hi Team, May I know if there is any planned time for Apache POI 5.0 release ?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63290] PPTX To Png changes font sizes and colors

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63290

--- Comment #9 from jitendra <jk...@gmail.com> ---
I tried the 5.0 jars and it resolved the problem(text overlapping) i have
reported.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org