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

classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

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

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

Reply | Threaded
Open this post in threaded view
|

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

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:[hidden email]]
Sent: Saturday, December 18, 2010 11:05 AM
To: [hidden email]
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

Reply | Threaded
Open this post in threaded view
|

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

Andrew Pitonyak
In reply to this post by Herter, Scott
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

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:[hidden email]]
Sent: Saturday, December 18, 2010 10:57 PM
To: [hidden email]
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: [hidden email]
For additional commands, e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|

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

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:[hidden email]]
Sent: Sunday, December 19, 2010 8:53 AM
To: [hidden email]; [hidden email]
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:[hidden email]]
Sent: Saturday, December 18, 2010 10:57 PM
To: [hidden email]
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: [hidden email]
For additional commands, e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|

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

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:[hidden email]]
Sent: Sunday, December 19, 2010 9:44 AM
To: [hidden email]
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:[hidden email]]
Sent: Sunday, December 19, 2010 8:53 AM
To: [hidden email]; [hidden email]
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:[hidden email]]
Sent: Saturday, December 18, 2010 10:57 PM
To: [hidden email]
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: [hidden email]
For additional commands, e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|

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

Fernand Vanrie
  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:[hidden email]]
> Sent: Sunday, December 19, 2010 9:44 AM
> To: [hidden email]
> 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:[hidden email]]
> Sent: Sunday, December 19, 2010 8:53 AM
> To: [hidden email]; [hidden email]
> 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:[hidden email]]
> Sent: Saturday, December 18, 2010 10:57 PM
> To: [hidden email]
> 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
>>


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

Reply | Threaded
Open this post in threaded view
|

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

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:[hidden email]]
Sent: Monday, December 20, 2010 2:36 AM
To: [hidden email]
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:[hidden email]]
> Sent: Sunday, December 19, 2010 9:44 AM
> To: [hidden email]
> 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:[hidden email]]
> Sent: Sunday, December 19, 2010 8:53 AM
> To: [hidden email]; [hidden email]
> 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:[hidden email]]
> Sent: Saturday, December 18, 2010 10:57 PM
> To: [hidden email]
> 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
>>


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


Reply | Threaded
Open this post in threaded view
|

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

Cor Nouws
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

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:[hidden email]]
Sent: Monday, December 20, 2010 7:56 AM
To: [hidden email]
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: [hidden email]
For additional commands, e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|

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

Jürgen Schmidt
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:[hidden email]]
> Sent: Monday, December 20, 2010 7:56 AM
> To: [hidden email]
> 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

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:[hidden email]]
Sent: Monday, December 20, 2010 9:39 AM
To: [hidden email]
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:[hidden email]]
> Sent: Monday, December 20, 2010 7:56 AM
> To: [hidden email]
> 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: [hidden email]
For additional commands, e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|

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

Jürgen Schmidt
as i mentioned before, i have tried the SDK example
<sdk>/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:[hidden email]]
> Sent: Monday, December 20, 2010 9:39 AM
> To: [hidden email]
> 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:[hidden email]]
>> Sent: Monday, December 20, 2010 7:56 AM
>> To: [hidden email]
>> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

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:[hidden email]]
Sent: Monday, December 20, 2010 10:00 AM
To: [hidden email]
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
<sdk>/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:[hidden email]]
> Sent: Monday, December 20, 2010 9:39 AM
> To: [hidden email]
> 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:[hidden email]]
>> Sent: Monday, December 20, 2010 7:56 AM
>> To: [hidden email]
>> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
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: [hidden email]
For additional commands, e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|

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

Jürgen Schmidt
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:[hidden email]]
> Sent: Monday, December 20, 2010 10:00 AM
> To: [hidden email]
> 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
> <sdk>/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:[hidden email]]
>> Sent: Monday, December 20, 2010 9:39 AM
>> To: [hidden email]
>> 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:[hidden email]]
>>> Sent: Monday, December 20, 2010 7:56 AM
>>> To: [hidden email]
>>> 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: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>


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

Reply | Threaded
Open this post in threaded view
|

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

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:[hidden email]]
Sent: Monday, December 20, 2010 10:18 AM
To: [hidden email]
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:[hidden email]]
> Sent: Monday, December 20, 2010 10:00 AM
> To: [hidden email]
> 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
> <sdk>/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:[hidden email]]
>> Sent: Monday, December 20, 2010 9:39 AM
>> To: [hidden email]
>> 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:[hidden email]]
>>> Sent: Monday, December 20, 2010 7:56 AM
>>> To: [hidden email]
>>> 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: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>


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


Reply | Threaded
Open this post in threaded view
|

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

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:[hidden email]]
Sent: Monday, December 20, 2010 11:02 AM
To: [hidden email]
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:[hidden email]]
Sent: Monday, December 20, 2010 10:18 AM
To: [hidden email]
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:[hidden email]]
> Sent: Monday, December 20, 2010 10:00 AM
> To: [hidden email]
> 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
> <sdk>/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:[hidden email]]
>> Sent: Monday, December 20, 2010 9:39 AM
>> To: [hidden email]
>> 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:[hidden email]]
>>> Sent: Monday, December 20, 2010 7:56 AM
>>> To: [hidden email]
>>> 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: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>


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


Reply | Threaded
Open this post in threaded view
|

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

Mikhail Voytenko-2
In reply to this post by Herter, Scott
Hi Herter,

if it works well in Basic and does not work in Java application, it
looks more like a threading problem. The basic scripts are executed in
the main thread ( as well as the actions triggered from UI ). But in
case a java application uses API through a bridge, an additional thread
is created. I assume that this thread is actually the problem.

A workaround would be to trigger the callback from the office main
thread, so that you call API that is executed in the main thread as
well. It could be done by using "com.sun.star.awt.AsyncCallback" service.

When the XRequestCallback::addCallback() is called it sends a
notification with arguments to the main office thread and returns. After
a while the main thread calls your implementation of XCallback::notify()
method, and if this method does a call to the office back, the call is
handled in the office main thread.

Hope that helps.

Best regards,
Mikhail.

On 12/20/10 14:17, Herter, Scott wrote:
> 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 generat
 ed 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:[hidden email]]
> Sent: Monday, December 20, 2010 2:36 AM
> To: [hidden email]
> 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:[hidden email]]
>> Sent: Sunday, December 19, 2010 9:44 AM
>> To: [hidden email]
>> 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 t
 o find it).

>>
>> -----Original Message-----
>> From: Herter, Scott [mailto:[hidden email]]
>> Sent: Sunday, December 19, 2010 8:53 AM
>> To: [hidden email]; [hidden email]
>> 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:[hidden email]]
>> Sent: Saturday, December 18, 2010 10:57 PM
>> To: [hidden email]
>> 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
>>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>

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

Reply | Threaded
Open this post in threaded view
|

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

Herter, Scott
In reply to this post by 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:[hidden email]]
Sent: Friday, December 31, 2010 7:10 AM
To: [hidden email]
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:[hidden email]]
Sent: Monday, December 20, 2010 11:02 AM
To: [hidden email]
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:[hidden email]]
Sent: Monday, December 20, 2010 10:18 AM
To: [hidden email]
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:[hidden email]]
> Sent: Monday, December 20, 2010 10:00 AM
> To: [hidden email]
> 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
> <sdk>/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:[hidden email]]
>> Sent: Monday, December 20, 2010 9:39 AM
>> To: [hidden email]
>> 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:[hidden email]]
>>> Sent: Monday, December 20, 2010 7:56 AM
>>> To: [hidden email]
>>> 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: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>


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


Reply | Threaded
Open this post in threaded view
|

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

Oliver Brinzing
Hi,

> I finally figured out what the problem was.  
> It turned out that we would often send a copy count of 0 as a default

i remember we had similar problems when upgrading from oo 1.1.5,
our print dialog refused to print copy count's in some cases ...

and here some other printing issues:

http://www.openoffice.org/issues/show_bug.cgi?id=114817
missing com.sun.star.view.XPrintJobListener JOB_STARTED/JOB_COMPLETED events

http://www.openoffice.org/issues/show_bug.cgi?id=113479
On particular printers only 1 copy printed although No of copies > 1 and not collated

http://www.openoffice.org/issues/show_bug.cgi?id=116009
Missing PrintSingleJobs in "Tools - Options - OpenOffice.org Writer - Print" Dialog

Regards

Oliver
--

GnuPG key 0xCFD04A45: 8822 057F 4956 46D3 352C 1A06 4E2C AB40 CFD0 4A45


signature.asc (268 bytes) Download Attachment