Menu

#37 Issue rendering EMF files with PlayEnhMetaFile

2.0
closed
nobody
None
2022-10-06
2021-12-01
No

I've been testing out the library and I found issues when trying to draw .emf files with PlayEnhMetaFile. Please see the image/code attached. The image is a simple circle, but it is not being drawn in the final PDF. Thought the image might be the issue, but I am able to render it on a simple desktop application.

Thanks!

2 Attachments

Related

Tickets: #43

Discussion

  • Don Perignon

    Don Perignon - 2021-12-01

    There seem to be an issue with EMR_SELECTCLIPPATH. If I comment out the code in it, the image renders fine

     

    Last edit: Don Perignon 2021-12-01
  • zyx

    zyx - 2021-12-02

    Thanks for a bug report and test data. If I recall correctly, the EMF uses world transformation matrix, which the litePDF doesn't work well with. It's a known limitation of the litePDF. I'll give this some testing when I find time and I'll update this report .

     
  • zyx

    zyx - 2021-12-12

    The problem was truly with the world transformation matrix, it scales and moves the content, but it was not applied when constructing the clip region. I added that in [r29].

     

    Related

    Commit: [r29]

  • zyx

    zyx - 2021-12-12
    • status: open --> closed
     
  • zyx

    zyx - 2022-08-13
    • status: closed --> open
     
  • zyx

    zyx - 2022-08-13

    I'm reopening this. The change for this broke a test case from the [#43].

     

    Related

    Tickets: #43

  • zyx

    zyx - 2022-08-13

    Could you give a try to this test build in your environment/with your data, please?

    I reverted the previous commit and made different approach. The EMF file sets an "almost identity" world transformation matrix, which confuses the code. I made the code less strict about the values, considering matrix within 1e-2 as identity.

    It's a known limitation of the litePDF, it doesn't work well with the world transformations.

     
  • ralf stocker

    ralf stocker - 2022-08-13

    Great! Its works.

     
    • zyx

      zyx - 2022-08-13

      Thanks for a quick test. I'd like to wait for Don's response too, in case his environment/data is different. The test .emf from the description seems to work properly here as well (I can see the circle in the resulting PDF).

      I will make a new release (around) the next week, unless I'm proved of any bad side effects with the test dll.

       
  • zyx

    zyx - 2022-08-21

    I just made a 2.0.5.1 release with these changes.

    I need to rethink the whole world transformation matrix situation, because what the Inkscape does (and EMF) is that it wants the drawing to be slightly smaller, which the litePDF currently ignores. The best would be to draw to the litePDF's HDC directly, not using the EMF as the intermediate format, whenever possible.

    In any case, the world transformation matrix situation requires significant amount of time, not only for the coding, but also for the testing, because it will affect the core drawing routines of the litePDF, thus do not expect anything soon in this regard.

     
  • zyx

    zyx - 2022-08-21
    • status: open --> closed
     
  • ralf stocker

    ralf stocker - 2022-08-22

    Many thanks. The DLL from sdk 2.0.5.1 still works.

     
  • Don Perignon

    Don Perignon - 2022-10-06

    I'm sorry for the delay! I've tested it and it works on my side. Thank you for helping with this :)
    Cheers!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.