pdf Matthias Prem How can I store the actual document as *.pdf?

The document has been saved before under *.odt for example.

/* StoreActualAsPDF.rex */ /* Macro */ /* How to store an opened file as *.pdf */ /* get the script context */ xScriptContext=uno.getScriptContext() /* get the document and the component context */ oDoc=xScriptContext~getDocument oContext=xScriptContext~getComponentContext /* defining the storing properties */ xStorable = oDoc~{%see com.sun.star.frame.XStorable%XStorable} storeprops = bsf.createArray(.UNO~propertyValue, 2) storeprops[1] = .UNO~PropertyValue~new storeprops[1]~Name = "FilterName" storeprops[1]~Value = "writer_pdf_Export" storeprops[2] = .UNO~PropertyValue~new storeprops[2]~Name = "CompressMode" storeprops[2]~Value = 2 /* retrieve url from document */ url=oDoc~getURL() /* if document has been saved to an url */ if (url<>"") then do parse var url url "." . url= url || ".pdf" xStorable~storeToUrl(url, storeprops) end /* if document has not been saved */ else do .bsf.dialog~messagebox("File has to be saved first.") end ::requires UNO.CLS Initial version