日期:2014-05-17  浏览次数:20795 次

openiffice转换附件格式为pdf,怎么加入jegp压缩的质量选择
利用openiffice转换附件格式为pdf
Sub ConvertWordToPDF( cSourceFile , cDestinationFile)
   cURL = ConvertToURL( cSourceFile )
   ' Open the document.
   ' Just blindly assume that the document
   ' is of a type that OOo will
   '  correctly recognize and open -- 
   '   without specifying an import filter.

   oDoc = StarDesktop.loadComponentFromURL( cURL, "_blank", 0, _
          Array(MakePropertyValue( "Hidden", True ), ) )


   cURL = ConvertToURL( cDestinationFile )
   
   ' Save the document using a filter.   
   oDoc.storeToURL( cURL, _
     Array(MakePropertyValue( "FilterName", "writer_pdf_Export"),)
   
   oDoc.close( True )
End Sub


Function MakePropertyValue( Optional cName As String, _
         Optional uValue ) As com.sun.star.beans.PropertyValue
   Dim oPropertyValue As New com.sun.star.beans.PropertyValue
   If Not IsMissing( cName ) Then
      oPropertyValue.Name = cName
   EndIf
   If Not IsMissing( uValue ) Then
      oPropertyValue.Value = uValue
   EndIf
   MakePropertyValue() = oPropertyValue
End Function 

加入有个jegp压缩可以进行质量选择,求大神帮我完善一下
C# winform openoffice

------解决方案--------------------
引用:
Quote: 引用:

你好,你先看看这个网页,对你有帮助
https://wiki.openoffice.org/wiki/API/Tutorials/PDF_export#How_to_use_it_from_OOo_Basic
下面是我自己的理解,希望对你有帮助  
dim param(2) as new  com.sun.star.beans.PropertyValue
   param(0) =  MakePropertyValue( "FilterName", "writer_pdf_Export")
   param(1) =  MakePropertyValue( "FilterData",MakePropertyValue("Quality",100) )
   oDoc.storeTo