You are not logged in.
Pages: 1
When calling RenderMetaFile directly, parameter DisableTextClipping is overriding DisableMetaFileTextClipping property:
procedure RenderMetaFile(MF: TMetaFile; Scale: Single=1.0;
XOff: single=0.0; YOff: single=0.0;
TextPositioning: TPdfCanvasRenderMetaFileTextPositioning=tpSetTextJustification;
KerningHScaleBottom: single=99.0; KerningHScaleTop: single=101.0;
DisableTextClipping: boolean=false);
So you can use:
Pdf.Canvas.RenderMetaFile(aMeta, 1, 0, 0, Pdf.UseMetaFileTextPositioning, Pdf.KerningHScaleBottom, Pdf.KerningHScaleBottom,
Pdf.DisableMetaFileTextClipping);
Hi
Seems that missing lines are hidden under filled rectangles.
We tried play with EMR_BITBLT and PATCOPY handling inside EnumEMFFunc, but no success yet:
with PEMRBitBlt(R)^ do begin
if(cyDest<0) then //seems that negative cyDest needs different handling
E.FillRectangle(Rect(xDest,yDest+cyDest,xDest+cxDest,yDest)) //sometimes better, sometimes worse (hidden "bottom" lines)
//E.FillRectangle(Rect(xDest,yDest+cyDest-1,xDest+cxDest,yDest-1)) //another variant
else
E.FillRectangle(Rect(xDest,yDest,xDest+cxDest,yDest+cyDest)); //original
//TODO: lines (horizontal and vertical) are sometimes missing in PDF.
//Create simplest EMF test case for reproducing, compare EMF and PDF
// check negative cyDest
// check coordinates transforming and rounding
// maybe should handle PEMRBitBlt(R)^.rclBounds as cliprect there?
// are pen color and / or mode properly handled there?
end
Had no time to investigate, used quick workaround (with side effects, but acceptable for us):
TPdfCanvas = class(TObject)
...
public
FillRectIgnoreColor: TColor; //default: clNone, QuickReport: clWhite
...
procedure TPdfEnum.FillRectangle(const Rect: TRect);
begin
if DC[nDC].brush.color = Canvas.FillRectIgnoreColor then exit; //do not draw rectangles filled with specified (white) color
//if (Canvas.FillRectIgnoreColor<>clNone) and (DC[nDC].brush.color = Canvas.FillRectIgnoreColor) then exit; //maybe this variant is more correct...
....
Hi
We had same problem with SynPDF metafile rendering under Wine (OS X): no text visible, only lines.
Looks like there is something wrong with text clipping handling. Quick workaround was switching it off:
procedure TPdfEnum.TextOut(var R: TEMRExtTextOut);
...
// detect clipping
//with R.emrtext.rcl do // original code
//WithClip := (Right>Left) and (Bottom>Top); // original code
WithClip := false; // workaround for Wine
...
Pages: 1