ImportWMF - FWH 13.07 - Problem

ImportWMF - FWH 13.07 - Problem

Postby kabrau » Thu Oct 10, 2013 3:24 pm

Hi

To print, I always used the logos in WMF format
I create the WMF page size and position the image of the logo in the correct location.
Now importWMF converts to EMF, and loses position just inside the WMF

Please, I have 1500 clients, can not change all logos.

Hugs

Marcelo
kabrau
 
Posts: 5
Joined: Tue May 20, 2008 4:00 pm

Re: ImportWMF - FWH 13.07 - Problem

Postby kabrau » Thu Oct 10, 2013 4:37 pm

I need that WMF2EMF() convert WMF size page to EMF, today convert only the logo, and change the page size.

Please, help me.
kabrau
 
Posts: 5
Joined: Tue May 20, 2008 4:00 pm

Re: ImportWMF - FWH 13.07 - Problem

Postby Antonio Linares » Fri Oct 11, 2013 7:27 am

Marcelo,

FWH uses Windows SetWinMetaFileBits() to convert a WMF into an EMF:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd145103(v=vs.85).aspx
so there is nothing we can do there, but in Method ImportWMF() there are some places where you could adjust the dimensions:

in printer.prg:
Code: Select all  Expand view  RUN

   ::SetIsoTropicMode()
   ::SetWindowExt( GetDeviceCaps( ::hDC, HORZRES ),;
                   GetDeviceCaps( ::hDC, VERTRES ) ) //  aData[ 1 ], aData[ 2 ] )
   ::SetViewPortExt( GetDeviceCaps( ::hDC, HORZRES ),;
                     GetDeviceCaps( ::hDC, VERTRES ) ) //  aData[ 1 ], aData[ 2 ] )

   if ! ::lMeta
      SetViewOrg( ::hDCOut, -::nXoffset, -::nYoffset )
   endif


Maybe you could modify those values to have the right dimensions for you
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ImportWMF - FWH 13.07 - Problem

Postby kabrau » Fri Oct 11, 2013 2:13 pm

Hi Antonio

I tried this, but loses the top and left margin.

I think such a code loses these margins:
Code: Select all  Expand view  RUN
hOld = GetPMetaFile( cFile, aInfo )
hMeta = WMF2EMF( hOld, ::hDCOut ) 
or
Code: Select all  Expand view  RUN
PlayMetaFile( ::hDCOut, hWMF := EMF2WMF( hMeta, ::hDCOut ) ) 


printing without the logo: https://www.dropbox.com/s/dej8olj3dp98u2c/impressao%20sem%20logo.png
logo.wmf with margin: https://www.dropbox.com/s/sorprpavta3hxbc/logo.png
print with wrong logo: https://www.dropbox.com/s/5xz5ge5knpje5ig/impressao%20com%20logo%20errado.png
printing with the correct logo: https://www.dropbox.com/s/yh1m3ozkasqslnr/impressao%20com%20logo.png

Temporarily, I am using the tool htmltools to convert wmf to emf http://www.verypdf.com/app/html-converter/index.html
I put a code in importWmf() to convert using the htmltools.exe
Code: Select all  Expand view  RUN
winexec("htmltools.exe "+cFileWmf+" "+cFileEmf)


Anyway
thank you
kabrau
 
Posts: 5
Joined: Tue May 20, 2008 4:00 pm

Re: ImportWMF - FWH 13.07 - Problem

Postby Antonio Linares » Fri Oct 11, 2013 2:44 pm

Marcelo,

If the painting of the logo is just what it is failing, why don't you modify the logo to increase its top and left margins ? That may be a good workaround :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ImportWMF - FWH 13.07 - Problem

Postby kabrau » Fri Oct 11, 2013 3:02 pm

Hi Antonio

No problem, the htmltools.exe is a good solution.
I can't change the logo because I have 2 or 3 logo per client and 1500 clients, i think have more 4000 logo.

Thanks for the quick return

Marcelo
kabrau
 
Posts: 5
Joined: Tue May 20, 2008 4:00 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 13 guests