[api-dev] Re: How to insert a page break

2011-05-04 Thread Herter, Scott
I can't get to the API reference at the moment, keeps timing out on the web 
page.  As soon as I can get to the website again I will look that up.

In the mean time I get a page cursor when I have moved the view cursor to the 
point I want to be at and then use the page number to decide if I am putting in 
a single or double page break based on what type of page break it is.  It 
works, but relies on my math being right and the definition of left and right 
never changing.  I would prefer to let OpenOffice figure out if there should be 
one or two page breaks in those cases, especially if we ever get in to 
languages that read right to left.

-Original Message-
From: Cor Nouws [mailto:oo...@nouenoff.nl] 
Sent: Wednesday, May 04, 2011 3:31 PM
To: dev@api.openoffice.org
Subject: [api-dev] Re: How to insert a page break

Herter, Scott wrote (04-05-11 21:13)
> I figured out how to set a page break through the cursor properties, I
> just can't find a way to break left/right or odd/even.

My idea would be to set the page style.

Regards,
Cor

-- 
  - http://nl.libreoffice.org
  - giving openoffice.org its foundation :: The Document Foundation -

-- 
-
To unsubscribe send email to dev-unsubscr...@api.openoffice.org
For additional commands send email to sy...@api.openoffice.org
with Subject: help

-- 
-
To unsubscribe send email to dev-unsubscr...@api.openoffice.org
For additional commands send email to sy...@api.openoffice.org
with Subject: help


[api-dev] Re: How to insert a page break

2011-05-04 Thread Herter, Scott
I figured out how to set a page break through the cursor properties, I just 
can't find a way to break left/right or odd/even.

Thanks.

From: Herter, Scott [mailto:scott.her...@napersoft.com]
Sent: Wednesday, May 04, 2011 1:25 PM
To: dev@api.openoffice.org
Subject: [api-dev] How to insert a page break

I am trying to go through a document and insert a page break at a certain point 
in the document.  Specifically I need to insert either a break right or break 
left code.  I can search through the document, I can insert text, I can remove 
text, I can't find any way to insert a break through the API.

I tried recording a macro, but that only showed me how to pop up the insert 
break dialog, not very helpful.  I have been combing through the API 
documentation trying to find some way to insert a new page break and have not 
been able to find anything close to that.

Any suggestions on which API calls to look at?  I can get an XComponent, 
XTextDocument, XText, and any component they implement, I just can't figure out 
which API call will insert a page break.

Thanks.

--
I used to think I wasn't a morning person, but things never got better after 
lunch.
-- Wally from Dilbert

-- 
-
To unsubscribe send email to dev-unsubscr...@api.openoffice.org
For additional commands send email to sy...@api.openoffice.org
with Subject: help


[api-dev] How to insert a page break

2011-05-04 Thread Herter, Scott
I am trying to go through a document and insert a page break at a certain point 
in the document.  Specifically I need to insert either a break right or break 
left code.  I can search through the document, I can insert text, I can remove 
text, I can't find any way to insert a break through the API.

I tried recording a macro, but that only showed me how to pop up the insert 
break dialog, not very helpful.  I have been combing through the API 
documentation trying to find some way to insert a new page break and have not 
been able to find anything close to that.

Any suggestions on which API calls to look at?  I can get an XComponent, 
XTextDocument, XText, and any component they implement, I just can't figure out 
which API call will insert a page break.

Thanks.

--
I used to think I wasn't a morning person, but things never got better after 
lunch.
-- Wally from Dilbert

-- 
-
To unsubscribe send email to dev-unsubscr...@api.openoffice.org
For additional commands send email to sy...@api.openoffice.org
with Subject: help


[api-dev] [SOLVED] RE: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through the API

2011-01-04 Thread Herter, Scott
I finally figured out what the problem was.  It turned out that we would often 
send a copy count of 0 as a default and that was being interpreted literally by 
the newer versions of OpenOffice (we were on a really old version).  The 
product uses a database to pull information from, it just happened that when 
running on the desktop the copy count was set to one and on the server it was 
taking a default of 0.  When I changed the default on the server it worked.

-Original Message-
From: Herter, Scott [mailto:scott.her...@napersoft.com] 
Sent: Friday, December 31, 2010 7:10 AM
To: dev@api.openoffice.org
Subject: RE: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through 
the API

I have a stripped down test program and it is working on the server.  I am now 
trying to figure out what is different that is causing the problem.  My next 
steps are to add all the jar files from our product EAR/WAR in to my test 
EAR/WAR and see if the problem reproduces, if it does, I then start taking them 
out and try to figure out where the conflict is.  If I put them all in and it 
still works, then I move the printing off to separate threads and see if it is 
something in the threading that is causing a problem.  We do have a connection 
pool for the connections to OpenOffice to make sure that two threads don't try 
to access the same instance of OpenOffice at the same time.  I have already put 
the pooling code in to the test program to make sure it wasn't something weird 
there.

-Original Message-----
From: Herter, Scott [mailto:scott.her...@napersoft.com] 
Sent: Monday, December 20, 2010 11:02 AM
To: dev@api.openoffice.org
Subject: RE: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through 
the API

That is encouraging, it could boil down to us setting a property we don't need 
or setting one with an invalid value causing this which would be easy to fix.  
Perhaps something that is valid on the desktops but not on the servers.  We set 
a bunch of properties as we set the number of pages, paper size, collation, etc.

-Original Message-
From: Jürgen Schmidt [mailto:juergen.schm...@oracle.com] 
Sent: Monday, December 20, 2010 10:18 AM
To: dev@api.openoffice.org
Subject: Re: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through 
the API

ok, to be more precise -> i have tested on a Windows 2003 Server R2
Enterprise Edition Service Pack 2 ;-)

Juergen

On 12/20/10 5:03 PM, Herter, Scott wrote:
> We didn't try 2003 Server, we tried 2003 R2 server.  Considering the 
> differences between 2008 and 2008 R2, that could be significant.  I will try 
> to get a VM with 2003 server at some point just to validate it.
> 
> -Original Message-
> From: Jürgen Schmidt [mailto:juergen.schm...@oracle.com] 
> Sent: Monday, December 20, 2010 10:00 AM
> To: dev@api.openoffice.org
> Subject: Re: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers 
> through the API
> 
> as i mentioned before, i have tried the SDK example
> /examples/java/documenthandling/DocumentPrinter.java just a few
> minutes before i wrote the email. Everything works for me on a Win 2003
> server (32bit).
> 
> Juergen
> 
> On 12/20/10 4:46 PM, Herter, Scott wrote:
>> That is my next step.  At this point with the holidays it boils down to 
>> time.  I hope to have a simple sample done in a week or two.  I posted out 
>> here to see if someone had run in to this before and could say "Oh yeah, 
>> change security setting blah and it will work".
>>
>> -Original Message-
>> From: Jürgen Schmidt [mailto:juergen.schm...@oracle.com] 
>> Sent: Monday, December 20, 2010 9:39 AM
>> To: dev@api.openoffice.org
>> Subject: Re: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers 
>> through the API
>>
>> Hi,
>>
>> i would like to suggest that you strip down the problem and try to print
>> from a simple remote Java application using the simple bootstrap
>> mechanism, load a document and print it via XPrintable ...
>>
>> If that also does not work feel free to submit an issue with the example
>> attached.
>>
>> I can't remember any problems in case of Win2003 server so far. The
>> related SDK example works as expected using the default printer.
>>
>> I assume that it is a problem with your setup and your J2EE app. Under
>> which user account do you try to print on the server? Maybe it's a
>> problem with the user.
>>
>> Juergen
>>
>>
>> On 12/20/10 3:06 PM, Herter, Scott wrote:
>>> Sorry, that was the first thing we checked.  We also paused all the 
>>> printers to see if it was going to some other queue.  We also find it 
>>> really weird that it works on desktops but not servers.  W

RE: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through the API

2010-12-31 Thread Herter, Scott
I have a stripped down test program and it is working on the server.  I am now 
trying to figure out what is different that is causing the problem.  My next 
steps are to add all the jar files from our product EAR/WAR in to my test 
EAR/WAR and see if the problem reproduces, if it does, I then start taking them 
out and try to figure out where the conflict is.  If I put them all in and it 
still works, then I move the printing off to separate threads and see if it is 
something in the threading that is causing a problem.  We do have a connection 
pool for the connections to OpenOffice to make sure that two threads don't try 
to access the same instance of OpenOffice at the same time.  I have already put 
the pooling code in to the test program to make sure it wasn't something weird 
there.

-Original Message-----
From: Herter, Scott [mailto:scott.her...@napersoft.com] 
Sent: Monday, December 20, 2010 11:02 AM
To: dev@api.openoffice.org
Subject: RE: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through 
the API

That is encouraging, it could boil down to us setting a property we don't need 
or setting one with an invalid value causing this which would be easy to fix.  
Perhaps something that is valid on the desktops but not on the servers.  We set 
a bunch of properties as we set the number of pages, paper size, collation, etc.

-Original Message-
From: Jürgen Schmidt [mailto:juergen.schm...@oracle.com] 
Sent: Monday, December 20, 2010 10:18 AM
To: dev@api.openoffice.org
Subject: Re: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through 
the API

ok, to be more precise -> i have tested on a Windows 2003 Server R2
Enterprise Edition Service Pack 2 ;-)

Juergen

On 12/20/10 5:03 PM, Herter, Scott wrote:
> We didn't try 2003 Server, we tried 2003 R2 server.  Considering the 
> differences between 2008 and 2008 R2, that could be significant.  I will try 
> to get a VM with 2003 server at some point just to validate it.
> 
> -Original Message-
> From: Jürgen Schmidt [mailto:juergen.schm...@oracle.com] 
> Sent: Monday, December 20, 2010 10:00 AM
> To: dev@api.openoffice.org
> Subject: Re: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers 
> through the API
> 
> as i mentioned before, i have tried the SDK example
> /examples/java/documenthandling/DocumentPrinter.java just a few
> minutes before i wrote the email. Everything works for me on a Win 2003
> server (32bit).
> 
> Juergen
> 
> On 12/20/10 4:46 PM, Herter, Scott wrote:
>> That is my next step.  At this point with the holidays it boils down to 
>> time.  I hope to have a simple sample done in a week or two.  I posted out 
>> here to see if someone had run in to this before and could say "Oh yeah, 
>> change security setting blah and it will work".
>>
>> -Original Message-
>> From: Jürgen Schmidt [mailto:juergen.schm...@oracle.com] 
>> Sent: Monday, December 20, 2010 9:39 AM
>> To: dev@api.openoffice.org
>> Subject: Re: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers 
>> through the API
>>
>> Hi,
>>
>> i would like to suggest that you strip down the problem and try to print
>> from a simple remote Java application using the simple bootstrap
>> mechanism, load a document and print it via XPrintable ...
>>
>> If that also does not work feel free to submit an issue with the example
>> attached.
>>
>> I can't remember any problems in case of Win2003 server so far. The
>> related SDK example works as expected using the default printer.
>>
>> I assume that it is a problem with your setup and your J2EE app. Under
>> which user account do you try to print on the server? Maybe it's a
>> problem with the user.
>>
>> Juergen
>>
>>
>> On 12/20/10 3:06 PM, Herter, Scott wrote:
>>> Sorry, that was the first thing we checked.  We also paused all the 
>>> printers to see if it was going to some other queue.  We also find it 
>>> really weird that it works on desktops but not servers.  We used the same 
>>> copy of JBoss, the same JDK, the same EAR file and it works on Windows 
>>> desktops and not on the Windows servers.  We have even tried both 32 and 64 
>>> bit Windows boxes and that doesn't make a difference either.
>>>
>>> -Original Message-
>>> From: Cor Nouws [mailto:oo...@nouenoff.nl] 
>>> Sent: Monday, December 20, 2010 7:56 AM
>>> To: dev@api.openoffice.org
>>> Subject: Re: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers 
>>> through the API
>>>
>>> Hi Herter,
>>>
>>> Herter, Scott wrote (20-12-10 14:17)
>>>> At thi

RE: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through the API

2010-12-20 Thread Herter, Scott
That is encouraging, it could boil down to us setting a property we don't need 
or setting one with an invalid value causing this which would be easy to fix.  
Perhaps something that is valid on the desktops but not on the servers.  We set 
a bunch of properties as we set the number of pages, paper size, collation, etc.

-Original Message-
From: Jürgen Schmidt [mailto:juergen.schm...@oracle.com] 
Sent: Monday, December 20, 2010 10:18 AM
To: dev@api.openoffice.org
Subject: Re: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through 
the API

ok, to be more precise -> i have tested on a Windows 2003 Server R2
Enterprise Edition Service Pack 2 ;-)

Juergen

On 12/20/10 5:03 PM, Herter, Scott wrote:
> We didn't try 2003 Server, we tried 2003 R2 server.  Considering the 
> differences between 2008 and 2008 R2, that could be significant.  I will try 
> to get a VM with 2003 server at some point just to validate it.
> 
> -Original Message-
> From: Jürgen Schmidt [mailto:juergen.schm...@oracle.com] 
> Sent: Monday, December 20, 2010 10:00 AM
> To: dev@api.openoffice.org
> Subject: Re: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers 
> through the API
> 
> as i mentioned before, i have tried the SDK example
> /examples/java/documenthandling/DocumentPrinter.java just a few
> minutes before i wrote the email. Everything works for me on a Win 2003
> server (32bit).
> 
> Juergen
> 
> On 12/20/10 4:46 PM, Herter, Scott wrote:
>> That is my next step.  At this point with the holidays it boils down to 
>> time.  I hope to have a simple sample done in a week or two.  I posted out 
>> here to see if someone had run in to this before and could say "Oh yeah, 
>> change security setting blah and it will work".
>>
>> -Original Message-
>> From: Jürgen Schmidt [mailto:juergen.schm...@oracle.com] 
>> Sent: Monday, December 20, 2010 9:39 AM
>> To: dev@api.openoffice.org
>> Subject: Re: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers 
>> through the API
>>
>> Hi,
>>
>> i would like to suggest that you strip down the problem and try to print
>> from a simple remote Java application using the simple bootstrap
>> mechanism, load a document and print it via XPrintable ...
>>
>> If that also does not work feel free to submit an issue with the example
>> attached.
>>
>> I can't remember any problems in case of Win2003 server so far. The
>> related SDK example works as expected using the default printer.
>>
>> I assume that it is a problem with your setup and your J2EE app. Under
>> which user account do you try to print on the server? Maybe it's a
>> problem with the user.
>>
>> Juergen
>>
>>
>> On 12/20/10 3:06 PM, Herter, Scott wrote:
>>> Sorry, that was the first thing we checked.  We also paused all the 
>>> printers to see if it was going to some other queue.  We also find it 
>>> really weird that it works on desktops but not servers.  We used the same 
>>> copy of JBoss, the same JDK, the same EAR file and it works on Windows 
>>> desktops and not on the Windows servers.  We have even tried both 32 and 64 
>>> bit Windows boxes and that doesn't make a difference either.
>>>
>>> -Original Message-
>>> From: Cor Nouws [mailto:oo...@nouenoff.nl] 
>>> Sent: Monday, December 20, 2010 7:56 AM
>>> To: dev@api.openoffice.org
>>> Subject: Re: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers 
>>> through the API
>>>
>>> Hi Herter,
>>>
>>> Herter, Scott wrote (20-12-10 14:17)
>>>> At this point I don't know what the exact problem is or why it is not
>>>> working on Windows Servers but is working on Windows Desktops.
>>>
>>> Maybe something simple/stupid as a default printer?
>>> (To be honest, I have no real idea how the difference might be between 
>>> the XP setting and the server installations)
>>>
>>> Best - Cor
>>>
>>>
>>
>>
>> -
>> To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
>> For additional commands, e-mail: dev-h...@api.openoffice.org
>>
>>
> 
> 


-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org




RE: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through the API

2010-12-20 Thread Herter, Scott
We didn't try 2003 Server, we tried 2003 R2 server.  Considering the 
differences between 2008 and 2008 R2, that could be significant.  I will try to 
get a VM with 2003 server at some point just to validate it.

-Original Message-
From: Jürgen Schmidt [mailto:juergen.schm...@oracle.com] 
Sent: Monday, December 20, 2010 10:00 AM
To: dev@api.openoffice.org
Subject: Re: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through 
the API

as i mentioned before, i have tried the SDK example
/examples/java/documenthandling/DocumentPrinter.java just a few
minutes before i wrote the email. Everything works for me on a Win 2003
server (32bit).

Juergen

On 12/20/10 4:46 PM, Herter, Scott wrote:
> That is my next step.  At this point with the holidays it boils down to time. 
>  I hope to have a simple sample done in a week or two.  I posted out here to 
> see if someone had run in to this before and could say "Oh yeah, change 
> security setting blah and it will work".
> 
> -Original Message-
> From: Jürgen Schmidt [mailto:juergen.schm...@oracle.com] 
> Sent: Monday, December 20, 2010 9:39 AM
> To: dev@api.openoffice.org
> Subject: Re: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers 
> through the API
> 
> Hi,
> 
> i would like to suggest that you strip down the problem and try to print
> from a simple remote Java application using the simple bootstrap
> mechanism, load a document and print it via XPrintable ...
> 
> If that also does not work feel free to submit an issue with the example
> attached.
> 
> I can't remember any problems in case of Win2003 server so far. The
> related SDK example works as expected using the default printer.
> 
> I assume that it is a problem with your setup and your J2EE app. Under
> which user account do you try to print on the server? Maybe it's a
> problem with the user.
> 
> Juergen
> 
> 
> On 12/20/10 3:06 PM, Herter, Scott wrote:
>> Sorry, that was the first thing we checked.  We also paused all the printers 
>> to see if it was going to some other queue.  We also find it really weird 
>> that it works on desktops but not servers.  We used the same copy of JBoss, 
>> the same JDK, the same EAR file and it works on Windows desktops and not on 
>> the Windows servers.  We have even tried both 32 and 64 bit Windows boxes 
>> and that doesn't make a difference either.
>>
>> -Original Message-
>> From: Cor Nouws [mailto:oo...@nouenoff.nl] 
>> Sent: Monday, December 20, 2010 7:56 AM
>> To: dev@api.openoffice.org
>> Subject: Re: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers 
>> through the API
>>
>> Hi Herter,
>>
>> Herter, Scott wrote (20-12-10 14:17)
>>> At this point I don't know what the exact problem is or why it is not
>>> working on Windows Servers but is working on Windows Desktops.
>>
>> Maybe something simple/stupid as a default printer?
>> (To be honest, I have no real idea how the difference might be between 
>> the XP setting and the server installations)
>>
>> Best - Cor
>>
>>
> 
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
> For additional commands, e-mail: dev-h...@api.openoffice.org
> 
> 


-- 
Oracle <http://www.oracle.com>
Jürgen Schmidt | Principal Software Engineer
Oracle Office GBU

ORACLE Deutschland B.V. & Co. KG | Nagelsweg 55 | 20097 Hamburg

ORACLE Deutschland B.V. & Co. KG
Hauptverwaltung: Riesstr. 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Rijnzathe 6, 3454PV De Meern, Niederlande
Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
Geschäftsführer: Jürgen Kunz, Marcel van de Molen, Alexander van der Ven

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org




RE: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through the API

2010-12-20 Thread Herter, Scott
That is my next step.  At this point with the holidays it boils down to time.  
I hope to have a simple sample done in a week or two.  I posted out here to see 
if someone had run in to this before and could say "Oh yeah, change security 
setting blah and it will work".

-Original Message-
From: Jürgen Schmidt [mailto:juergen.schm...@oracle.com] 
Sent: Monday, December 20, 2010 9:39 AM
To: dev@api.openoffice.org
Subject: Re: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through 
the API

Hi,

i would like to suggest that you strip down the problem and try to print
from a simple remote Java application using the simple bootstrap
mechanism, load a document and print it via XPrintable ...

If that also does not work feel free to submit an issue with the example
attached.

I can't remember any problems in case of Win2003 server so far. The
related SDK example works as expected using the default printer.

I assume that it is a problem with your setup and your J2EE app. Under
which user account do you try to print on the server? Maybe it's a
problem with the user.

Juergen


On 12/20/10 3:06 PM, Herter, Scott wrote:
> Sorry, that was the first thing we checked.  We also paused all the printers 
> to see if it was going to some other queue.  We also find it really weird 
> that it works on desktops but not servers.  We used the same copy of JBoss, 
> the same JDK, the same EAR file and it works on Windows desktops and not on 
> the Windows servers.  We have even tried both 32 and 64 bit Windows boxes and 
> that doesn't make a difference either.
> 
> -Original Message-
> From: Cor Nouws [mailto:oo...@nouenoff.nl] 
> Sent: Monday, December 20, 2010 7:56 AM
> To: dev@api.openoffice.org
> Subject: Re: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers 
> through the API
> 
> Hi Herter,
> 
> Herter, Scott wrote (20-12-10 14:17)
>> At this point I don't know what the exact problem is or why it is not
>> working on Windows Servers but is working on Windows Desktops.
> 
> Maybe something simple/stupid as a default printer?
> (To be honest, I have no real idea how the difference might be between 
> the XP setting and the server installations)
> 
> Best - Cor
> 
> 


-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org




RE: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through the API

2010-12-20 Thread Herter, Scott
Sorry, that was the first thing we checked.  We also paused all the printers to 
see if it was going to some other queue.  We also find it really weird that it 
works on desktops but not servers.  We used the same copy of JBoss, the same 
JDK, the same EAR file and it works on Windows desktops and not on the Windows 
servers.  We have even tried both 32 and 64 bit Windows boxes and that doesn't 
make a difference either.

-Original Message-
From: Cor Nouws [mailto:oo...@nouenoff.nl] 
Sent: Monday, December 20, 2010 7:56 AM
To: dev@api.openoffice.org
Subject: Re: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through 
the API

Hi Herter,

Herter, Scott wrote (20-12-10 14:17)
> At this point I don't know what the exact problem is or why it is not
> working on Windows Servers but is working on Windows Desktops.

Maybe something simple/stupid as a default printer?
(To be honest, I have no real idea how the difference might be between 
the XP setting and the server installations)

Best - Cor


-- 
  - giving openoffice.org its foundation :: The Document Foundation -


-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org




RE: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through the API

2010-12-20 Thread Herter, Scott
We aren't trying to print in Basic, we are trying to print from a JEE 
application using Java and the UNO API.  I was recording macros in Basic to try 
and figure out where the problem was.  In java I get the XPrintable interface 
on the document object and then use that to print.  On Windows XP and Vista 
machines that works fine, on Windows Server 2003 R2, 2008, and 2008 R2 nothing 
happens.  I can see the document load, then unload, but nothing shows up in the 
Windows print queue and no exception is generated in the API.  If I open 
OpenOffice manually, open a document, then print all using the menus then it 
works fine.  If I record a macro and then run the macro from the UI it works 
fine.  I noticed that the recorded macro was using the XDispatchHelper to do an 
executeDispatch so I tried doing that in my Java code but that resulted in it 
not printing on Windows XP as well and again I got no exception or any bad 
return code.

At this point I don't know what the exact problem is or why it is not working 
on Windows Servers but is working on Windows Desktops.  It appears to be 
something in the UNO bridge between the Java code and OpenOffice since I get no 
results and no errors.  The only thing I can think of is some sort of library 
issue with what is or is not on the servers that is different from the desktops 
or some sort of security issue that the servers are stopping an operation and 
the API is somehow losing the exception or return code from that.

-Original Message-
From: Fernand Vanrie [mailto:s...@pmgroup.be] 
Sent: Monday, December 20, 2010 2:36 AM
To: dev@api.openoffice.org
Subject: Re: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through 
the API

  Herter,

don't sea your exact problem but please find the correct way to print in 
Basic

oDocument.setModified(false)
   Dim mPrinter(1) As New com.sun.star.beans.PropertyValue
   mPrinter(0).Name="wait"
   mPrinter(0).value=true
   mPrinter(1).Name = "IsBusy"

dim bIsBusy as boolean
bIsBusy = True
While bIsBusy
dim aPrintConditions as object
aPrintConditions = oDocument.getPrinter()
dim i as integer
For i = LBound( aPrintConditions ) To UBound( aPrintConditions )
   If aPrintConditions(i).Name = "IsBusy" Then
  bIsBusy = aPrintConditions(i).Value
   EndIf
Next
Wait 10' Wait is a built in Basic statement
WEnd

   oDocument.Print(mPrinter(0))

hope it helps

Fernand
> I tried changing my Java code to use the XDispatchHelper to make the 
> .uno:Printer and .uno:Print calls, but that just resulted in nothing printing 
> with no errors coming out of the API.  Looks like I am going to have to 
> figure out how to call a macro and pass in the values and hope that works.
>
> -Original Message-
> From: Herter, Scott [mailto:scott.her...@napersoft.com]
> Sent: Sunday, December 19, 2010 9:44 AM
> To: dev@api.openoffice.org
> Subject: RE: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers 
> through the API
>
> I got the macro working at least similarly to what we are trying to do in the 
> java code.  It seems to be working correctly on the Server.  Kudos for the 
> record macro working to record the choices on the print dialog, in the 2.x 
> versions it did not (or at least I don't remember it recording anything).
>
> In our code we create an XPrintable interface and call setPrinter and Print.  
> The macros use the dispatcher and dispatches to .uno:Printer to set the 
> printer and .uno:Print to do the print.  Running the macro through the UI of 
> OpenOffice works on the server, I haven't worked out a way to call the macro 
> from our Java code and pass in the values we need to set the printing options 
> and the printer name.  I just need to look up the documentation for that (at 
> least I am assuming a way exists and I just have to find it).
>
> -Original Message-
> From: Herter, Scott [mailto:scott.her...@napersoft.com]
> Sent: Sunday, December 19, 2010 8:53 AM
> To: dev@api.openoffice.org; and...@pitonyak.org
> Subject: RE: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers 
> through the API
>
> Yes, you did because I didn't provide the information.  Sorry about that.
>
> 1. The macro I ran was the "executeDispatch() for uno:PrintDefault" call, not 
> the xprintable.print call.  That was because I simply did a record of 
> pressing the print button on the tool bar.  I still find the way the API is 
> used in macros very confusing and very different then calling it from my Java 
> program.
>
> 2. I ran the macro interactively through the menus on OpenOffice, I did not 
> call the macro from my Java program (don't know if that makes a difference 
> yet).
>
> -Original Message-
> From: Andrew Douglas Pitonyak [mailto:and...@pitony

RE: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through the API

2010-12-19 Thread Herter, Scott
I tried changing my Java code to use the XDispatchHelper to make the 
.uno:Printer and .uno:Print calls, but that just resulted in nothing printing 
with no errors coming out of the API.  Looks like I am going to have to figure 
out how to call a macro and pass in the values and hope that works.

-Original Message-
From: Herter, Scott [mailto:scott.her...@napersoft.com] 
Sent: Sunday, December 19, 2010 9:44 AM
To: dev@api.openoffice.org
Subject: RE: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through 
the API

I got the macro working at least similarly to what we are trying to do in the 
java code.  It seems to be working correctly on the Server.  Kudos for the 
record macro working to record the choices on the print dialog, in the 2.x 
versions it did not (or at least I don't remember it recording anything).

In our code we create an XPrintable interface and call setPrinter and Print.  
The macros use the dispatcher and dispatches to .uno:Printer to set the printer 
and .uno:Print to do the print.  Running the macro through the UI of OpenOffice 
works on the server, I haven't worked out a way to call the macro from our Java 
code and pass in the values we need to set the printing options and the printer 
name.  I just need to look up the documentation for that (at least I am 
assuming a way exists and I just have to find it).

-Original Message-----
From: Herter, Scott [mailto:scott.her...@napersoft.com] 
Sent: Sunday, December 19, 2010 8:53 AM
To: dev@api.openoffice.org; and...@pitonyak.org
Subject: RE: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through 
the API

Yes, you did because I didn't provide the information.  Sorry about that.

1. The macro I ran was the "executeDispatch() for uno:PrintDefault" call, not 
the xprintable.print call.  That was because I simply did a record of pressing 
the print button on the tool bar.  I still find the way the API is used in 
macros very confusing and very different then calling it from my Java program.

2. I ran the macro interactively through the menus on OpenOffice, I did not 
call the macro from my Java program (don't know if that makes a difference 
yet). 

-Original Message-
From: Andrew Douglas Pitonyak [mailto:and...@pitonyak.org] 
Sent: Saturday, December 18, 2010 10:57 PM
To: dev@api.openoffice.org
Subject: Re: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through 
the API

I really do not understand this. Let me restate the part the confuses me:

(1) I can print using a macro with no problem.

(2) I cannot print using the API

When you use a macro, you use the API; or did I miss something?




On 12/18/2010 12:05 PM, Herter, Scott wrote:
> We have encountered a strange problem that involves OpenOffice 3.2.1 (also 
> reproduced with OpenOffice 2.4 but does not reproduce with OpenOffice 2.1) on 
> Windows Server 2003 R2, 2008, and 2008 R2.  The basic problem is that it does 
> not print through the API.  The interesting thing is that the same program 
> with the same version of OpenOffice works on Windows XP and Vista.
>
> If we run OpenOffice interactively on the Windows Server box and print 
> through the menus or through a Macro it works, but when we try to do it 
> through the API nothing happens.  No exception and nothing shows up in the 
> Windows print queue.  We are using a Java program to talk to OpenOffice 
> through the UNO API and we have tried both Java 5 and Java 6 with the same 
> results.
>
> Convert to PDF, load and close work through the API, just not print.  The 
> call to xprintable.print simply returns (type void so there is no return code 
> to check) as if it worked.  I changed the code to not close the document 
> after printing and I can press the print button and the document that just 
> failed to print through the API would show up in the print queue.
>
> Our current thought is that Microsoft changed something in the security model 
> and maybe we need to do something different with permissions or with the 
> print API under the newer servers.  I have done a number of Google searches 
> and checked the API doc to see if something changed with regard to printing, 
> but it looks like we are doing everything correctly and it does work on XP 
> and Vista.  If anyone knows of anything we would appreciate some help.
>
> On the assumption that no-one has heard of this before these are the steps I 
> will be taking over the next several days to try and isolate the problem 
> further.
>
>
> 1.  Create a small stand alone program that reproduces the problem with a 
> test document.
>
> 2.  Currently the servers are all running as Microsoft HyperV virtual 
> machines whereas the XP and Vista boxes were running native on the hardware.  
> After creating the test program I will run it on a server that is not a 
> virtual ma

RE: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through the API

2010-12-19 Thread Herter, Scott
I got the macro working at least similarly to what we are trying to do in the 
java code.  It seems to be working correctly on the Server.  Kudos for the 
record macro working to record the choices on the print dialog, in the 2.x 
versions it did not (or at least I don't remember it recording anything).

In our code we create an XPrintable interface and call setPrinter and Print.  
The macros uses the dispatcher and dispatches to .uno:Printer to set the 
printer and .uno:Print to do the print.  Running the macro through the UI of 
OpenOffice works on the server, I haven't worked out a way to call the macro 
from our Java code and pass in the values we need to set the printing options 
and the printer name.  I just need to look up the documentation for that (at 
least I am assuming a way exists and I just have to find it).

-Original Message-----
From: Herter, Scott [mailto:scott.her...@napersoft.com] 
Sent: Sunday, December 19, 2010 8:53 AM
To: dev@api.openoffice.org; and...@pitonyak.org
Subject: RE: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through 
the API

Yes, you did because I didn't provide the information.  Sorry about that.

1. The macro I ran was the "executeDispatch() for uno:PrintDefault" call, not 
the xprintable.print call.  That was because I simply did a record of pressing 
the print button on the tool bar.  I still find the way the API is used in 
macros very confusing and very different then calling it from my Java program.

2. I ran the macro interactively through the menus on OpenOffice, I did not 
call the macro from my Java program (don't know if that makes a difference 
yet). 

-Original Message-
From: Andrew Douglas Pitonyak [mailto:and...@pitonyak.org] 
Sent: Saturday, December 18, 2010 10:57 PM
To: dev@api.openoffice.org
Subject: Re: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through 
the API

I really do not understand this. Let me restate the part the confuses me:

(1) I can print using a macro with no problem.

(2) I cannot print using the API

When you use a macro, you use the API; or did I miss something?




On 12/18/2010 12:05 PM, Herter, Scott wrote:
> We have encountered a strange problem that involves OpenOffice 3.2.1 (also 
> reproduced with OpenOffice 2.4 but does not reproduce with OpenOffice 2.1) on 
> Windows Server 2003 R2, 2008, and 2008 R2.  The basic problem is that it does 
> not print through the API.  The interesting thing is that the same program 
> with the same version of OpenOffice works on Windows XP and Vista.
>
> If we run OpenOffice interactively on the Windows Server box and print 
> through the menus or through a Macro it works, but when we try to do it 
> through the API nothing happens.  No exception and nothing shows up in the 
> Windows print queue.  We are using a Java program to talk to OpenOffice 
> through the UNO API and we have tried both Java 5 and Java 6 with the same 
> results.
>
> Convert to PDF, load and close work through the API, just not print.  The 
> call to xprintable.print simply returns (type void so there is no return code 
> to check) as if it worked.  I changed the code to not close the document 
> after printing and I can press the print button and the document that just 
> failed to print through the API would show up in the print queue.
>
> Our current thought is that Microsoft changed something in the security model 
> and maybe we need to do something different with permissions or with the 
> print API under the newer servers.  I have done a number of Google searches 
> and checked the API doc to see if something changed with regard to printing, 
> but it looks like we are doing everything correctly and it does work on XP 
> and Vista.  If anyone knows of anything we would appreciate some help.
>
> On the assumption that no-one has heard of this before these are the steps I 
> will be taking over the next several days to try and isolate the problem 
> further.
>
>
> 1.  Create a small stand alone program that reproduces the problem with a 
> test document.
>
> 2.  Currently the servers are all running as Microsoft HyperV virtual 
> machines whereas the XP and Vista boxes were running native on the hardware.  
> After creating the test program I will run it on a server that is not a 
> virtual machine and see if it still re-creates.
>
> 3.  Since Macros seem to work I will try and find an API call that lets 
> me run a macro and pass it in parameters to fill in the properties for the 
> print.
>
> Thanks.
>
>
> --
> I used to think I wasn't a morning person, but things never got better after 
> lunch.
> -- Wally from Dilbert
>

-- 
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
Info:  http://www.pitonyak.org/oo.php


-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org




RE: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through the API

2010-12-19 Thread Herter, Scott
Yes, you did because I didn't provide the information.  Sorry about that.

1. The macro I ran was the "executeDispatch() for uno:PrintDefault" call, not 
the xprintable.print call.  That was because I simply did a record of pressing 
the print button on the tool bar.  I still find the way the API is used in 
macros very confusing and very different then calling it from my Java program.

2. I ran the macro interactively through the menus on OpenOffice, I did not 
call the macro from my Java program (don't know if that makes a difference 
yet). 

-Original Message-
From: Andrew Douglas Pitonyak [mailto:and...@pitonyak.org] 
Sent: Saturday, December 18, 2010 10:57 PM
To: dev@api.openoffice.org
Subject: Re: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through 
the API

I really do not understand this. Let me restate the part the confuses me:

(1) I can print using a macro with no problem.

(2) I cannot print using the API

When you use a macro, you use the API; or did I miss something?




On 12/18/2010 12:05 PM, Herter, Scott wrote:
> We have encountered a strange problem that involves OpenOffice 3.2.1 (also 
> reproduced with OpenOffice 2.4 but does not reproduce with OpenOffice 2.1) on 
> Windows Server 2003 R2, 2008, and 2008 R2.  The basic problem is that it does 
> not print through the API.  The interesting thing is that the same program 
> with the same version of OpenOffice works on Windows XP and Vista.
>
> If we run OpenOffice interactively on the Windows Server box and print 
> through the menus or through a Macro it works, but when we try to do it 
> through the API nothing happens.  No exception and nothing shows up in the 
> Windows print queue.  We are using a Java program to talk to OpenOffice 
> through the UNO API and we have tried both Java 5 and Java 6 with the same 
> results.
>
> Convert to PDF, load and close work through the API, just not print.  The 
> call to xprintable.print simply returns (type void so there is no return code 
> to check) as if it worked.  I changed the code to not close the document 
> after printing and I can press the print button and the document that just 
> failed to print through the API would show up in the print queue.
>
> Our current thought is that Microsoft changed something in the security model 
> and maybe we need to do something different with permissions or with the 
> print API under the newer servers.  I have done a number of Google searches 
> and checked the API doc to see if something changed with regard to printing, 
> but it looks like we are doing everything correctly and it does work on XP 
> and Vista.  If anyone knows of anything we would appreciate some help.
>
> On the assumption that no-one has heard of this before these are the steps I 
> will be taking over the next several days to try and isolate the problem 
> further.
>
>
> 1.  Create a small stand alone program that reproduces the problem with a 
> test document.
>
> 2.  Currently the servers are all running as Microsoft HyperV virtual 
> machines whereas the XP and Vista boxes were running native on the hardware.  
> After creating the test program I will run it on a server that is not a 
> virtual machine and see if it still re-creates.
>
> 3.  Since Macros seem to work I will try and find an API call that lets 
> me run a macro and pass it in parameters to fill in the properties for the 
> print.
>
> Thanks.
>
>
> --
> I used to think I wasn't a morning person, but things never got better after 
> lunch.
> -- Wally from Dilbert
>

-- 
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
Info:  http://www.pitonyak.org/oo.php


-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org




[api-dev] RE: OpenOffice 3.2.1 not printing on Windows Servers through the API

2010-12-18 Thread Herter, Scott
I have confirmed that the problem re-creates on Windows 2008 Server when it is 
running natively on the hardware.  It does not appear to be a problem with the 
Microsoft HyperV.

-Original Message-
From: Herter, Scott [mailto:scott.her...@napersoft.com] 
Sent: Saturday, December 18, 2010 11:05 AM
To: dev@api.openoffice.org
Subject: [api-dev] OpenOffice 3.2.1 not printing on Windows Servers through the 
API

We have encountered a strange problem that involves OpenOffice 3.2.1 (also 
reproduced with OpenOffice 2.4 but does not reproduce with OpenOffice 2.1) on 
Windows Server 2003 R2, 2008, and 2008 R2.  The basic problem is that it does 
not print through the API.  The interesting thing is that the same program with 
the same version of OpenOffice works on Windows XP and Vista.

If we run OpenOffice interactively on the Windows Server box and print through 
the menus or through a Macro it works, but when we try to do it through the API 
nothing happens.  No exception and nothing shows up in the Windows print queue. 
 We are using a Java program to talk to OpenOffice through the UNO API and we 
have tried both Java 5 and Java 6 with the same results.

Convert to PDF, load and close work through the API, just not print.  The call 
to xprintable.print simply returns (type void so there is no return code to 
check) as if it worked.  I changed the code to not close the document after 
printing and I can press the print button and the document that just failed to 
print through the API would show up in the print queue.

Our current thought is that Microsoft changed something in the security model 
and maybe we need to do something different with permissions or with the print 
API under the newer servers.  I have done a number of Google searches and 
checked the API doc to see if something changed with regard to printing, but it 
looks like we are doing everything correctly and it does work on XP and Vista.  
If anyone knows of anything we would appreciate some help.

On the assumption that no-one has heard of this before these are the steps I 
will be taking over the next several days to try and isolate the problem 
further.


1.  Create a small stand alone program that reproduces the problem with a 
test document.

2.  Currently the servers are all running as Microsoft HyperV virtual 
machines whereas the XP and Vista boxes were running native on the hardware.  
After creating the test program I will run it on a server that is not a virtual 
machine and see if it still re-creates.

3.  Since Macros seem to work I will try and find an API call that lets me 
run a macro and pass it in parameters to fill in the properties for the print.

Thanks.


--
I used to think I wasn't a morning person, but things never got better after 
lunch.
-- Wally from Dilbert



[api-dev] OpenOffice 3.2.1 not printing on Windows Servers through the API

2010-12-18 Thread Herter, Scott
We have encountered a strange problem that involves OpenOffice 3.2.1 (also 
reproduced with OpenOffice 2.4 but does not reproduce with OpenOffice 2.1) on 
Windows Server 2003 R2, 2008, and 2008 R2.  The basic problem is that it does 
not print through the API.  The interesting thing is that the same program with 
the same version of OpenOffice works on Windows XP and Vista.

If we run OpenOffice interactively on the Windows Server box and print through 
the menus or through a Macro it works, but when we try to do it through the API 
nothing happens.  No exception and nothing shows up in the Windows print queue. 
 We are using a Java program to talk to OpenOffice through the UNO API and we 
have tried both Java 5 and Java 6 with the same results.

Convert to PDF, load and close work through the API, just not print.  The call 
to xprintable.print simply returns (type void so there is no return code to 
check) as if it worked.  I changed the code to not close the document after 
printing and I can press the print button and the document that just failed to 
print through the API would show up in the print queue.

Our current thought is that Microsoft changed something in the security model 
and maybe we need to do something different with permissions or with the print 
API under the newer servers.  I have done a number of Google searches and 
checked the API doc to see if something changed with regard to printing, but it 
looks like we are doing everything correctly and it does work on XP and Vista.  
If anyone knows of anything we would appreciate some help.

On the assumption that no-one has heard of this before these are the steps I 
will be taking over the next several days to try and isolate the problem 
further.


1.  Create a small stand alone program that reproduces the problem with a 
test document.

2.  Currently the servers are all running as Microsoft HyperV virtual 
machines whereas the XP and Vista boxes were running native on the hardware.  
After creating the test program I will run it on a server that is not a virtual 
machine and see if it still re-creates.

3.  Since Macros seem to work I will try and find an API call that lets me 
run a macro and pass it in parameters to fill in the properties for the print.

Thanks.


--
I used to think I wasn't a morning person, but things never got better after 
lunch.
-- Wally from Dilbert



RE: [api-dev] Access violation in urp_uno when using API from C# on Windows 7

2010-11-11 Thread Herter, Scott
Another thing to look at is thread management.  We do something similar in Java 
and we started out with lots of sporadic problems which turned out to be two 
threads trying to process documents on the same instance of OpenOffice at the 
same time.  We wrote a simple resource handler similar to the way connection 
pools work for JDBC connections so that we could check out connection to 
OpenOffice, use it, then release it back to the pool.  This way only one thread 
ever accessed one instance of OpenOffice at a time.  We usually use 4 but it is 
configurable to as many as your box can handle.  We have run this with large 
numbers of threads active and processing documents at the same time on 
multi-cpu machines without problem.

Still, we did it in Java, doesn't mean there isn't an issue with the C# binding.

-Original Message-
From: so-ham02-newsgate...@sun.com [mailto:so-ham02-newsgate...@sun.com] On 
Behalf Of Stephan Bergmann
Sent: Thursday, November 11, 2010 8:25 AM
To: dev@api.openoffice.org
Cc: jtal...@spudsoft.co.uk
Subject: Re: [api-dev] Access violation in urp_uno when using API from C# on 
Windows 7

On 11/11/10 13:07, Jim Talbut wrote:
> In this instance I've got 8 soffice.bin processes running, and the test
> has run through 40+ documents 12 times before hitting the issue.
> Also if I reconfigure to run only a single soffice.bin process I don't
> hit the problem (or at least, not in a reasonable timeframe).
> As a result it looks like a race condition of some kind within the
> urp_uno worker thread.
>
> I suspect the issue relates to XBridge.getInstance function because
> whenever it occurs there is a call stack like this on one of the other
> threads:
> 0cddda30 09e738bb .cli_uno.Bridge.call_uno(cli_uno.Bridge*,
> _uno_Interface*, _typelib_TypeDescription*,
> _typelib_TypeDescriptionReference*, Int32, _typelib_MethodParameter*,
> System.Object[], System.Type[], System.Object ByRef)
> 0cdddb3c 09e72a20
> cli_uno.UnoInterfaceProxy.Invoke(System.Runtime.Remoting.Messaging.IMessage)
>
> 0cdddc8c 5c69a25e
> System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(System.Runtime.Remoting.Proxies.MessageData
> ByRef, Int32)
> 0cdddf1c 5de12356 [TPMethodFrame: 0cdddf1c]
> unoidl.com.sun.star.bridge.XBridge.getInstance(System.String)
> 0cdddf2c 09e722ad NodConverter.OpenOfficeConverter.Channel.Start(Int32)
> [C:\Users\njt\Projects\NodConverter\NodConverter.OpenOfficeConverter\Channel.cs
> @ 107]
>
> In my code soffice.bin instances are started and stopped and different
> times, so there were multiple calls to loadComponentFromURL being made
> at the same time as this crash (though on different instances of
> soffice.bin).
>
> I'd be very grateful for any help sorting this out, and of course I can
> provide more information (including a minidump if you want) as requested.

The crash is in the client, right?  The probably most typical usage 
scenario for URP is to have only a single URP connection active per 
process, so it might well be that there hides a problem in the code when 
using multiple connections simultaneously.  (XBridge.getInstance is 
called when a new URP connection is established; maybe the problem hides 
there somewhere.)

I know of some problems with the URP bridge during shutdown (like 
 and 
), so am 
currently doing a rather massive re-write of the URP code at 
. 
  Maybe that will help, once it is ready.  ;)

Apart from that, to track down your problem, it would be necessary to 
have better stack traces, including local symbols, preferably even 
debugger support enabled.  You only get this if you build OOo yourself, 
but I do not know whether that is something you feel comfortable doing?

-Stephan

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org