Ingo
Ingo

Reputation: 53

devEMF output display problems in MS Word 2010 after Microsoft update

After 2-4 Microsoft updates on June, 12th the display of devEMF (an R printing device for EMF/EMF+ files) output is corrupted in MS Word 2010.

The problem occurs on machines with the most recent Microsoft updates installed and does not where KB890830, KB4503292,KB4503286 and KB4461619 are not installed. I tried on Windows 10 and Windows 7. All of the updates in question I would consider as security updates, so I guess the devEMF files somehow look suspicious to MS Word after the update but not before. An EMF created with an other Program is displayed correctly. I tried with EMF and EMF+, both of them displayed corrupted.

The following R-code produces a file, that is displayed correctly in libreOffice but corrupted in MS Word 2010 with the latest MS updates

require(devEMF)
emf("test.emf")
  plot(x=c(0,2),y=c(0,2))
  text(x=1,y=1,"This is a test figure")
dev.off()

Some (like this test image) are simply not displayed at all (I just get a very shallow frame of the image size), in others only few elements (/layers?) are displayed, often with a red cross and some meta information about the file (like in the following screen shot).

this is a typical corrupted display of the images. Axes are not labeled or not displayed at all, metainformation is readable at top left My question is... (beside I would really like those emfs to be displayed correctly in my hundreds of pages and figures long document): Is Word now too concerned or is there a (hopefully small) correction needed for the devEMF package to make it more safe?

Upvotes: 1

Views: 839

Answers (2)

Ingo
Ingo

Reputation: 53

In the mean time I had contact to the developer of devEMF and the solution (for now) is to produce a "full" emfPlus file with

emf( ... , emfPlus=TRUE, emfPlusFont=TRUE, emfPlusRaster =TRUE)

Files, which are produced with those tags, display correctly.

EDIT: Microsoft announced to release a patch for the guilty security patch: https://social.msdn.microsoft.com/Forums/en-US/a0af7c55-7f13-4a6a-ac41-3c7a2a09d8f5/emf-graphics-specification-amp-security-patch

Upvotes: 1

msohn
msohn

Reputation: 336

As I already mentioned on the german answers.microsoft.com: it seems KB4503292 disabled EMF records of type EMR_EXTCREATEFONTINDIRECTW which only contain a LogFont structure and not a LogFontExDv, even though this is still documented as being supported:

https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-emf/7e266b6d-32e5-4201-b687-8ec40c24cd73

elw (variable): A LogFontExDv object (section 2.2.15), which specifies the logical font. A LogFont object (section 2.2.13) MAY<74> be present instead. The process for determining the type of object in this field is described below.

Up until now the only place where I found this explanation was

https://social.msdn.microsoft.com/Forums/en-US/a0af7c55-7f13-4a6a-ac41-3c7a2a09d8f5/emf-graphics-specification-amp-security-patch?forum=os_specifications

Upvotes: 1

Related Questions