To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=111690





------- Additional comments from bar...@openoffice.org Wed May 19 06:43:18 
+0000 2010 -------
I used the code in the same manner as shown below:

-----------------------------------------------------------------------------
Sub SaveAsPDF_demo()

Dim oSM, oDesk, oDoc As Object 'OOo objects
Dim OpenParam(1) As Object 'Parameters to open the doc
Dim SaveParam(1) As Object 'Parameters to save the doc

Set oSM = CreateObject("com.sun.star.ServiceManager")
Set oDesk = oSM.createInstance("com.sun.star.frame.Desktop")

Set OpenParam(0) = MakePropertyValue("Hidden", True) ' Open the file hidden
Set oDoc = oDesk.loadComponentFromURL("file:///C:/tmp/testdoc.odt", "_blank", 0,
OpenParam())

Set SaveParam(0) = MakePropertyValue("FilterName", "writer_pdf_Export")
Call oDoc.storeToURL("file:///C:/tmp/testdoc.pdf", SaveParam())

Set oDesk = Nothing
Set oSM = Nothing
End Sub

Public Function MakePropertyValue(cName, uValue) As Object
Dim oStruct, oServiceManager as Object
Set oServiceManager = CreateObject("com.sun.star.ServiceManager")
Set oStruct = 
oServiceManager.Bridge_GetStruct("com.sun.star.beans.PropertyValue")
oStruct.Name = cName
oStruct.Value = uValue
Set MakePropertyValue = oStruct
End Function 
-----------------------------------------------------------------------------

The function SaveAsPDF_demo() I called several times like

While documents ar in a folder
  SaveAsPDF_demo()
loop

Therefore I used the code it in a serialized manner but I suppose that
OpenOffice makes multiple threads because I get the PDFs not file per file but
packages with three to four files every 10 to 15 seconds.

What I shall do next:
- open Open Office once and keep it open for the whole session
- go thrue all the files and convert them without closing Open Office
- close Open Office at the end of the application





---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

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


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

Reply via email to