An EMF file made by Adobe Illustrator (I do not know which version, but it has one of the early style EMR headers) is supposed to be A4 sized and I don't understand how it could be. The file has these EMR records:
U_EMRHEADER record: 0 type: 1 offset: 0 size: 116
rclBounds: {255,-925,1377,-132}
rclFrame: {7969,-28906,43031,-4125} **350.63 x 247.82 mm**
dSignature: 0x464D4520
nVersion: 0x00010000
nBytes: 1924
nRecords: 54
nHandles: 4
sReserved: 0
nDescription: 13
offDescription: 88
Desc. A: Adobe Systems
Desc. B:
nPalEntries: 0
szlDevice: {1024,768}
szlMillimeters: {320,240}
U_EMRSETMAPMODE record: 1 type: 17 offset: 116 size: 12
iMode: 0x00000008 **MM_ANISOTROPIC**
U_EMRSETWINDOWORGEX record: 3 type: 10 offset: 140 size: 16
ptlOrigin: {0,0}
U_EMRSETVIEWPORTORGEX record: 4 type: 12 offset: 156 size: 16
ptlOrigin: {0,0}
U_EMRSETWINDOWEXTEX record: 5 type: 9 offset: 172 size: 16
szlExtent: {10104,7143}
U_EMRSETVIEWPORTEXTEX record: 6 type: 11 offset: 188 size: 16
szlExtent: {3368,2381}
The rclFrame fields normally set the page size but A4 is 297 x 210 mm, not 350.63 x 247.82 mm. However 350.63 x 247.82 is the correct ratio for A4. The only way I could finagle an A4 size out of these numbers was by treating the rclFrame values as MM_HIENGLISH and then using the 1/3 scale factor from EMRSETWINDOWEXTEX/EMRSETVIEWPORTEXTEX this way:
35.063" * 1/3 = 11.69"
24.782" * 1/3 = 8.26"
But that would mean that the program could not determine the size of the page until it had seen those latter two records. Also nowhere could I find any documentation that said this sort of thing goes on.
Can anybody shed some light on this?
I think your EMF may contain more information than is indicated by the diagnostic dump. The supplied EMR_HEADER record has nVersion set to 0x00010000 so the record aditionally contains these fields starting after szlMillimeters:
The values of these fields are missing from the supplied diagnostic dump. Here's a hex dump from the head of an XP emf file I had on my machine:
In this snippet, the szlMicrometers field is the last pair of DWORDs. Their values are 0x00033450, 0x00048828, and expressed in decimal in thousandths of a mm these values are 210000, 297000