These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

PDF portfolio navigator

rambovn
Registered: Sep 14 2008
Posts: 23

Hi all,

I want to develop a NAV file.
I start to loop through the _host.collection.items just after the GUI is initialized and _host is not null.
So far so good.
BUT:
if the item in _host.collection.items is a folder. I want to count the number of children. It is not working: item.children.length is always 0 at the moment.

Any one have any idea?: Lazy loading??? Bug???
And how to solve it?

@MODs: If it is not the correct place for this topic, please move it to the correct place.

Thank you for any help.

My Product Information:
Acrobat Pro Extended 9.3.1, Windows
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
You may need to set the 'disclosed' property of each pdf to 'true'

You can find more about creating a NAV file for portfolios at [url=http://joelgeraci.com/adobe/devjunkie/web/]The "Customizing PDF Portfolio Layouts" Series[/url] By Joel Geraci.

George Kaiser

rambovn
Registered: Sep 14 2008
Posts: 23
I read already the whole series.

This code is just after the GUI is initialized and _host is not null.

if(_host!=null && _TreeInitialized)
{
for each (var item: IAttachment in _host.collection.items)
{
if (item.isFolder){
Alert.show(item.children.length); //--- always 0
}


}
}


About "You may need to set the 'disclosed' property of each pdf to 'true'", i do not really understand.

Thank you for your help.
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
That is a document property introduced in version 5 of Acrobat and if that PDF property is not 'true' another PDF can not use JavaScript to access that PDF.

Have you tried posting to that blog or sending Joe an email?

A snippet of code from an object that contains many functions is very hard to debug.

Are you sure the the folder has children?

You might want to add more code that shows you more information about what you have.

George Kaiser

rambovn
Registered: Sep 14 2008
Posts: 23
I want do develop a NAV file with flex, not javascript. So i think that property is not important here.
I do not have much code, i just make sure that GUI is initialized and _host is not null. and then this code snippet.
And, yes, i am sure that the folder has children.

And if i switch to the list view and then come back to the home view (my nav file), then it show the correct value of item.children.length. It is really strange, right?

I do not have the email address of Joe. Do you have?
rambovn
Registered: Sep 14 2008
Posts: 23
and the whole code:
<?xml version="1.0" encoding="utf-8"?>
rambovn
Registered: Sep 14 2008
Posts: 23
somebody helps me please....
JoelGeraci
ExpertTeam
Registered: Aug 17 2006
Posts: 80
I suspect it's lazy loading. Try setting the current folder to that folder and then getting the children.

J-
rambovn
Registered: Sep 14 2008
Posts: 23
Hello Joel,

I change according to your suggestion, and it still not works.

<?xml version="1.0" encoding="utf-8"?>
JoelGeraci
ExpertTeam
Registered: Aug 17 2006
Posts: 80
Please look for an email from me - let's take this out of the forum.
mlind
Registered: Jul 12 2010
Posts: 1
Hello Joel,
Is there now a solution for this problem?
I wrote to you an E-Mail on July, 12 because you wanted to take that point out of the forum, but I have not received a response until today.

Thank you for your help