Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Thomas Arnbjerg on February 22, 2023, 12:58:11 am

Title: Is it possible to configure linked document defaults?
Post by: Thomas Arnbjerg on February 22, 2023, 12:58:11 am
Is it possible to configure linked document defaults? - e.g. margins, page layout, page size, fonts, table  borders.

So when creating a linked document without specifying a template the default settings apply.
Title: Re: Is it possible to configure linked document defaults?
Post by: Mauricio Moya (Arquesoft) on February 22, 2023, 01:07:50 am
You can create a Linked document template and use it when creating new LD, when the window is open just before editing a new document.
Title: Re: Is it possible to configure linked document defaults?
Post by: Thomas Arnbjerg on February 22, 2023, 01:10:15 am
Thanks for the response.

I'm loading linked documents from external files from a javascript script and I can't find a way to control the formatting of these documents.

Any ideas?
Title: Re: Is it possible to configure linked document defaults?
Post by: Thomas Arnbjerg on February 22, 2023, 11:21:06 pm
Found a partial solution.

1) Create a document template 'foobar template' with the right margins, page dimensions
2) Instantiate a documentGenerator
3) Call NewDocument on the document generator with 'foobar template' as the argument.
4) Load the external RTF file into the document generator with LoadDocument
5) Save the document in the document generator as RTF with SaveDocument
6) Load the document from the previous step into the element as a linked document with 'LoadLinkedDocument'.

Margins and page dimensions are now correct

Title: Re: Is it possible to configure linked document defaults?
Post by: Mauricio Moya (Arquesoft) on February 23, 2023, 07:13:53 am
Thanks for sharing your solution!