When producing a document from Rhapsody the diagrams will be generated in JPG format. For large/dense diagrams this is sub-optimal as the details of the diagrams become difficult to distinguish.
The solution for this is to request the diagrams in EMF format which is a combination of vector and bitmap graphics. Rhapsody’s Reportable REST API is set to generate JPG images by default but it can be made to return EMF instead.
When you make a request to get a diagram, such as http://localhost:27463/Rational/Rhapsody/?fields=Projects/Project/(name|PredefinedQueries/AllSequenceDiagrams/SequenceDiagram/(descriptionXHTML|name|Pictures/Picture/(path)))
Rhapsody returns the following:
The extracted image type is determine according to the XXX string (Picture__JPG__1__1) in the URL. The Rhapsody ‘s REST API actually knows to extract an EMF image, but currently it is “hard coded” in rhapsody to extract “JPG”. If you replace the picture path URL “JPG” string with “EMF” you will get from Rhapsody an EMF image.
path.replace( "__JPG__", "__EMF__") : path;
An example template that extracts Sequence Diagrams as EMFs is available in the RPE Community Template Library. The template was tested with the Home Alarm example example and Rhapsody 8.0.6 and produced the following document: testRHP_EmfImages If you open the document you will observe that you are able to edit the diagrams and access each detail independently ( you can notice that the line color was changed to green).