Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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();
}
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Hi, joshi can you suggest me any sdk samples to understand this
Copy link to clipboard
Copied
For completeness sake you may also want to cover "TOP" type on path and anchored page items.
Dirk
Copy link to clipboard
Copied
You also can iterate all of UIDs in doc’s database.
Have a look on IDataBase.h and there are several examples in the SDK.
Copy link to clipboard
Copied
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;
}
}
}
Copy link to clipboard
Copied
Hi,
did you try it with IPageItemTypeUtils instead of IPathUtils?
Markus
Find more inspiration, events, and resources on the new Adobe Community
Explore Now