How to open wmf files?

How to open wmf files?

Postby Otto » Tue Nov 18, 2008 2:01 am

WORD2007 makes for every docx also a
thumbnail.wmf .
How can I open a wmf-file?
I tried with testimg.prg but the file does not open.

Thanks in advance
Otto
User avatar
Otto
 
Posts: 6336
Joined: Fri Oct 07, 2005 7:07 pm

WMF-File

Postby ukoenig » Tue Nov 18, 2008 1:45 pm

Hello Otto,

after you message, I tested WMF with FREEIMAGE.dll
( needed for testimg.prg ).
The Image is not shown in the preview-window.
I had a look at the FREEIMAGE new doc.

The table with supported formats ( WMF is not included ) :

Image

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby Antonio Linares » Tue Nov 18, 2008 7:09 pm

Otto,

You can use FWH Class TMetaFile to visualize a WMF file. EMF files are also supported.

Please review FWH\samples\evans.prg
regards, saludos

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

Re: How to open wmf files?

Postby Carlos Mora » Tue Mar 31, 2015 8:16 am

Hi Otto,

Otto wrote:WORD2007 makes for every docx also a
thumbnail.wmf .
How can I open a wmf-file?

Can you tell me how do I get the thumbnail.wmf for a given docx? Will it work with other Office files like Excel or Powerpoint files?

Best regards,

Carlos
Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
Carlos Mora
 
Posts: 989
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España

Re: How to open wmf files?

Postby nageswaragunupudi » Tue Mar 31, 2015 11:12 am

Code: Select all  Expand view  RUN
#include "fivewin.ch"

function main()

   local aPalBmp, oWnd

   DEFINE WINDOW oWnd TITLE "WMF-VIEWER"

   aPalBmp  := oWnd:ReadPalBmpEx( "sample.wmf" )

   ACTIVATE WINDOW oWnd ;
      ON PAINT oWnd:SayPalBmp( aPalBmp )

   PalBmpFree( aPalBmp[ 1 ], aPalBmp[ 2 ] )

return nil
 


Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: How to open wmf files?

Postby Carlos Mora » Tue Mar 31, 2015 3:31 pm

Hi Nages,

quoting myself, "Can you tell me how do I get the thumbnail.wmf for a given docx?"

The point is to obtain the wmf FROM THE DOCX
Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
Carlos Mora
 
Posts: 989
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España

Re: How to open wmf files?

Postby Antonio Linares » Tue Mar 31, 2015 4:56 pm

Carlos,

I remember that I saw a very clever implementation from Otto to generate a thumbnail from any image (running app, etc) on the screen.

Basically once the image was shown, he captured the portion of the screen with the image and generated a bitmap from it.

Otto could you explain the way you did it ? many thanks
regards, saludos

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

Re: How to open wmf files?

Postby Carlos Mora » Wed Apr 01, 2015 8:27 am

Hi Antonio,

It would be interesting to have the Otto procedure, having sth as automatic as posible. I'm not particulary worried about image files, making a thumbnail for an image is something more or less easy to do, imagemagic can do it's 'magic' i think.
But what i need to do is to know how to extract the thumbnails from non-image files, like MS-Word's docx or Excel's xlsx.

For docx, manually (not by program, as I want) the trick is to save it with the 'Generate thumbnail' checkbox in the "Save" dialog. Then, opening the xlsx as a zip file, you can get a wmf file.
My problem is that you have to do all this procedure by hand, i thought Otto got it by program, that is what i'm looking for.

Best regards
Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
Carlos Mora
 
Posts: 989
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España

Re: How to open wmf files?

Postby hmpaquito » Wed Apr 01, 2015 8:54 am

Carlos,

He buscado por ahi algo. Alguna pista se puede encontrar con las palabras shellFile.Thumbnail.

Quiza ya lo conozcas.

Saludos
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: How to open wmf files?

Postby anserkk » Wed Apr 01, 2015 9:04 am

The MS Office's documents are saved in OOXML format which basically is a zipped archive of "different files". To extract the thumb, just look in the ZIP (docx) archive for a file named "thumbnail" with whatever extension. (Currently is either thumbnail.emf (for docx), wmf (for xlsx) and jpeg (for pptx)). Also, be advised that the thumb (the file) can be missing if the user chose when he save the file from Word/Excel/PowerPoint to NOT include the thumbnail.

The Word Documents in Hard drive
Image

The contents shown, if you try to open the Word docx file via a Zip manager application
Image

The folder where the thumbnail file is stored
Image


Regards

Anser
User avatar
anserkk
 
Posts: 1333
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: How to open wmf files?

Postby Carlos Mora » Wed Apr 01, 2015 10:59 am

Hola HMpaquito,

Lo que encontré con esas palabras es todo para C# o .NET, sigo dándole vueltas a ver si pillo algo para C o, si no queda otra, C++.

Anserkk,

i've already got that, but, as you said, user should check the 'Generate Thumbnail" in the Save dialog. What i want seems that can be done with C#, but no path to write it in just C. I thought Otto already solved the issue, let's cross fingers
Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
Carlos Mora
 
Posts: 989
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España

Re: How to open wmf files?

Postby anserkk » Wed Apr 01, 2015 11:33 am

For me, the following code used while saving the word document is working as expected ie it is showing the thumbnail

Use this to save the Word file with Thumbnail enabled
Code: Select all  Expand view  RUN
  oWord:ActiveDocument:SaveAs2( "D:\anser.docx", 16, .F., "",  .T., "", .F., .F., .F., .F., .F., 0 )


You may extract the thumbnails from the word file using the zip trick :)

Regards

Anser
User avatar
anserkk
 
Posts: 1333
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: How to open wmf files?

Postby cnavarro » Wed Apr 01, 2015 12:49 pm

Anser as Word is configured so that documents created by users the Thumbnail be included?

Anser, como se configura Word para que en los documentos creados por los usuarios se incluyan los Thumbnail?
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6549
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: How to open wmf files?

Postby anserkk » Wed Apr 01, 2015 1:04 pm

cnavarro wrote:Anser as Word is configured so that documents created by users the Thumbnail be included?


I understand that you need to enable this "Save Thumbnail" option only once in your PC. After that word is remembering the option and is remaining as checked.
User avatar
anserkk
 
Posts: 1333
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: How to open wmf files?

Postby cnavarro » Wed Apr 01, 2015 1:26 pm

Thanks, had looked at all options
He had not looked in the dialogue "Save" and "Save As" :oops: :( :shock:

Gracias, habia mirado en todas las opciones
No habia mirado en el dialogo "Guardar" y "Guardar como"
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6549
Joined: Wed Feb 15, 2012 8:25 pm
Location: España


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 71 guests