Hi all,
i want to get all page items and its frame and data from the document
Then i want to create my own xml.
any help? any advice ?please.
Pageitems are owned by the spreadlayer, you can traverse the spread and get the pageitems from it. Please refer the SDK for examples.
The general way to do this is to traverse the IHierarchy interface of the parent object to get the children.
Manan Joshi
- Efficient InDesign Solutions -
MetaDesign Solutions
http://metadesignsolutions.com/services/indesign-development.php
Hi joshi,
i have tried the sample code for checking the possibilties ,
InterfacePtr<IApplication> application(GetExecutionContextSession()->QueryApplication());
InterfacePtr<IDocumentList> documentList(application->QueryDocumentList());
for (int32 i = 0; i < documentList->GetDocCount(); i++) {
IDocument* document = documentList->GetNthDoc(i);
UIDRef ref=::GetUIDRef(document);
InterfacePtr<IHierarchy> hierarchy(ref, UseDefaultIID()); //issue, hierachy is not getting created. it just retrun nil
if (hierarchy == nil)
break;
int32 count=hierarchy->GetChildCount();
}
As i pointed out previously the owner of the Pageitems is spread layer and not the document, as far as i can recall IHierarchy won't exist on kDocBoss.
You need to go to the content layer of the document and then traverse its hierarchy. Have a look at the Layout Fundamentals in the programming guide.
Manan Joshi
- Efficient InDesign Solutions -
MetaDesign Solutions
http://metadesignsolutions.com/services/indesign-development.php
Hi all,
i use the following code to get all pageitem and its path type .i am able to get all page item's UIDRef .but i am not able to get its path type.
please help me!
for (int32 nPage = 0; nPage < numberOfPages; nPage++ )
{
UIDList pageItemList(database);
spread->GetItemsOnPage
(
nPage,
&pageItemList,
kFalse,
kFalse
);
// Iterate the page items and save off the UIDs of frames.
bool16 hasContent;
int32 pageItemListLength = pageItemList.Length();
for (int32 j = 0; j < pageItemListLength; j++ )
{
UIDRef pageItemRef = pageItemList.GetRef(j);
//InterfacePtr<IGraphicFrameData> graphicFrameData(pageItemRef, UseDefaultIID());
//hasContent =graphicFrameData->IsGraphicFrame();
InterfacePtr<IPathGeometry> pathGeometry(pageItemRef,UseDefaultIID());
if (pathGeometry != nil)
{
PMPageItemType pathType = Utils<IPathUtils>()->WhichKindOfPageItem(pathGeometry); // issue ,this statement is not return the path type
switch (pathType)
{
case kIsPoint:
break;
case kIsLine:
break;
case kIsSquare:
break;
case kIsRectangle:
break;
case kIsCircle:
break;
case kIsOval:
break;
case kIsPoly:
break;
case kIsPath:
break;
case kIsCompoundPath:
break;
default:
break;
}
}
}
North America
Europe, Middle East and Africa
Asia Pacific