#2 mORMot 2 » Wrong font style in EMF » 2025-04-28 14:40:08

Juergen_Bauer
Replies: 1

Hello,

I came aross another issue when I convert a EMF file to PDF.
In the attached EMF file, the text "Witterung" etc. is printed in normal style - but the created PDF produces these text parts in bold.

Any ideas how I can solve this issue?

Thanks a lot!

Sample EMF file as ZIP file

#3 Re: mORMot 2 » Missing EMR_ALPHABLEND in mormot.ui.pdf » 2025-04-16 11:48:09

Hello,
thanks for the reply.

I managed to get it working on my side with the following code:

      EMR_ALPHABLEND:
        begin
          ARect := PEMRAlphaBlend(R)^.rclBounds;

          with PEMRAlphaBlend(R)^ do // only handle RGB bitmaps (no palette)
            if (offBmiSrc <> 0) and
               (offBitsSrc <> 0) then
            begin
              E.DrawBitmap (xSrc, ySrc, cxSrc, cySrc, xDest, yDest,
                cxDest, cyDest, iUsageSrc, pointer(PtrUInt(R) + offBmiSrc),
                pointer(PtrUInt(R) + offBitsSrc), @PEMRAlphaBlend(R)^.rclBounds,
                @PEMRAlphaBlend(R)^.xformSrc, SRCCOPY, PEMRAlphaBlend(R)^.dwRop);
            end
            else
              case PEMRBitBlt(R)^.dwRop of // we only handle PATCOPY = fillrect
                PATCOPY:
                  with PEMRBitBlt(R)^ do
                    E.FillRectangle(Rect(xDest, yDest,
                      xDest + cxDest, yDest + cyDest), true);
              end;
        end;

In difference to the previous code, the parameters of the call "DrawBitmap" were changed.
Now the image is correctly shown in the created PDF :-).

#4 mORMot 2 » Missing EMR_ALPHABLEND in mormot.ui.pdf » 2025-04-15 12:17:08

Juergen_Bauer
Replies: 3

Hello,
I would love to use the great PDF creating component as I create EMF files in my application and need to convert them into PDF.
Unfortunately, when I paint a TWicImage on my MetaFileCanvas and want to convert it, is uses the EMR_ALPHABLEND call which is not yet implemented.

Any idea how to fix this?

I already tried to implement it on my own - but the image does not find its way into the PDF ...

Thanks a lot!

#5 Re: PDF Engine » Converting EMF content containing the Calibri font to PDF » 2025-02-07 12:46:07

Hello,
as you already stated:
The two characters "ft" are transformed into one character. This is called ligature.

I create the EMF files myself - so that is the reason why I know that the content is created via ExtTextout.
The Delphi code looks like this:
              ExtTextout (Preview.Canvas.Handle, nXPos, nYPos, ETO_GLYPH_INDEX, nil, PChar(FontObjects.GR.lpGlyphs), FontObjects.GR.nGlyphs, PInteger(FontObjects.GR.lpDx))

I use the current SynPDF version (1.18).

Thanks a lot!

#7 Re: PDF Engine » Converting EMF content containing the Calibri font to PDF » 2025-02-06 16:31:10

Hello,
I just set this option - without success :-(.
Unfortunately, I cannot attach the small sample EMF file ...

#8 PDF Engine » Converting EMF content containing the Calibri font to PDF » 2025-02-06 15:58:40

Juergen_Bauer
Replies: 7

Hello,

I would like to use your great component to convert EMF content to PDF.
But when the EMF file contains text with the font Calibri and is printed via:
   ExtTextout (Preview.Canvas.Handle, nXPos, nYPos, ETO_GLYPH_INDEX, nil, PChar(FontObjects.GR.lpGlyphs), FontObjects.GR.nGlyphs, PInteger(FontObjects.GR.lpDx))

the resulting PDF file "looses" some characters.
So if I print the German word "Auftrag", the PDF contains only "Au rag" ...

Any ideas?

Thanks a lot!

Board footer

Powered by FluxBB