FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Corel.PRG - EMF bug
Posts: 190
Joined: Tue Mar 14, 2006 01:59 AM
Corel.PRG - EMF bug
Posted: Wed Nov 19, 2008 04:00 PM
Hello all,

I noticed that ImportWMF() places the image in different positions if Preview is enabled or not. Looks like Preview adds an additional margin on top-left corner.

Please try the sample Corel.prg - The result is in the 2 PDF's below:
http://www.2shared.com/file/4310298/b8cea73f/preview.html
http://www.2shared.com/file/4310311/809ffa4/nopreview.html

As you can see the text is in the same coordinates, while Invoice.EMF is not.

How can we fix this bug ?

Thanks,
Davide
Posts: 190
Joined: Tue Mar 14, 2006 01:59 AM
Corel.PRG - EMF bug - Solved (perhaps)
Posted: Sat Nov 22, 2008 12:59 AM
traced back the problem in Printer.prg method ImportWMF():
   if ! ::lMeta
      SetViewOrg( ::hDCOut, -::nXoffset, -::nYoffset )
   endif

By commenting those lines, the problem gets cured, but it seems to be intentional.

Why the offsets should be considered only if Preview is disabled ?
Antonio ?

Hi,
Davide
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Corel.PRG - EMF bug
Posted: Sat Nov 22, 2008 01:19 AM

Davide,

> Why the offsets should be considered only if Preview is disabled ?

We implemented the Method ImportWMF() for a FWH user that needed it. Probably in his case it was required as he was satisfied with the results.

We can modify that code, no problem.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 190
Joined: Tue Mar 14, 2006 01:59 AM
Corel.PRG - EMF bug
Posted: Sat Nov 22, 2008 01:27 AM
Antonio,
Antonio Linares wrote:We can modify that code, no problem.

I just checked that it's so since at least FW24 (2003). Don't have older versions still installed to check.

I would suggest to comment those lines in the standard lib however because most often a client uses the preview to place the text inside a form (like Corel.prg). At the end of the job the result is different if preview is disabled.

Hi,
Davide
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Corel.PRG - EMF bug
Posted: Sat Nov 22, 2008 01:29 AM

Davide,

I assume that most FWH users use EMF files instead of WMF ones.
But I may be wrong.

Maybe you can just change the PRG there for your own use.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 190
Joined: Tue Mar 14, 2006 01:59 AM
Corel.PRG - EMF bug
Posted: Sat Nov 22, 2008 01:32 AM
Antonio,
Antonio Linares wrote:I assume that most FWH users use EMF files instead of WMF ones.

the problem affects both (effectively I experienced it with an EMF) as method ImportWMF() is used to import either WMF's or EMF's
Regards,
Davide

P.S. I'm already using a custom Printer.prg. Just wanted to contribute a bug fix

Continue the discussion