 | OO-Snippets: Store actual Document as *.pdfCommons| Keywords | pdf |
|---|
| Language | ooRexx |
|---|
| Application | Writer |
|---|
| Authors | Matthias Prem (initial)
|
|---|
| Supported Versions | 2.0.x |
|---|
| Supported OS | All |
|---|
| Question | How can I store the actual document as *.pdf?
The document has been saved before under *.odt for example.
|
|---|
| Answer | |
|---|
xScriptContext=uno.getScriptContext()
oDoc=xScriptContext~getDocument
oContext=xScriptContext~getComponentContext
xStorable = oDoc~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
url=oDoc~getURL()
if (url<>"") then do
parse var url url "." .
url= url || ".pdf"
xStorable~storeToUrl(url, storeprops)
end
else do
.bsf.dialog~messagebox("File has to be saved first.")
end
::requires UNO.CLS
|
Changelog| Date | User | Modification |
|---|
| 2006-07-10 | matthiasprem | Initial version |
|