OO-Snippets: export as PDF

Commons

Keywordspdf, store, safe, export
LanguageOOBasic
ApplicationWriter
AuthorsStephan Wunderlich
Tom Schindl
Supported Versions
Supported OS
Question How do I store a writer document as PDF
Answer

Use storeToURL with the right filtername

Code-Snippet-Listing (snippet-source)

sUrl="file:///myhome/documents/source.sxw"
oDocument=oDesktop.loadComponentFromURL(sUrl,"_blank",0,DimArray())

Dim args(0) as new com.sun.star.beans.PropertyValue
args(0).Name = "FilterName"
args(0).Value = "writer_pdf_Export"
destination = "file:///myhome/documents/test.pdf"
odocument.storeToURL(destination,args())

oDocument.close(true)

Changelog

DateUserModification
2004-06-22tomsontomModified to match new snippet-DTD
0000-00-00steInitial version

and