#1 2015-09-21 15:50:01

Cauchemar
Member
Registered: 2015-09-21
Posts: 3

Rendering issues (text right align, box borders)

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;

Last edited by Cauchemar (2015-09-21 20:01:41)

Offline

#2 2015-09-22 08:02:49

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Rendering issues (text right align, box borders)

Are you using the latest trunk version from https://github.com/synopse/mORMot or https://github.com/synopse/SynPDF ?

Offline

#3 2015-09-22 15:09:29

Cauchemar
Member
Registered: 2015-09-21
Posts: 3

Re: Rendering issues (text right align, box borders)

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

Offline

#4 2015-09-24 16:19:54

Cauchemar
Member
Registered: 2015-09-21
Posts: 3

Re: Rendering issues (text right align, box borders)

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

Offline

#5 2015-09-24 17:24:16

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Rendering issues (text right align, box borders)

I do not use QuickReport, so I can't reproduce it.

You may publish the corresponding metafile.
But I do not know if it is due to a QuickReport issue (wrong canvas parameters), or to SynPdf bug.

Users reported having issue with QuickReport output.
See http://synopse.info/forum/viewtopic.php … 267#p11267

Use of EmfExplorer may help understand what's happening.

Offline

#6 2015-11-18 14:39:04

fs999
Member
Registered: 2014-06-25
Posts: 7

Re: Rendering issues (text right align, box borders)

I have the same problem with one report from QuickReport (3.6.2 pro). check boxes are not displayed, some grid lines are missing and some header text is scrambled.
EmfExplorer displays the saved emf page correctly, with one exception : when GDI+ is enabled one grid is not correctly positioned.
This problem does not occure when saved with SynPdf...
I can send you the file by email if you want.

Kind regards,
Frederic

Offline

#7 2015-11-18 17:41:15

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Rendering issues (text right align, box borders)

I do not have much time to investigate such EMF generated by a third party tool...

Try to find out, using EmfExplorer, which EMF_* commands may be faulty.
Once you identified which part of SynPdf needs improvement, we may start looking into it.

Offline

#8 2016-02-25 11:33:24

Eduardo_Sysmo
Member
Registered: 2016-02-25
Posts: 3

Re: Rendering issues (text right align, box borders)

Good morning

I have the same problem when I export a report to PDF using SynPDF component it is " cutting " some of the fields .
Already have some solution trim it?
Something I can do to solve this problem in question?
Thank you.

Offline

#9 2016-02-25 13:06:14

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Rendering issues (text right align, box borders)

It is highly dependent on how the report is created, i.e. how the TCanvas is made.
Try to make the TCanvas generation simpler.

Offline

#10 2016-02-25 13:13:37

Eduardo_Sysmo
Member
Registered: 2016-02-25
Posts: 3

Re: Rendering issues (text right align, box borders)

Hello Friend.

Thanks for the reply , following more information :

The report is created with the FastReport component ,
the display it appears normally, but when I export to PDF it cuts the fields that are aligned right.
You have any suggestions of how to solve this problem ?

Offline

#11 2016-02-25 13:37:16

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Rendering issues (text right align, box borders)

Did you try to ask for support on FastReport side ?

Did you search here and tried http://synopse.info/forum/viewtopic.php?id=1656 ?

Offline

#12 2016-02-25 16:36:11

Eduardo_Sysmo
Member
Registered: 2016-02-25
Posts: 3

Re: Rendering issues (text right align, box borders)

hello,

I looked yes, but here the problem in the field, it cuts the contents of the field, as the field was less than the content it has, already has been testing greatly enhancing the same and field size so it cuts in screen appears normal,
but when you export to PDF it cuts some fields.
one more thing, only cuts the fields if the display font is smaller than 10

You has some idea of what can be done to solve this problem ?

Last edited by Eduardo_Sysmo (2016-02-25 17:06:34)

Offline

Board footer

Powered by FluxBB