#1 Re: PDF Engine » Rendering issues (text right align, box borders) » 2015-09-24 16:19:54

Well I'm guessing (from the lack of replies) this is a problem beyond anyone's control. So there is no solution for it...

#2 Re: PDF Engine » Rendering issues (text right align, box borders) » 2015-09-22 15:09:29

I'm using the latest https://github.com/synopse/SynPDF version I just redownloaded it to make sure and the problem still persists! sad

#3 PDF Engine » Rendering issues (text right align, box borders) » 2015-09-21 15:50:01

Cauchemar
Replies: 11

Hi synopse forum!

I come to you today to hopefully get some help on a strange matter. Basically what is happening is that when the PDF file is rendered, for some reason, the text that is aligned to the right is cut off and the box borders (QRBands) are acting weird, both of them are uneven, the bottom box one only shows very thin lines on top, left and right and a very thick line at the bottom, the top box is a bit thinner at the top, left and right and bolder at the bottom once again. If anyone has any idea what is going on, feel free to let me know! Here's a picture. From what I can see there is probably a problem with the thickness of the borders, the bottom ones seem to be thicker, the top,left and right ones seem to be thin. Thanks in advance!
*EDIT* : So I changed this line a bit :

Pdf.Canvas.RenderMetaFile(aMeta,1,0,0); to Pdf.Canvas.RenderMetaFile(aMeta,1,0,0,tpExactTextCharacterPositining)

It helped a little bit but part of the last letters still get chopped. It is worth mentioning that the font used here is Arial, when I switched to Times New Roman it was a bit better but still not perfect. Also worth noting that the issue doesn't appear when I have the font bigger, right now it's at 8 but if I put it at 12 it shows fine so it seems to be a problem with smaller font sizes.

16gbkms.png

Here's the code :

procedure ReportExport(aReport: TQuickRep; const aFileName: TFileName);
var Pdf: TPdfDocument;
     aMeta: TMetaFile;
     i: integer;
begin
  Pdf := TPdfDocument.Create;
  try
    aReport.Prepare;
    for i := 1 to aReport.QRPrinter.PageCount do begin
      aMeta := aReport.QRPrinter.GetPage(i);
      try
        Pdf.DefaultPageWidth := MulDiv(aMeta.Width,72,Pdf.ScreenLogPixels);
        Pdf.DefaultPageHeight := MulDiv(aMeta.Height,72,Pdf.ScreenLogPixels);
        Pdf.AddPage;
        // draw the page content
        Pdf.Canvas.RenderMetaFile(aMeta,1,0,0);
      finally
        aMeta.Free;
      end;
    end;
    Pdf.SaveToFile(aFileName);
  finally
    Pdf.free;
  end;
end;

Board footer

Powered by FluxBB