#1 2015-07-05 18:20:04

dexterkeefer
Member
Registered: 2015-07-05
Posts: 3

Printing Behavior

Howdy
I have been using SYNPDF nicely in delphi XE3 for years. I have upgraded to XE8, and I am getting unpredictable printing behavior. Driving me crazy. Any ideas?

procedure MTestFont(MyCanvas: TCanvas; MyRect: TRect);
var
   MyString: String;
    DrawRect: TRect;

begin
   MyString:='This is the fastest that anyone has ever traveled.';
   MyCanvas.Font.Name:='Arial Narrow';
   MyCanvas.Font.Size:=40;
   DrawFlags:=DT_END_ELLIPSIS or DT_NOPREFIX or DT_WORDBREAK or DT_EDITCONTROL or DT_LEFT;

   DrawText(MyCanvas.Handle, PChar(MyString), StrLen(PChar(MyString)), MyRect, DrawFlags);

end;

and in my main code I call as a test:

    for MyCount := 0 to 6 do  begin
       MyRect.Left:=600;
       MyRect.Top:=600+MyCount*100;
       MyRect.Right:=1800;
       MyRect.Bottom:=MyRect.Top+60;
       MTestFont(Mycanvas, MyRect);

    end;

The first line prints This is the fastest that anyone has ev...
followed by
This
This
This
This
This etc.

Any thoughts?

Thanks

Offline

#2 2015-07-05 23:59:21

dexterkeefer
Member
Registered: 2015-07-05
Posts: 3

Re: Printing Behavior

OK, I may be wrong. Having spent 2 days trying to understand this and having seen a bug report of spaces being printed incorrectly, (which I experienced also), and to see that this bug still exists, I must conclude that this component is not really being maintained. Sadly, it was working for me for a long time, but when I upgraded from delphi xe3 to xe8, I saw this behavior. Perhaps it will be fixed in future releases.

Offline

#3 2015-07-06 10:48:51

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

Re: Printing Behavior

You asked on a Sunday for free support, and got any immediate answer (because it was not direct to reproduce), then concluded the library is not maintained?
You did not even create a ticket.
Supporting all potential metafile/canvas input, with all the potential Windows API set of parameters is a huge work.
Even "commercial" libraries did not start to implement this metafile conversion process.
So please do not be rude.
wink

The following works:

procedure MTestFont(MyCanvas: TCanvas; MyRect: TRect);
var
   MyString: String;
    DrawRect: TRect;
    DrawFlags: cardinal;
begin
   MyString:='This is the fastest that anyone has ever traveled.';
   MyCanvas.Font.Name:='Arial Narrow';
   MyCanvas.Font.Size:= 50;
   MyCanvas.Rectangle(MyRect);
   MyCanvas.TextRect(MyRect,MyRect.Left,MyRect.Top,MyString);

Complex text clipping has been introduced lately, but also added some potential regressions.
But I understand that you may be disappointed, since something which did work directly, is not any more.

I've changed how text clipping is done, and renamed TPdfDocumentGDI.DisableMetaFileTextClipping parameter as UseMetaFileTextClipping for more precise tuning.
See http://synopse.info/fossil/info/298185d339
It should work as expected now.

For space printing, try to adjust the UseMetaFileTextPositioning parameter.

Offline

#4 2015-07-06 13:25:01

dexterkeefer
Member
Registered: 2015-07-05
Posts: 3

Re: Printing Behavior

I am sorry, yes I was rude. I spent two days trying to understand why the printing was not behaving has it had so nicely in the past, then I found another similar issue from another user, and I am surprised that noone else had this issue. Then I had to untie synopse from my app to try another product, very frustrating, as Synopse had worked so well. I will surely try this suggestion! Thanks for the work
DK

Offline

Board footer

Powered by FluxBB