Book a Demo

Author Topic: Diagram rendering  (Read 9973 times)

ChrisMW

  • EA User
  • **
  • Posts: 90
  • Karma: +2/-0
    • View Profile
Diagram rendering
« on: November 07, 2016, 06:43:55 am »
I stumbled across some inconsistencies when sharing models across many PC. see http://sparxsystems.com/forums/smf/index.php/topic,37372.msg234319.html#msg234319

Turns out that most can be solved by switching the alphabetic ordering option off. Perhaps an idea to make this a project setting rather than global. Anyway, the problem is how windows 7 renders the diagram. I have compared the rendering between Wine (32bit prefix set to Windows 7) and a Virtualbox Windows 7 64bit client. And it doesn't make sense, but Wine does this much better than Windows 7. Much.

In each case I render the same diagram, using publish image to file. I save as WMF. Both cases it is the same EA13 version.
Under the Windows 7 64bit Virtualbox client:

The export under Wine yields:


The difference is very noticable when you look at the details, here's an element from the Windows 7 render:


Now look at the one done under Wine:


Clearly the Wine environment is doing a better job.

However, when you select JPG as the format, you get the same image:


I've noticed the same when you render a diagram to Word, and then save to PDF. Under Office 10 it doesn't look so good, but it looks very good once it is a PDF. The EMF from the Win 7 image is like the JPG, but fails from Wine, it writes a file, but irfanview says it can't find the fikle header. So WMF is off, EMF doesn't work for me under wine and JPG seems fine. Any suggestions on why EMF fails under Wine? And what can be done about the WMF creation under Windows 7?
« Last Edit: November 12, 2016, 07:41:31 am by ChrisMW »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Diagram rendering
« Reply #1 on: November 07, 2016, 09:22:04 am »
The short answer is that wine has never dealt with metafiles really well, and that the tool used to display the metafiles has just as large an impact.

An EMF from Windows 7 will likely include GDI+ instructions, which will allow tools that support GDI+ to render the metafile nicer, but it can make things worse for tools that don't.

ChrisMW

  • EA User
  • **
  • Posts: 90
  • Karma: +2/-0
    • View Profile
Re: Diagram rendering
« Reply #2 on: November 07, 2016, 06:21:38 pm »
Ok, so that means EMF under wine is not going to be pretty. I can live with that. My concern is more with the Windows 7 rendering of WMF, which seems at odds with how it renders EMF/JPG, both of which yield the same result as WMF/JPG under wine. Only the WMF on Windows 7 seems off.

ChrisMW

  • EA User
  • **
  • Posts: 90
  • Karma: +2/-0
    • View Profile
Re: Diagram rendering
« Reply #3 on: November 07, 2016, 07:59:59 pm »
The EMF problem is simple to solve, I unchecked the GDIPlus metafile setting and EMF works fine under Wine. What remains is the odd rendering of the WMF under Windows 7.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Diagram rendering
« Reply #4 on: November 08, 2016, 08:25:45 am »
Why do you need WMF? WMF supports only a subset of what is available in EMF.

ChrisMW

  • EA User
  • **
  • Posts: 90
  • Karma: +2/-0
    • View Profile
Re: Diagram rendering
« Reply #5 on: November 08, 2016, 11:23:05 pm »
I was using WMF instead of EMF due to EMF's getting messed up under Wine. I've solved that, but noticed that WMF's under Wine are better than under Windows 7. All the diagrams written to file show the same pixel dimension, except for WMF under Windows 7. I'm not sure what is causing it, but I've seen diagrams render badly on reports. For instance, if create a document in RTF/DOCX and look at the diagrams, the names are rendered somewhat like the WMF under windows 7. When I save that document to PDF, and look at the PDF, it looks so much better.

I've made a screen shot of this effect, here's a screen shot of the report in Word, zoomed in, notice how the letters get 'mushed' together:

Now see the same bit of the report, the only thing I altered was to save the RTF to a PDF and open the PDF. To me, this is what I would like to see in Word:


Before I assumed that it was Word mucking it up, but now I'm not so sure, perhaps what I see with WMF is related to this. Is there a way I can force the reporting to render using a specific format? But this looks very similar to

compared to


Perhaps it's something specific to my Windows 7, but I still think it should not matter WMF/EMF/JPG. But only the WMF under Windows 7 comes out at 1124x1002, all the other machines/formats render the diagram as 1784x1137. Something is causing the incorrect dimensioning of the WMF under windows, which doesn't occur under Wine. 
« Last Edit: November 08, 2016, 11:24:43 pm by ChrisMW »

ChrisMW

  • EA User
  • **
  • Posts: 90
  • Karma: +2/-0
    • View Profile
Re: Diagram rendering
« Reply #6 on: November 17, 2016, 09:17:32 pm »
I've not tried switching the default settings to render using Bitmap (the default option being Metafile), or using the RTF generator (which allows a more refined set of graphic formats, but I have a workaround which seems to work for me at least. Install LibreOffice and use that to edit the rtf, export to PDF. All my diagram issues have completely gone. It works under Wine just as well. I still think there's something not right, as irFanview and MS Word 2013 still produce ugly diagrams. And one my last attempt, saving as PDF caused many lines to disappear (something I read about in other posts as well).

However, Libreoffice renders the images in the rtf very nicely, and exports the PDF perfectly. Best of all, it's free, and works under Wine (something MS Office is not that good at, the older the better) so I can use the same approach regardless of the environment.

I'll keep Word for the .doc / .docx stuff, but am switching the .rtf association. If you have noticed similar issues, you might want to try this.