#1 2017-04-13 10:07:06

WBTeam
Member
Registered: 2017-01-31
Posts: 7

Hidden text line in MetaFile is shown in PDF file [Solved]

Hello everyone,

I'm using SynPdf to convert MetaFile generated by Fast Report into PDF file.

This is working quite nicely, only a few issue remaining, one is the following:

In the report we have some lines we are willing to hide. When inspecting the meta file, those lines are well hidden, but they appear in the pdf file.

I used EMF Explorer program to get the EMF file code as text and I spotted that the line that is supposed to be hidden has the following code :

R0019: [084] EMR_EXTTEXTOUTW          (s=148) { TXT=[test ligne 2] [exScale(27.447916) eyScale(27.407408) iGraphicsMode(1), Bounds(0,0,-1,-1)] TxOPT[fOptions(4|ETO_CLIPPED), nChars(12), offDx(100), ptlRef(109,69),
                                                        rcl(109,53,292,69)] Spacing[4,6,6,4,3,4,4,6,7,6,3,7 => Total(60) =>xPtRefRight(168)]}

I think the problem here is that SynPDF doesn't get that when there is "Bounds(0,0,-1,-1)", the line is supposed to be hidden.


Anyone can help on that? This would be greatly appreciated! :-)

Last edited by WBTeam (2017-04-14 14:16:48)

Offline

#2 2017-04-13 10:33:44

CarlosM
Member
Registered: 2017-03-23
Posts: 7

Re: Hidden text line in MetaFile is shown in PDF file [Solved]

How is generated metafile from fastreport ?

if you use exportfilter you can modify frxView for each object.

Offline

#3 2017-04-13 12:00:41

WBTeam
Member
Registered: 2017-01-31
Posts: 7

Re: Hidden text line in MetaFile is shown in PDF file [Solved]

The FastReport part is fine, I came here to post about SynPDF showing lines that have bounds set to 0 and -1.

Maybe there should be a condition at the start of the procedure TPdfEnum.TextOut(var R: TEMRExtTextOut); that checks if Bounds are > 0 and if they're not, just don't print the line in the pdf.

Offline

#4 2017-04-13 12:52:02

WBTeam
Member
Registered: 2017-01-31
Posts: 7

Re: Hidden text line in MetaFile is shown in PDF file [Solved]

Here is the solution we applied :

this is placed in procedure TPdfEnum.TextOut(var R: TEMRExtTextOut); in SynPdf.pas

	
begin
  if ((R.rclBounds.left <> 0) and (R.rclBounds.top <> 0) and (R.rclBounds.right <> -1) and (R.rclBounds.bottom <> -1)) then //Here is the extra line to check for Bounds
  if R.emrtext.nChars>0 then
  with DC[nDC] do begin
    SetLength(tmp,R.emrtext.nChars+1); // faster than WideString for our purpose
    MoveFast(pointer(PtrUInt(@R)+R.emrtext.offString)^,tmp[0],R.emrtext.nChars*2);
    ASignY := 1;
    ASignX := 1;

Last edited by WBTeam (2017-04-13 12:52:34)

Offline

Board footer

Powered by FluxBB