#1 2013-08-06 10:54:32

aweste
Member
Registered: 2013-07-16
Posts: 11

EMR_SMALLTEXTOUT not implemented

To convert from EMF to PDF, I need the record type EMR_SMALLTEXTOUT. Has a special reason why this type is missing?
In any case I already looked like the record type is defined. Here a EMF-file.

type
  TEMRSmallTextOut1 = packed record
    TypeId: Cardinal;
    Size: Cardinal;
    x: Integer;
    y: Integer;
    cChars: Cardinal;
    fuOptions: Cardinal;
    iGraphicsMode: Cardinal;
    exScale: Single;
    eyScale: Single;
    text: Byte;
  end;
  PEMRSmallTextOut1 = ^TEMRSmallTextOut1;

  TEMRSmallTextOut2 = packed record
    TypeId: Cardinal;
    Size: Cardinal;
    x: Integer;
    y: Integer;
    cChars: Cardinal;
    fuOptions: Cardinal;
    iGraphicsMode: Cardinal;
    exScale: Single;
    eyScale: Single;
    Bounds: TRect;
    text: Byte;
  end;
  PEMRSmallTextOut2 = ^TEMRSmallTextOut2;

MSDN:

If ETO_SMALL_CHARS is set in the fuOptions field, TextString contains 8-bit codes for characters, derived from the low bytes of 16-bit UnicodeUTF16-LE character codes, in which the high byte is assumed to be 0.

If ETO_NO_RECT is set in the fuOptions field, the Bounds field is not included in the record.

ETO_SMALL_CHARS=$100
ETO_NO_RECT=$200

Offline

#2 2013-08-06 11:18:56

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,237
Website

Re: EMR_SMALLTEXTOUT not implemented

Those are un-documented (at least until recently) low-level EMF records.
The EMF streams which are used in the Windows SPL - Microsoft® Windows Spool File Format files, include various undocumented records.
See http://www.undocprint.org/formats/winspool/emf

We did not include it, since the VCL canvas won't generate such content.

A least those records may occur:
EMREXTCREATEFONTINDIRECTW
EMREXTESCAPE
EMRSMALLTEXTOUT

The structure may change depending on the operating system version it runs on...

Definitively working with EMF content generated by the Windows printer spooler is a challenge...

Offline

Board footer

Powered by FluxBB