extracting embedded visio diagrams from FM with ES

Participant ,
Mar 06, 2016

Copy link to clipboard

Copied

Hello fellows,

AFAIK, FM15 is not "aware" of the type of the graphic object that sits inside an anchored frame. Embedded graphics appears as OLE2. Is there a way to programmatically extract embedded Visio graphics from Framemaker files and leave all other types of graphics in place?

Thank you for your responses in advance!

TOPICS
Scripting

Views

684

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Mar 07, 2016

Copy link to clipboard

Copied

Hi Roman, What do you mean by extracting the embedded graphics? Thanks. -Rick

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
rombanks AUTHOR
Participant ,
Mar 07, 2016

Copy link to clipboard

Copied

Hi Rick,

Thank you for your response!

"Embedded" means not linked/imported by reference - just sitting locally in a FM file.

Best regards,

Roman

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Mar 07, 2016

Copy link to clipboard

Copied

There is no path data stored for embedded graphics that can be retrieved programmatically. So there is no way to convert them to referenced graphics.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
rombanks AUTHOR
Participant ,
Mar 07, 2016

Copy link to clipboard

Copied

Thanks for your prompt response, Rick!

I remember seeing a post regarding a framescript created by GolehTek that was supposed to extract graphics from an FM file. I've never seen the script itself and this company no longer exists. Did you have a chance to test this script?

An embedded Visio object can be opened from Framemaker or edited withing Framemaker by using the corresponding context menus. So why can't this action be mimicked with a script? Going back to my original question, can ES identify the type of graphics put within an anchored frame (i.e., whether it's a jpeg or vsd)?

Thanks again!

Roman

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Enthusiast ,
Mar 07, 2016

Copy link to clipboard

Copied

Hi rombanks

have a look here, maybe, that can help you.

ExtendScript of the Week: Externalizing Graphics – TechComm Central by Adobe

I have never tested that script.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
rombanks AUTHOR
Participant ,
Mar 07, 2016

Copy link to clipboard

Copied

Hi Klaus,

Thanks for your response!

I did test this script in FM10 and it worked partially (didn't support Visio graphics). In FM15, it does not work at all. I guess it's because of the DLL file called by the script.

Best regards,

Roman

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Contributor ,
Mar 07, 2016

Copy link to clipboard

Copied

No direct experience, but some suggestions:

  • An Inset object has a set-only InsetSaveFacetToFile property. This might do what you need. There's not much documentation for it in the Scripting Guide. I'd start by trying values of "OLE" or "WMF" for the facet name. Other facets might exist as named properties of the Inset, so list all the properties, and examine them.
  • The libraries for the FDK (FrameMaker's C API) expose symbols for functions named F_ApiExport() and F_ApiGetExportDefaultParams(). These are undocumented, but I believe they do the reverse of F_ApiImport() and F_ApiGetImportDefaultParams(). There might be corresponding JavaScript methods: GetExportDefaultParams() is documented, but I don't see any documentation for Export(). Again, these might do what you need, if they exist.

Finally, the FDK documentation sometimes has more informatioin than the Scripting Guide, so might give some further suggestions that can be re-engineered using JavaScript.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
rombanks AUTHOR
Participant ,
Mar 08, 2016

Copy link to clipboard

Copied

Hi Mike,

Thank you for looking into this issue. Are the embedded figures treated as insets by FrameMaker?

I'll try to play around with these APIs.

Thank you!

Roman

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Contributor ,
Mar 09, 2016

Copy link to clipboard

Copied

AFAIK:

  • embedded figures are an Inset object
  • the image data is stored as one or more facets
  • each facet is a named property of an Inset object
  • the name typically represents the format or type of data (e.g. OLE, WMF, PNG).

The above is extrapolated from the C API, with which I am more familiar. But I've not used insets very much, so I'd trust the manuals over anything I say.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more