GenoPro Home
GenoPro Home  |  Get Started With My Genealogy Tree  |  Buy  |  Login  |  Privacy  |  Search  |  Site Map
 

GenoPro Support Forum




Command line to export .gno to .emf file?

Click to view RSS...
Author Want to generate an EMF file for a .gno file
Posted Tuesday, January 13, 2015 - Post #34485
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Forum Members

Last Login: Thursday, January 22, 2015
Posts: 8, Visits: 18
Hi,

is it possible to generate an EMF or other file type for a .gno file from command line?

Ie something like

CMD> GenoPro.exe C:\Document1.gno -EXPORT -EMF C:\Document1.emf

I need to be able to output the genogram as an EMF or JPG or PDF or PNG without having to run the program by a user.

If there is no command line is there maybe a java sdk option or vb script option?

Thanks
Posted Tuesday, January 13, 2015 - Post #34487
Legendary Master

Legendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary Master

Administrators
Customers
Important Contributors
FamilyTrees.GenoPro.com
GenoPro version: 3.1.0.1

Last Login: 2 days ago @ 9:23 PM
Posts: 3,464, Visits: 26,854
There is no existing solution that I am aware of at present however it can be done quite simply using GenoPro's COM interface and VBScript or JScript.

See http://support.genopro.com/Topic21336-63-1.aspx and/or search for SavePictureOfGenoMap 

Propably easier to first unzip your .gno and use the plain XML file (data.xml) it contains.  Alternatively save as XML from GenoPro.

I can cobble something together if required.


'lego audio video erro ergo disco' or "I read, I listen, I watch, I make mistakes, therefore I learn"


Edited: Tuesday, January 13, 2015 by genome
Posted Sunday, January 18, 2015 - Post #34520
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Forum Members

Last Login: Thursday, January 22, 2015
Posts: 8, Visits: 18
Hi,

I downloaded the java files and there is no method SavePictureOfGenoMap defined in the java classes.
are you able to help out? also running the included .exe file hangs...

alternatively if you could just provide me with an exe that would take a geno document  and output path as a command line parameter and then output  emf to the specified directory that would work for me too! 
Posted Monday, January 19, 2015 - Post #34521
Grand Master

Grand MasterGrand MasterGrand MasterGrand MasterGrand MasterGrand MasterGrand MasterGrand MasterGrand Master

Customers
Important Contributors
FamilyTrees.GenoPro.com
GenoPro version: 3.1.0.0

Last Login: 2 hours ago
Posts: 1,595, Visits: 32,483
You need to search SavePictureOfGenoMap using the Search facility of this forum
Posted Monday, January 19, 2015 - Post #34522
Legendary Master

Legendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary Master

Administrators
Customers
Important Contributors
FamilyTrees.GenoPro.com
GenoPro version: 3.1.0.1

Last Login: 2 days ago @ 9:23 PM
Posts: 3,464, Visits: 26,854
Sorry Appleshaw, Kane81 is correct. I think the Genopro.class file was generated before the SavePictureOfGenoMap interface was added to GenoPro. 

I think JActiveX.exe is required to regenerate it, which was part of MS J++ however Microsoft appear to have abandoned Java and Sun/Oracle don't want to know about MS Com/ActiveX interfaces.  

I'll have a shot at writing something using JScript (i.e. MS Javascript)


'lego audio video erro ergo disco' or "I read, I listen, I watch, I make mistakes, therefore I learn"


Edited: Monday, January 19, 2015 by genome
Posted Monday, January 19, 2015 - Post #34523
Legendary Master

Legendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary Master

Administrators
Customers
Important Contributors
FamilyTrees.GenoPro.com
GenoPro version: 3.1.0.1

Last Login: 2 days ago @ 9:23 PM
Posts: 3,464, Visits: 26,854
Attached is a JScript (i.e. MS javascript) file that takes a name of a GenoPro XML file as its only argument and creates EMF images of each of the GenoMaps within it.

The SavePictureOfGenoMap.js  script is a s follows:

/*
Create EMF images of each GenoMap in a GenoPro XML file given in a command line argument
EMFs are named GenoMap<n>.emf, <n> is index number of map and are created in the current folder
Usage:
SavePictureOfGenoMap.js data.xml
*/
var fso = new ActiveXObject("Scripting.FileSystemObject"),
genopro = new ActiveXObject("GenoPro.Document");

var file = fso.OpenTextFile(WScript.Arguments(0), 1);
genopro.SetTextXml(file.readall());
file.Close();
var index = 0;
while (true) {
try {
genopro.SavePictureOfGenoMap(index, 'GenoMap' + index + '.emf');
if (!fso.FileExists('GenoMap' + index + '.emf')) break;
WScript.Echo('Created GenoMap' + index + '.emf');
index++;
} catch(e) {
break;
}
}
WScript.Echo("Finished: Created "+index+" EMF files");


To use a .gno as input you could use 7-Zip's 7z.exe command line to extract Data.xml from the .gno.

A suitable batch (.bat) file to do this with the required .gno as its paramaeter would contain:

"%ProgramFiles%\7-Zip\7z.exe" e -y "%1"
del GenoMap*.emf
cscript SavePictureOfGenoMap.js Data.xml


The above scripts are simplistic and assume everything resides in the same folder.

I don't have Java in my toolbag but if you want to go down that route perhaps the SourceForge Jacob project could help interfacing the GenoPro COM objects with Java


'lego audio video erro ergo disco' or "I read, I listen, I watch, I make mistakes, therefore I learn"


SavePictureOfGenoMap.js (133 views, 826 bytes)
Posted Monday, January 19, 2015 - Post #34525
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Forum Members

Last Login: Thursday, January 22, 2015
Posts: 8, Visits: 18
Thanks that is great - I will give it a go later today!
Posted Monday, January 19, 2015 - Post #34529
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Forum Members

Last Login: Thursday, January 22, 2015
Posts: 8, Visits: 18
Thanks,

Tested and it works great - however is there anyway I can also convert the old .gno files to emf files?

the old .gno files are not zipped and I tried renaming to .xml but that didnt work either :/
Posted Monday, January 19, 2015 - Post #34530
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Forum Members

Last Login: Thursday, January 22, 2015
Posts: 8, Visits: 18
Also is it possible to get the tab name that you are saving out to a file too?

ie: something like 

var tabName = genopro.GetTabName(index);
Posted Tuesday, January 20, 2015 - Post #34532
Grand Master

Grand MasterGrand MasterGrand MasterGrand MasterGrand MasterGrand MasterGrand MasterGrand MasterGrand Master

Customers
Important Contributors
FamilyTrees.GenoPro.com
GenoPro version: 3.1.0.0

Last Login: 2 hours ago
Posts: 1,595, Visits: 32,483
If you rename a current .gno file as .zip and extract it, it is the same as an xml file.
You can of course save as xml


Similar Topics

Click to view RSS...
Expand / Collapse

Reading This Topic

Expand / Collapse