Author Topic: Bookmarks in RTF Document Don't Surround Element  (Read 1479 times)

Screwtape

  • EA User
  • **
  • Posts: 91
  • Karma: +4/-0
    • View Profile
Bookmarks in RTF Document Don't Surround Element
« on: May 11, 2015, 07:50:15 pm »
Hi!

I've upgraded from EA11 to EA12, and since doing so, when I generate documentation, using a custom script and custom fragments, I note that the bookmark that had the element's GUID and used to surround the element, now appears to start and end at the end of the element's title.

This means that the bookmark now cannot be used for constructing references. (i.e. see paragraph 3.4)

Does anyone know why this has changed, or how to get it to work the way it used to?
Screwtape

Dermot

  • EA Administrator
  • EA User
  • *****
  • Posts: 588
  • Karma: +7/-0
    • View Profile
Re: Bookmarks in RTF Document Don't Surround Eleme
« Reply #1 on: May 19, 2015, 04:03:25 pm »
Check what build you have - a correction for this was posted in 1207.

Screwtape

  • EA User
  • **
  • Posts: 91
  • Karma: +4/-0
    • View Profile
Re: Bookmarks in RTF Document Don't Surround Eleme
« Reply #2 on: June 11, 2015, 07:20:32 pm »
Hi! Thanks for that. I've upgraded to 1214 and it's still doing the same thing I'm afraid. Is it worth raising (or re-raising) as a bug?

Interestingly, if there is a diagram displayed as part of the element, the bookmark now links to the diagram, rather than the whole element as it used to.

I was using the bookmarks to reference other sections in the generated document, but that doesn't work now, and I can't see any other way to do it.

Thanks!
Screwtape

Monsieur

  • EA User
  • **
  • Posts: 142
  • Karma: +0/-0
    • View Profile
Re: Bookmarks in RTF Document Don't Surround Eleme
« Reply #3 on: June 15, 2015, 11:46:16 pm »
I have major bugs using RTF generation but none using docx.
Can you try in docx?

Screwtape

  • EA User
  • **
  • Posts: 91
  • Karma: +4/-0
    • View Profile
Re: Bookmarks in RTF Document Don't Surround Eleme
« Reply #4 on: June 15, 2015, 11:51:14 pm »
Hi Monsieur,

As I'm using the DocumentGenerator class, it doesn't allow you do save as docx, just RTF or HTML.

Quote
SaveDocument (string filename, long nDocType)
      

Boolean
      

Saves the document to disk.

Parameters:
     filename: String - the filename to save the file to
     nDocType: Long - 0 = RTF, 1 = HTML
 

Is there a way to save to docx using the API?

Yours,

Screwtape.
Screwtape

Monsieur

  • EA User
  • **
  • Posts: 142
  • Karma: +0/-0
    • View Profile
Re: Bookmarks in RTF Document Don't Surround Eleme
« Reply #5 on: June 15, 2015, 11:55:08 pm »
Quote
Hi Monsieur,

As I'm using the DocumentGenerator class, it doesn't allow you do save as docx, just RTF or HTML.

Quote
SaveDocument (string filename, long nDocType)
      

Boolean
      

Saves the document to disk.

Parameters:
     filename: String - the filename to save the file to
     nDocType: Long - 0 = RTF, 1 = HTML
 

Is there a way to save to docx using the API?

Yours,

Screwtape.
I think your HELP is outdated... are you sure it is for the V12?

http://www.sparxsystems.com/enterprise_architect_user_guide/12.0/automation_and_scripting/document_generator_interface_class.html
Just saying :
       

Saves the document to disk.

Parameters:
     filename: String - the filename to save the file to
     nDocType: Long - 0 = RTF, 1 = HTML, 2 = PDF,
3 = DOCX


M.
ps: Nxt coffee is on you ;)
« Last Edit: June 15, 2015, 11:56:11 pm by damien.reche »

Screwtape

  • EA User
  • **
  • Posts: 91
  • Karma: +4/-0
    • View Profile
Re: Bookmarks in RTF Document Don't Surround Eleme
« Reply #6 on: June 15, 2015, 11:59:34 pm »
D'oh!

That's using Google for you! I'd just Googled the class name and I hadn't noticed the hit it gave me was from 9.2 which may explain why the API seemed so far behind the normal functionality!

Maybe I'll have less issues now... I'll give it a go! :)

Thanks!
Screwtape

Monsieur

  • EA User
  • **
  • Posts: 142
  • Karma: +0/-0
    • View Profile
Re: Bookmarks in RTF Document Don't Surround Eleme
« Reply #7 on: June 16, 2015, 12:36:10 am »
Quote
D'oh!

That's using Google for you! I'd just Googled the class name and I hadn't noticed the hit it gave me was from 9.2 which may explain why the API seemed so far behind the normal functionality!

Maybe I'll have less issues now... I'll give it a go! :)

Thanks!

Was in your situation not so long ago ;)

Screwtape

  • EA User
  • **
  • Posts: 91
  • Karma: +4/-0
    • View Profile
Re: Bookmarks in RTF Document Don't Surround Eleme
« Reply #8 on: June 16, 2015, 12:50:51 am »
Tried using DOCX generation instead of RTF.

The same issues seem to be happening. The bookmarks are in the same places as before, and the diagrams are not sizing correctly - see http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1433924671.

It looks like the document generator isn't working quite correctly when called from the API.
Screwtape