Quantcast
Channel: Apache OpenOffice Community Forum
Viewing all articles
Browse latest Browse all 1281

Macros and UNO API • Re: Print a specific sheet of Calc as a PDF file, using a macro

$
0
0
The "Print" method can use a virtual PDF printer (if it is exist).
Ther "Export" method uses the built-in export feature

You you can use the "Export the Selection" option. Of course you must SELECT the cell range to export (by the macro) before you use that option.

Code:

Arg(0).Name = "Selection"Arg(0).Value = oRangeargs2(0).Name = "FilterName"args2(0).Value = "calc_pdf_Export"args2(1).Name = "FilterData"args2(1).Value = Arg()ThisComponent.storeToURL(Pdf_Local_URL, args2())
Where the oRange is a cell range object (you must get an Select it by your macro), and the Pdf_Local_URL is the place where you want to save the pdf file to.

Statistics: Posted by Zizi64 — Mon Jul 08, 2024 8:20 am



Viewing all articles
Browse latest Browse all 1281

Trending Articles