#1 PDF Engine » Problem with HorizontalScaling » 2014-10-04 17:08:22

krzbor
Replies: 0

I noticed that the printed text (from QRP) contains errors. Some of texts are wrong stretched. I changed the code. I moved
    case Positioning of
    tpSetTextJustification:
      if nspace>0 then
        Canvas.SetWordSpace(0);
    tpKerningFromAveragePosition:
      if hscale<>100 then
        Canvas.SetHorizontalScaling(100); //reset hor. scaling
    end;
to a new position:

   Canvas.EndText;
{    case Positioning of                                        //  <<<< I removed it from this position
    tpSetTextJustification:
      if nspace>0 then
        Canvas.SetWordSpace(0);
    tpKerningFromAveragePosition:
      if hscale<>100 then
        Canvas.SetHorizontalScaling(100); //reset hor. scaling
    end;}
    // handle underline or strike out styles (direct draw PDF lines on canvas)
    if font.LogFont.lfUnderline<>0 then
      DrawLine(Posi, aSize / 8 / Canvas.GetWorldFactorX / Canvas.FDevScale);
    if font.LogFont.lfStrikeOut<>0 then
      DrawLine(Posi, - aSize / 3 / Canvas.GetWorldFactorX / Canvas.FDevScale);
    // end any pending clipped TextRect() region
    if WithClip or (not DC[nDC].ClipRgnNull) then begin
      Canvas.GRestore;
      fFillColor := -1; // force set drawing color
    end;

    case Positioning of                                        // <<<< and I moved here (after Canvas.GRestore)
    tpSetTextJustification:
      if nspace>0 then
        Canvas.SetWordSpace(0);
    tpKerningFromAveragePosition:
      if hscale<>100 then
        Canvas.SetHorizontalScaling(100); //reset hor. scaling
    end;
   
    if (not Canvas.FNewPath) then begin


Is this a good solution?

#2 PDF Engine » Print QRP » 2014-10-03 22:12:11

krzbor
Replies: 0

I have a very simple report (3 lines - the two lines overlap) format QRP and emf:
http://www.geoportal2.pl/syn/meta1.emf
http://www.geoportal2.pl/syn/report3.qrp
and result:
http://www.geoportal2.pl/syn/metafilepdf.pdf
In the pdf file is visible only one line. What is the reason for the error?
I fixed program code - commented out three lines:

   EMR_LINETO: begin
     E.NeedPen;
// If (not E.Canvas.FNewPath) and not Moved Other
       E.Canvas.MoveToI (Position.X, Position.Y);
     E.Canvas.LineToI (PEMRLineTo (R) ^. Ptl.X, PEMRLineTo (R) ^. Ptl.Y);
     Position: = PEMRLineTo (R) ^. Loop;
     Moved: = false;
     E.fInLined: = true;
// If not then E.Canvas.FNewPath
// If not then pen.null
         E.Canvas.Stroke
   end;

After commenting lines this report and other print properly. I do not know if this is a good solution.

Board footer

Powered by FluxBB