Hallo
ich habe nicht viel Ahnung von Macros aber ich müsste .odt´s files zu pdf convertieren.Macro wäre genau das richtige ich habe hiermit versucht.
CODE:
sub test
rem define variables
dim document as object
dim dispatcher as object
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args1(3) as new com.sun.star.beans.PropertyValue
args1(0).Name = "URL"
args1(0).Value = "/home/igor/Desktop/Namenloser Ordner"
args1(1).Name = "FilterName"
args1(1).Value = "calc_pdf_Export"
args1(2).Name = "FilterData"
args1(2).Value = Array(Array("UseLosslessCompression",0,true,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,1,com.sun.star.beans.PropertyState.DIRECT_VALUE),_
Array("Selection",0,,com.sun.star.beans.PropertyState.DIRECT_VALUE))
args1(3).Name = "SelectionOnly"
args1(3).Value = true
dispatcher.executeDispatch(document, ".uno:ExportToPDF", "", 1, args1())
end sub
aber da Kommt EIn/ausgabe Fehler.
.odt to .pdf
Moderator: Moderatoren
Re: .odt to .pdf
Schau mal hier das sollte eigentlich gehen:
Evtl. könnte das Problem auch sein, dass du als FilterName calc_pdf_Export hast. Ich hätte bei odt eher an writer_pdf_Export gedacht.
Gruß
Eminent
Code: Alles auswählen
sub test
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "URL"
args1(0).Value = "file:///D:/test.pdf"
args1(1).Name = "FilterName"
args1(1).Value = "writer_pdf_Export"
dispatcher.executeDispatch(document, ".uno:ExportDirectToPDF", "", 0, args1())
end sub
Gruß
Eminent