sub Export2PDF
rem ----------------------------------------------------------------------
rem Объява переменных
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem Организация доступа к документу
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper"
rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
rem Выделение области.
args1(0).
Name = "ToPoint"
args1(0).Value = "$A$1:$C$1"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
rem ----------------------------------------------------------------------
dim args2(3) as new com.sun.star.beans.PropertyValue
rem Собссно экспорт в ПДФ.
args2(0).
Name = "URL"
args2(0).Value = "file:///home/UU/123.pdf"
args2(1).
Name = "FilterName"
args2(1).Value = "calc_pdf_Export"
args2(2).
Name = "FilterData"
rem Эту строку склей в одну. Оставил для наглядности.
args2(2).Value = Array(Array("UseLosslessCompression",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("Quality",0,90,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("ReduceImageResolution",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("MaxImageResolution",0,300,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("UseTaggedPDF",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("ExportNotes",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("UseTransitionEffects",0,true,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("IsSkipEmptyPages",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("FormsType",0,0,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("HideViewerToolbar",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("HideViewerMenubar",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("HideViewerWindowControls",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("ResizeWindowToInitialPage",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("CenterWindow",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("OpenInFullScreenMode",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("
isplayPDFDocumentTitle",0,true,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("InitialView",0,0,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("Magnification",0,0,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("PageLayout",0,0,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("FirstPageOnLeft",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("Printing",0,2,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("Changes",0,4,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("EnableCopyingOfContent",0,true,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("EnableTextAccessForAccessibilityTools",0,true,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("EncryptFile",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("
ocumentOpenPassword",0,"",com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("RestrictPermissions",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("PermissionPassword",0,"",com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("Selection",0,,com.sun.star.beans.PropertyState.DIRECT_VALUE))
args2(3).
Name = "SelectionOnly"
args2(3).Value = true
dispatcher.executeDispatch(document, ".uno:ExportToPDF", "", 0, args2())
end sub