#2 Re: PDF Engine » Vertical lines are missing randomaly in QReport + QRShape » 2015-01-07 09:10:57

I had the same problem with missing lines using FastReport and this PDF engine.

My fix for this:

function EnumEMFFunc(...)
...
  EMR_BITBLT: begin
   ...
    case PEMRBitBlt(R)^.dwRop of // we only handle PATCOPY = fillrect
      PATCOPY:
        with PEMRBitBlt(R)^ do
        begin
          E.FillRectangle(Rect(xDest,yDest,xDest+cxDest,yDest+cyDest));
          E.Canvas.fNewPath := false;  // Reset fNewPath witch is set in FillRectangle
        end;
    end;
  end;
  EMR_STRETCHBLT: begin
   ...
    case PEMRStretchBlt(R)^.dwRop of // we only handle PATCOPY = fillrect
      PATCOPY:
        with PEMRStretchBlt(R)^ do
        begin
          E.FillRectangle(Rect(xDest,yDest,xDest+cxDest,yDest+cyDest));
          E.Canvas.fNewPath := false;    // Reset fNewPath witch is set in FillRectangle
        end;
    end;
  end;

fNewPath cannot be reseted inside FillRectangle because it is used in other situations where path matter.

#3 Re: PDF Engine » FastReport PDF export using SynPDF » 2015-01-06 09:30:59

rposeika wrote:

-I have also encountered the following issues or did not know how to make work, which I corrected, or got to work by slight code changes.
--I will post solutions later.

1. PaperSize from FR Report not coming through to the synPDF doc
2. Paper Orientation (Landscape or portrait) was not getting updated (was always portrait)

Set the right PaperSize in TfrxSynPDFExport.StartPage:

procedure TfrxSynPDFExport.StartPage(Page: TfrxReportPage; Index: Integer);
begin
  inherited;

  case Page.PaperSize of
    DMPAPER_LETTER,
    DMPAPER_LETTERSMALL:  PdfDocument.DefaultPaperSize := psLetter;
    DMPAPER_LEGAL:        PdfDocument.DefaultPaperSize := psLegal;
    DMPAPER_A3:           PdfDocument.DefaultPaperSize := psA3;
    DMPAPER_A4,
    DMPAPER_A4SMALL:      PdfDocument.DefaultPaperSize := psA4;
    DMPAPER_A5:           PdfDocument.DefaultPaperSize := psA5;
  else
    PdfDocument.DefaultPaperSize := psUserDefined;
    PdfDocument.DefaultPageWidth := Round((Page.PaperWidth / 25.4) * 72.0);
    PdfDocument.DefaultPageHeight := Round((Page.PaperHeight / 25.4) * 72.0);
  end;

  PdfDocument.DefaultPageLandscape := (Page.Orientation = poLandscape);
  PdfDocument.AddPage;
end;

Board footer

Powered by FluxBB