Sign In  Sign Up Live-Chat

Problem rendering EMF

Last post 08-05-2008, 8:55 AM by Worker. 7 replies.
Sort Posts: Previous Next
  •  06-24-2008, 12:28 PM 132820

    Problem rendering EMF

    Attachment: Present (inaccessible)

    We are evaluating Aspose.Metafiles alongside Aspose.Slides for Java and we like what we see.  However, we ran into the following and would like your input.

    In testing with some powerpoint presentations that need to be supported, we came across a presentation with an embedded EMF that could not be rendered.  I extracted the file from the presentation (using Aspose.Slides) and ran some tests on it.

    The file can be rendered by the Microsoft Picture and Fax Viewer and opened in Microsoft Paint, but Aspose.Metafiles seems to have some problems.  Rendering the image as a png gives "java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds!", and rendering it as a jpeg works, but has incorrect colors and positioning/clipping.

    I have attached the EMF, as well as the java code used to convert it to png and jpeg.

     
  •  06-24-2008, 9:28 PM 132916 in reply to 132820

    Re: Problem rendering EMF

    Hello Worker,

    We will investigate and fix it asap. Thank you for the information.

    Alexey Zhilin
    Team Leader
    Aspose Tyumen Team
    About Us
    Contact Us
     
  •  07-07-2008, 10:55 AM 134563 in reply to 132916

    Re: Problem rendering EMF

    Have you made any progress on this issue?
     
  •  07-07-2008, 6:11 PM 134626 in reply to 134563

    Re: Problem rendering EMF

    Sorry, hotfix isn't ready yet.
    As a temporal workaround you can use the following code:
                BufferedImage image = new BufferedImage(
                            (int)(mfile.getWidth() + 0.5),
                            (int)(mfile.getHeight() + 0.5),
                            BufferedImage.TYPE_3BYTE_BGR);
                Graphics2D graphics = image.createGraphics();
                AffineTransform trans = AffineTransform.getTranslateInstance(-mfile.getMinX(), -mfile.getMinY());
                mfile.playMetafile(graphics, trans);
                javax.imageio.ImageIO.write(image, format, out);




    Nikolay Kuzmin
    Developer
    Aspose Tyumen Team
    About Us
    Contact Us
     
  •  07-08-2008, 10:18 AM 134766 in reply to 134626

    Re: Problem rendering EMF

    I'm not in urgent need of a hotfix (yet). Knowing that you've found the problem and are working on a fix is good enough for now.

    Thank you!
     
  •  07-19-2008, 4:54 AM 136178 in reply to 134766

    Re: Problem rendering EMF

    Hello Worker.
    Please check Aspose.Matafiles 1.3.0.0, it should fix your issue with createDefaultRendering().
    Nikolay Kuzmin
    Developer
    Aspose Tyumen Team
    About Us
    Contact Us
     
  •  07-22-2008, 11:33 AM 136479 in reply to 136178

    Re: Problem rendering EMF

    Attachment: Present (inaccessible)
    This new version does indeed fix the output of my testcase. Thank you.

    Unfortunately, it does not fix my problem. My problem is that this metafile appears in a powerpoint presentation, and that rendering the slide with that metafile to an image does not work correctly.

    I have attached the presentation that includes the metafile. I have also attached the code I used to generate an image, which is a modified version of the sample code that comes with Aspose.Slides.

    If I should re-ask this question in the Aspose.Slides forum, please let me know.
     
  •  08-05-2008, 8:55 AM 138389 in reply to 136479

    Re: Problem rendering EMF

    It appears that the updated Aspose.Metafiles combined with Aspose.Slides for Java 1.8.5.0 completely resolved this issue. Thank you!
     
View as RSS news feed in XML