How to retreive the number of pages of calc.

スプレッドシート (Calc) について
返信する
shigemash
記事: 3
登録日時: 9月 15, 2010, 9:32 pm

How to retreive the number of pages of calc.

投稿記事 by shigemash »

I'd like to retreive the number of pages of a file by java application.
In the case of writer or impress , I know how to get it.
ex.)
Using following APIs.
XDrawPagesSupplier::getDrawPages()
XDrawPages::getCount()

But in the case of calc I don't know it.

So, please tell me
アバター
khirano
記事: 691
登録日時: 5月 25, 2008, 12:15 pm
お住まい: Doya-cho, Ichinoseki-shi, Iwate-ken, Japan
連絡する:

Re: How to retreive the number of pages of calc.

投稿記事 by khirano »

Hi shigemash,

Can you go to http://user.services.openoffice.org/en/forum/ and register, then post your question?

Thanks,
khirano
Apache OpenOffice 4.0 on Windows Vista
shigemash
記事: 3
登録日時: 9月 15, 2010, 9:32 pm

Re: How to retreive the number of pages of calc.

投稿記事 by shigemash »

ご指摘ありがとうございます。
英語の方のサイトに登録しました。

http://user.services.openoffice.org/en/ ... =9&t=34152

別のコミュニティに似たようなことで悩んでいる人がいました。
http://www.oooforum.org/forum/viewtopic.phtml?p=275744
でもこの方法では処理時間がかかってしょうがないような気がします。。。
RHEL5???OpenOffice3.2.0??????
アバター
khirano
記事: 691
登録日時: 5月 25, 2008, 12:15 pm
お住まい: Doya-cho, Ichinoseki-shi, Iwate-ken, Japan
連絡する:

Re: How to retreive the number of pages of calc.

投稿記事 by khirano »

shigemash さん

日本語でOKでしたか。
:)
こちらは日本語のコミュニティーフォーラムですので日本語でご投稿ください。

http://user.services.openoffice.org/

オランダ語で投稿したい場合はオランダ語フォーラムに
英語で投稿したい場合は英語フォーラムに という具合になっております。

今後ともよろしくお願いいたします。
Apache OpenOffice 4.0 on Windows Vista
MoIshihara
記事: 337
登録日時: 6月 21, 2010, 6:52 am

Re: How to retreive the number of pages of calc.

投稿記事 by MoIshihara »

shigemash さん こんにちは

・処理時間を気にされている様ですが、Calc の場合では印刷時に行高さの再調整が行われる為どうしても、
(ファイルを読み込み後)最初の1回は遅くなる様です、これはプリントプレビューを表示させた時やドキュメントの
プロパティを表示させた時にも同様の時間が掛かっています。
・行高さが自動調整になっていない場合でも(たぶん調整済みフラグ)テーブルの作成等で最初の1回は若干時間が、
掛かっている様です。
・もし行高さの再調整を行わずにページ数を求めると、実際のページ数とは異なった結果を得る場合もあるはずです。

・getRendererCount メソッドは引数のセレクションに自分自身を指定して、ドキュメント全体のページ数を得る事も出来ます。

例)Basic

コード: 全て選択

Dim nPageCount As Long
nPageCount = oDoc.getRendererCount(oDoc, Array)
例)Java は書いたことが無いのでよく解っていませんが、たぶんこんな感じだろうと思います。

コード: 全て選択

PropertyValue[] a = new PropertyValue[0];
int nPageCount = oDoc.getRendererCount(oDoc, a);
・もし Calc ドキュメント全体に印刷範囲を設定している場合でしたら、Sheet オブジェクトの getPrintAreas メソッドが使えます

例)Basic

コード: 全て選択

Dim i As Integer
Dim nPageCount As Long

nPageCount = 0
for i = 0 to oDoc.Sheets.Count - 1
	nPageCount = nPageCount + UBound(oDoc.Sheets(i).getPrintAreas) + 1
next
shigemash
記事: 3
登録日時: 9月 15, 2010, 9:32 pm

Re: How to retreive the number of pages of calc.

投稿記事 by shigemash »

MoIshihara さん
ありがとうございます。
チャレンジしてみたいと思います。
RHEL5???OpenOffice3.2.0??????
返信する

“Calc”に戻る