Hey guys,
I've got a number of modellers working mainly with activity diagrams. The deliverables are Word documents, generated by means of a script. The problem is that the diagrams tend to get too large to be squeezed onto a single page.
I've been trying to work out a solution for this, which has resulted in a couple of Bugs&Issues posts, but I can't find a way forward that doesn't require a serious amount of manual editing of either the diagrams, or the resulting document, or both.
The template that outputs the diagrams is very simple, just a
package>element>diagram>{Diagram.DiagramImg} thing. The script simply calls
DocumentGenerator.DocumentElement().
My script checks the diagram's page orientation. I've found that applying a landscape version of the same template doesn't work, but if I instead
InsertBreak(section) and
SetPageOrientation() before and after a landscape diagram, using the portrait version of the template nearly works: the diagram is placed on a landscape page, although the document gets an unrequested blank page before the diagram.
So if the issue is that the diagram is too wide, we can get it out. It requires a needlessly complex set of GUI interactions for the modellers:
- Open the diagram properties
- Select the Diagram tab
- Click the Advanced... button
- Click the Page Setup button
- Click the Landscape radio button
- Click OK
- Click OK
- Click OK
... but it works.
But when that isn't enough, what do I do?
Divide Diagram into Multiple Pages
doesn't work. And
doesn't work.
Forcing the modellers to restrict their activity diagrams to what can fit on a page is not acceptable.
There are operations in
Project and
Diagram to get images from a diagram -- but there's nothing in
DocumentGenerator to insert an image into a document.
Is it possible to use
DocumentGenerator.DocumentCustomData() to insert image data? If so, how should it be encoded?
Is there another way of getting images into a document? Maybe via the image library or some magic template fragment?
Or is there some other way of getting this done?
TIA,
/Uffe