Author Topic: docGenerator.DocumentDiagram to "print" diagram within A4 page  (Read 1178 times)

BruceTOGAF2

  • EA User
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
docGenerator.DocumentDiagram to "print" diagram within A4 page
« on: December 13, 2017, 02:05:25 am »
I am using docGenerator.DocumentDiagram( currentDiagram.DiagramID, 0, myRtfTemplateFragment) to "print" large diagrams in an RTF document.
After the RTF document has been built, I have to resize each diagram to fit neatly into an A4 page.

How can I force docGenerator to "print" those diagrams within the bounds of an A4 page?

In Tools, Options, Diagrams, Default Page Size is 'A4 Sheet, 210- by 297-millimeters'
In Tools, Options, Diagrams, Diagram Frames, there is a check box 'On printed Images'
In Tools, Options, Diagrams, General, there is a check Box 'Zoom to best scale'
In Tools, Options, Diagrams, I cannot find a check Box for 'Zoom to best scale' On printed Images

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8204
  • Karma: +193/-23
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: docGenerator.DocumentDiagram to "print" diagram within A4 page
« Reply #1 on: December 13, 2017, 02:53:53 am »
On the diagram properties there is
Diagram | Document Generation Options | Divide Diagram into multiple pages
I think that might be what you are looking for.

Geert

BruceTOGAF2

  • EA User
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: docGenerator.DocumentDiagram to "print" diagram within A4 page
« Reply #2 on: December 13, 2017, 03:22:08 am »
I am using docGenerator.DocumentDiagram( currentDiagram.DiagramID, 0, myRtfTemplateFragment) to "print" large diagrams in an RTF document.

Hi Geert,

I am not looking for dividing diagrams.  I am looking for a method to shrink each diagram so that it fits into the A4 age.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8204
  • Karma: +193/-23
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: docGenerator.DocumentDiagram to "print" diagram within A4 page
« Reply #3 on: December 13, 2017, 03:58:04 am »
I am using docGenerator.DocumentDiagram( currentDiagram.DiagramID, 0, myRtfTemplateFragment) to "print" large diagrams in an RTF document.

Hi Geert,

I am not looking for dividing diagrams.  I am looking for a method to shrink each diagram so that it fits into the A4 age.
If you leave that unchecked I think it should do just that (as in not divide over multiple pages)

Geert

BruceTOGAF2

  • EA User
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: docGenerator.DocumentDiagram to "print" diagram within A4 page
« Reply #4 on: December 13, 2017, 08:36:00 pm »
Hi Geert

On the diagram properties there is
Diagram | Document Generation Options | Divide Diagram into multiple pages

I checked this checkbox to see what would happen. Diagram did divide over multiple pages.

Then I left this unchecked to see what would happen. I can only see a part of the diagram. To reveal the full diagram I have to (in MS-Word) manually shrink the diagram size to fit the page.

I am looking for a way of automatically (in Sparx) shrinking the diagram size to fit the page.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8204
  • Karma: +193/-23
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: docGenerator.DocumentDiagram to "print" diagram within A4 page
« Reply #5 on: December 13, 2017, 08:44:38 pm »
Ah, I see.

The weird thing is that, when using regular document generation this behavior is standard.
All my diagram are shrunk to exactly the size of a page.
Could it be that the document generator behaves differently when executed from script?

I would take that up with Sparx support.

Anyway, as a workaround you could write a little macro in Word to resize the images. If you search the forum you'll find one that I posted a while ago to do just that.
We actually wanted the diagram to be a little bit smaller than a whole page so the caption would stay on the same page.

Geert

steen.jensen@sll.se

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: docGenerator.DocumentDiagram to "print" diagram within A4 page
« Reply #6 on: December 18, 2017, 11:31:16 am »
In diagram properties , Advanced Im using "Scale to 1 page" who works good, Using EA 13.51

When large and wide diagram Im selecting Rotate Image in Diagram Properties.

Its works as expected with normal Doc generation :)
Maybe works different with scripts

Screwtape

  • EA User
  • **
  • Posts: 91
  • Karma: +4/-0
    • View Profile
Re: docGenerator.DocumentDiagram to "print" diagram within A4 page
« Reply #7 on: December 21, 2017, 08:02:58 pm »
Hi Bruce,

This sounded familiar - so I looked up my old threads and found this: http://www.sparxsystems.com/forums/smf/index.php/topic,5903.msg127212.html#msg127212

It looks like it was reported as a bug some time ago, but the reported didn't mention the bug number.

It may be worth reporting as a bug again. I've moved to using virtual documents for most of my documentation, but I also use CustomDocument fragments, but not yet for diagrams, so I don't know if it fails within a CustomDocument fragment script.

Yours,

Screwtape.
Screwtape

BruceTOGAF2

  • EA User
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: docGenerator.DocumentDiagram to "print" diagram within A4 page
« Reply #8 on: January 08, 2018, 11:19:25 pm »
I tried a recommendation from Colin Coates, a fellow member of LinkedIn Group 'Enterprise Architect (Sparx Systems) User Group'

I tried right-clicking each diagram and then setting the radio-button you see by clicking through Properties|Diagram|Advanced|Scale to 1 Page?

This has made no difference.

I fail to see how switching to Virtual Documents would make any difference.

Looks like a bug in Sparx EA 12.