Re: [frame_dev] changing and setting the text in a footnote element

Hi…

The text range of an element includes the open element tag (but not the
end, I think), so when you add text at the tr.beg location, it’s
probably being added just *before* the footnote element. To move the
insertion point into the element do a .. tr.beg.offset++ .. before using
tr.beg. However, that will just get the new text into the footnote ..
you’ll have duplicated text, since you need to delete the old text (with
F_ApiDeleteText) before inserting the new. When you use F_ApiDeleteText,
be sure your tr doesn’t include the begin or end element tags. Also,
keep in mind that your tis is just the “FTI_String” items .. it’s
possible that your tr could include other objects like markers, so
you’ll need to use care when deleting text.

I think a better approach might be to just delete the leading spaces
from the text rather than deleting and replacing the whole string
(although, this could probably be argued one way or the other). Just
count the number of spaces at the beginning of the element (while
checking for other objects), then set the tr.beg.offset and the
tr.end.offset so it wraps just the leading spaces, and delete.

Good luck.

….scott

kutips2003 wrote:
>
> Hi!
>
> I have a program that loops through all the footnote elements in my
> document and tries to strip the leading spaces. (Example: ” This
> sentence” should change to “This sentence”) After stripping away the
> leading spaces the text in the footnote-element should be updated but
> im not quite sure how to do it….Here’s the code I’ve got so far:
>
> Function for getting the text (this function always get the ID of a
> Footnote element):
>
> StringT GetElementText(F_ObjHandleT docId, F_ObjHandleT elemId)
> {
> F_TextItemsT tis;
> StringT tstr, cp;
> IntT i;
>
> tstr = (StringT)F_Calloc(1, sizeof(UCharT), NO_DSE);
> tstr[0] = ‘’;
>
> tis = F_ApiGetText(docId, elemId, FTI_String);
>
> if (tis.len == 0) return NULL;
>
> for (i = 0; i cp = F_StrCopyString(tis.val[i].u.sdata);
> tstr = (StringT)F_Realloc(tstr, F_StrLen(tstr)+F_StrLen(cp)
> +2, NO_DSE);
> F_StrCat(tstr, cp);
> F_Free(cp);
> }
> F_ApiDeallocateTextItems(&tis);
>
> return tstr;
> }
>
> Here is the code where I try to modify and set the text (elemId is
> the foonote ID in this context):
>
> elemText = F_StrCopyString(GetElementText(docId, elemId));
> F_StrStripLeadingSpaces(elemText);
>
> tr = F_ApiGetTextRange(docId, elemId,
> FP_TextRange);
> F_ApiAddText(docId, &tr.beg, elemText);
>
> When i run it The text is inserted in the main flow and its not
> replacing the text in the footnote as it should. I know that I’m
> doing something wrong, but I dont know what to do…
>
> I’m not very familiar working with text and characters so I really
> would appreciate any help!!:-)
>
> In advance thanks!
>
>

Yahoo! Groups Links

To visit your group on the web, go to:
http://groups.yahoo.com/group/frame_dev/

Your email settings:
Individual Email | Traditional

To change settings online go to:
http://groups.yahoo.com/group/frame_dev/join
(Yahoo! ID required)

To change settings via email:
mailto:frame_dev-digest@yahoogroups.com
mailto:frame_dev-fullfeatured@yahoogroups.com

To unsubscribe from this group, send an email to:
frame_dev-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

Re: [frame_dev] Re: Compiler Selection

On Thu, 25 Oct 2007 15:20:27 -0000, “mhardy_arm_com” wrote:

>For version 7.2 and earlier, the FDK was built single threaded.
>Clients should therefore also be built single threaded, with the
>Runtime Library property set to “Single-threaded (/ML)”. But Visual
>Studio .NET 2005 does not support this option.
>
>So if you do use Visual Studio .NET 2005 to build clients for version
>7.2 and earlier, you will be linking the multi-threaded objects that
>it builds from your code with the single threaded libraries in the
>FDK. This can cause unstable behavior.

Very interesting. I just checked our own settings, and found that
we use three of the four possibilities. Our DLL plugins, m2rbook.dll
and m2gframe.dll, both are multithreaded. Our EXE plugin, runfm.exe,
is single-threaded. Our conversion DLLs (like dwhtm.dll), and the
conversion driver dcl.exe, are all multithreaded DLL, but since the
plugin runs them using the Win API CreateProcess(), they are all
isolated from Frame.

Checking the VS docs on this point, there are warnings about not
mixing static and DLL libraries in the same process, and of course
about not mixing debug and release. But not a word against mixing
single-threaded and multithreaded, which we are obviously doing
regardless of which the FDK uses, since we link to it with both.

Further, we build with a fine disregard of the stated FDK requirements
for Visual Studio. For a long time, we used the 5.5 FDK, and VS4.
The resulting plugins worked fine with every Frame version through
7.0, and possibly higher, but when we built runfm, an async client,
we were forced to go to FDK 6, which we still use. The FDK 6 docs
require VS6. No matter; we tested it using VS4 and it still worked
fine. So we kept using VS4… and it all runs just fine with all
Frame versions from 5.5.6 (6.0 for runfm) through 8.0. For several
thousand users… No problems during debugging, either.

We also mix Win API calls with FDK calls, sometimes on the same
objects. For example, the Conversion Designer for RTF has about
23 panels, each a separate dialog built with .dre files. We use
the FDK to init them and to read from them. But the FDK has no
way of moving that entire stack of dialogs as one piece, so as we
create each panel we get its HWND from Windows. Then we move it
around in sync with all the rest using the Win API. Works fine.

My conclusion is that there’s less to worry about than one might
think when mixing FDK versions, Frame versions, and compiler
versions and settings. I’m tempted to see if GCC will work… ;-)

– Jeremy H. Griffith, at Omni Systems Inc.
http://www.omsys.com/

Yahoo! Groups Links

To visit your group on the web, go to:
http://groups.yahoo.com/group/frame_dev/

Your email settings:
Individual Email | Traditional

To change settings online go to:
http://groups.yahoo.com/group/frame_dev/join
(Yahoo! ID required)

To change settings via email:
mailto:frame_dev-digest@yahoogroups.com
mailto:frame_dev-fullfeatured@yahoogroups.com

To unsubscribe from this group, send an email to:
frame_dev-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

[frame_dev] Re: Compiler Selection

— In frame_dev@yahoogroups.com, “elmsoft_frank” wrote:
>
> The FDK for FM8 has been released. Unfortunately the docs are the same
> as for the last beta. They still refer to compiler of choice being
> Visual Studio .NET 2003, even though it appears that the compiler that
> the FDK for FM8 prefers is .NET 2005.

The samples folder now has Visual Studio 2005 .sln and .vcproj files,
so this is another indicator.

> We would prefer to use one compiler, but we build clients for FM 6.0
> through FM 8.0.
>
> Has anyone successfully used Visual Studio .NET 2003 for FM 8?

See the posting from Scott Prentice. This has worked for me on a
simple plugin.

I believe that you must add his code before you #include any headers
from the FDK. This is because the FDE headers redefine the native
types that his code is using. Alternatively, you can use the #define
DONT_REDEFINE directive to prevent this redefinition, and then add
Scott’s code wherever you like.

Also, if FrameMaker and the FDK have been created using Visual Studio
2005, they must have been compiled multi-threaded. The .vcproj files
in the FDK8 samples are also set up this way, giving further evidence
to support this.

I’d therefore suggest that for the 8.0 FDK, you set your projects to
generate multi-threaded code. In the Properties dialog, navigate to
C/C++ > Code Generation, and set the Runtime Library property to
“Multi-threaded (/MT)”. This is the same value that the sample files
are using.

The above is, of course, just a best guess in the absence of any
documentation.

> Also, has anyone used Visual Studio .NET 2005 for clients with the 6.0,
> 7.0, 7.1 and 7.2 FDKs?

For version 7.2 and earlier, the FDK was built single threaded.
Clients should therefore also be built single threaded, with the
Runtime Library property set to “Single-threaded (/ML)”. But Visual
Studio .NET 2005 does not support this option.

So if you do use Visual Studio .NET 2005 to build clients for version
7.2 and earlier, you will be linking the multi-threaded objects that
it builds from your code with the single threaded libraries in the
FDK. This can cause unstable behavior.

Yahoo! Groups Links

To visit your group on the web, go to:
http://groups.yahoo.com/group/frame_dev/

Your email settings:
Individual Email | Traditional

To change settings online go to:
http://groups.yahoo.com/group/frame_dev/join
(Yahoo! ID required)

To change settings via email:
mailto:frame_dev-digest@yahoogroups.com
mailto:frame_dev-fullfeatured@yahoogroups.com

To unsubscribe from this group, send an email to:
frame_dev-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

[frame_dev] Re: Compiler Selection

I have used 7.1 and 7.2 with VS 2005.
Because we had to export docs to MS Word and MS Excel
we implemented things in C++ and C# (for the office stuff).
Everything worked perfect on all machines until I installed the Service
Pack 1 for VS 2005 on my development pc. The MS people seemed to have
changed something on the compilers so that the plug in would not be
recognized by FM. (there is no error or things like that it just
happens nothing). The C++ plug in dll has an other size if it’s
compiled with VS 2005 SP1 and just works on my development machine and
on no other one any more :-( .
So I test things local and then compile the release it on a VPC Image
without SP1 and that works.
I think it has something to with the dual core support introduced with
SP1.

Yahoo! Groups Links

To visit your group on the web, go to:
http://groups.yahoo.com/group/frame_dev/

Your email settings:
Individual Email | Traditional

To change settings online go to:
http://groups.yahoo.com/group/frame_dev/join
(Yahoo! ID required)

To change settings via email:
mailto:frame_dev-digest@yahoogroups.com
mailto:frame_dev-fullfeatured@yahoogroups.com

To unsubscribe from this group, send an email to:
frame_dev-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

[frame_dev] Re: Compiler Selection

I have used Visual Studio 2005 for 7.1 and 7.2
with no problems. Yet.

- Mark

…………

>
> Also, has anyone used Visual Studio .NET 2005 for clients with the
6.0,
> 7.0, 7.1 and 7.2 FDKs?
>
> Thanks
>

Yahoo! Groups Links

To visit your group on the web, go to:
http://groups.yahoo.com/group/frame_dev/

Your email settings:
Individual Email | Traditional

To change settings online go to:
http://groups.yahoo.com/group/frame_dev/join
(Yahoo! ID required)

To change settings via email:
mailto:frame_dev-digest@yahoogroups.com
mailto:frame_dev-fullfeatured@yahoogroups.com

To unsubscribe from this group, send an email to:
frame_dev-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

Re: [frame_dev] Compiler Selection

I haven’t seen any problems yet .. one client has been receiving fairly
heavy use and it seems fine so far. Keeping my fingers crossed.

It sure would be nice to have real documentation from Adobe though. I
figured that the delay in posting the FDK was so they could get the docs
completed .. apparently not. :(

….scott

Frank Elmore wrote:
>
> Scott. Thanks for the info. Yes, I used that technique with the FM8
> beta and it compiled correctly, but it seemed to generate some odd
> behavior during execution. I didn’t have time to investigate
> thoroughly back then. Have you had any problems running the FM8
> clients built with .NET 2003?
>
> Thanks
>
>
> —– Original Message —–
> *From:* Scott Prentice
> *To:* frame_dev@yahoogroups.com
> *Sent:* Tuesday, October 23, 2007 8:08 PM
> *Subject:* Re: [frame_dev] Compiler Selection
>
> I don’t have VS.NET 2005, so haven’t tried that, but I have built FM8
> FDK apps on VS.NET 2003 (using the beta FDK, not the new one). To
> build
> on VS.NET 2003, I’ve added the following to the “main” source file ..
>
> //————————————-
> #include
> #include
>
> int _stat32( const char *path, struct _stat *buffer ) { return
> _stat(path, buffer); }
> int _wstat32( const wchar_t *path, struct _stat *buffer ) { return
> _wstat(path, buffer); }
>
> long _ftol( double );
> long _ftol2_sse( double dblSource ) { return _ftol( dblSource ); }
> //————————————-
>
> Cheers,
>
> …scott
>
> elmsoft_frank wrote:
> >
> > The FDK for FM8 has been released. Unfortunately the docs are
> the same
> > as for the last beta. They still refer to compiler of choice being
> > Visual Studio .NET 2003, even though it appears that the
> compiler that
> > the FDK for FM8 prefers is .NET 2005.
> >
> > We would prefer to use one compiler, but we build clients for FM 6.0
> > through FM 8.0.
> >
> > Has anyone successfully used Visual Studio .NET 2003 for FM 8?
> >
> > Also, has anyone used Visual Studio .NET 2005 for clients with
> the 6.0,
> > 7.0, 7.1 and 7.2 FDKs?
> >
> > Thanks
> >
> >
>
>

Yahoo! Groups Links

To visit your group on the web, go to:
http://groups.yahoo.com/group/frame_dev/

Your email settings:
Individual Email | Traditional

To change settings online go to:
http://groups.yahoo.com/group/frame_dev/join
(Yahoo! ID required)

To change settings via email:
mailto:frame_dev-digest@yahoogroups.com
mailto:frame_dev-fullfeatured@yahoogroups.com

To unsubscribe from this group, send an email to:
frame_dev-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/