Any chance you know the corresponding java?  I'm tripping over not
seeing the currentController, then finding that to not see the cursor,
etc...

Plus, I can't find the Page service you're talking about in the java
api?

(Sorry for being such a beginner).

Aaron


-----Original Message-----
From: Cor Nouws [mailto:[email protected]] 
Sent: Thursday, April 09, 2009 2:33 PM
To: [email protected]
Subject: Re: [api-dev] api to get page count

Hi Aaron,

Aaron Ehrensberger wrote (9-4-2009 20:01)
> I'm trying to get the page count of a document through the API.  
> 
> I've tried...
> 
> Object document = xComponentLoader.loadComponentFromURL(docURL,
> "_blank", 0, loaderValues);
> 
> XDocumentProperties xProps = (XDocumentProperties)
> UnoRuntime.queryInterface(XDocumentProperties.class, document);
> 
> NamedValue[] stats = xProps.getDocumentStatistics();
> 
> To get the statistics of the doc, which should have the page count,
but
> the xProps value is NULL.
> 
> I also looked into... com.sun.star.text.TextField.PageCount -
>
http://api.openoffice.org/docs/common/ref/com/sun/star/text/textfield/Pa
> geCount.html  - but I don't know how to actually retrieve the "short"
> value of that represents the number of pages.
> 
> Is there an easy way to get the page count of the document that I'm
> missing?  

I've just looked in OOoBasic, what I am used to.
ThisComponent.CurrentControler.PageCount does it.

ThisComponent.CurrentController.ViewCursor.Page returns the page number.

Hope this helps,
Cor


-- 
Cor Nouws    -    nl.OpenOffice.org marketing contact
= "2009 - Develop OOo"   =   www.nieuwsteoffice.nl  =

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to