🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.framemaker.sgml
Article #400

Re: FDK select all components (files) in a book

#400
From: Robert_Low
Date: Tue, 11 Nov 2008 22:24
46 lines
2633 bytes
Hi Russ,

Thanks for all the information. Now, I have to work on another piece first. I have to say that I am not really a FrameMaker authoring expert.

I need to output the name of the flows (is flow an element?) and their text in the order they appear in each document inside a book.

I read the fdkguide and fdkref, I came up with 2 pieces of code and I do not know the differences between them. Would you like to enlight my ignorance?

A)
	activeDocId = F_ApiGetId(0,FV_SessionId,FP_ActiveDoc);
	// the flow
	objId = F_ApiGetId( FV_SessionId, activeDocId, FP_FirstFlowInDoc );
	while( objId ){
		textItems = F_ApiGetText( activeDocId, objId, FTI_String );
		text = CreateStringFromTextItems( textItems );
		// {...Do some comparison using F_StrSubstr ...}
		F_Sprintf(msg, "The document paragraph text is:\n%s.",text);
		F_Printf(chan, msg);
		F_Printf(chan, "\n");
		// F_ApiAlert(msg, FF_ALERT_CONTINUE_NOTE);
		F_Free( text );
		F_ApiDeallocateTextItems( &textItems );
		// pgfId = F_ApiGetId( activeDocId, pgfId, FP_NextPgfInDoc);
		objId = F_ApiGetId( activeDocId, objId, FP_NextFlowInDoc);
	}

B)
	docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
	flowId = F_ApiGetId(FV_SessionId, docId, FP_MainFlowInDoc);
	tis = F_ApiGetText(docId, flowId, FTI_String | FTI_LineEnd);
	/* Traverse text items and print strings and line ends. */
	for (i=0; i<tis.len; i++) 	{ 		ip = &tis.val[i]; 		if (ip->dataType == FTI_String)
			// F_Printf(NULL,"%s", ip->u.sdata);
			F_Printf(chan,"%s", ip->u.sdata);
		else
			// F_Printf(NULL,"\n");
			F_Printf(chan,"\n");
	}

One starts with the first flow and the other starts with the main flow. Should they be the same? Is this the way of reporting name of flows and their text?

Also, it gives me some non-ascii characters in the text output when I print it to a specified channed. Is there anyway that I can convert the FrameMaker text strings into iso or ascii strings to output?

Thanks,

Robert
Technical Details
Message-ID: <59b6efc2.3@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.germany.com!news.solace.miun.se!news.solace.miun.se!news4us.nl!webcrossing
References: <59b6efc2.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: fcc08,4185e7e93f118d2d,start
X-Google-Attributes: gidfcc08,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Robert_Low@adobeforums.com
Newsgroups: adobe.framemaker.sgml
Subject: Re: FDK select all components (files) in a book
Message-ID: <59b6efc2.3@webcrossing.la2eafNXanI>
Date: Tue, 11 Nov 2008 14:24:12 -0800
References: <59b6efc2.-1@webcrossing.la2eafNXanI>
Lines: 57
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.germany.com!news.solace.miun.se!news.solace.miun.se!news4us.nl!webcrossing