Corel.PRG - EMF bug

Corel.PRG - EMF bug

Postby Davide » Wed Nov 19, 2008 4: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
Davide
 
Posts: 190
Joined: Tue Mar 14, 2006 1:59 am
Location: Italy

Corel.PRG - EMF bug - Solved (perhaps)

Postby Davide » Sat Nov 22, 2008 12:59 am

traced back the problem in Printer.prg method ImportWMF():
Code: Select all  Expand view
   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
Davide
 
Posts: 190
Joined: Tue Mar 14, 2006 1:59 am
Location: Italy

Postby Antonio Linares » Sat Nov 22, 2008 1: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Davide » Sat Nov 22, 2008 1: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
Davide
 
Posts: 190
Joined: Tue Mar 14, 2006 1:59 am
Location: Italy

Postby Antonio Linares » Sat Nov 22, 2008 1: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Davide » Sat Nov 22, 2008 1: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
Davide
 
Posts: 190
Joined: Tue Mar 14, 2006 1:59 am
Location: Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 46 guests