(credit to source -- https://stackoverflow.com/questions/305 ... o-pdf-file)
Edit: The link above produces a Page Not Found error -- MrProgrammer, forum moderator |
sub storeCellRangeToPDF()
oDoc = ThisComponent
oController = oDoc.getCurrentController()
oSheet = oController.getActiveSheet()
oCellRange = oSheet.getCellRangeByName("$A$1:$B$3")
dim aFilterData(0) as new com.sun.star.beans.PropertyValue
aFilterData(0).Name = "Selection"
aFilterData(0).Value = oCellRange
dim aMediaDescriptor(1) as new com.sun.star.beans.PropertyValue
aMediaDescriptor(0).Name = "FilterName"
aMediaDescriptor(0).Value = "calc_pdf_Export"
aMediaDescriptor(1).Name = "FilterData"
aMediaDescriptor(1).Value = aFilterData()
oDoc.storeToURL("file:///home/axel/Dokumente/test.pdf", aMediaDescriptor())
end sub
Can the last line be altered to name the file by cell value(s)?
I.E. ---> oDoc.storeToURL("A1") .... or even better --> oDoc.storeToURL("A1&A2&A3")
...and since im here, and If y'all feel ambitious - can the named PDF file be added to a KWrite email with its values derived from the sheets cell values?
To Email, From Email, Subjuct, Body, Signature - (B10, C10, D10, E10, F10)
thanx
P.S., Im running Libre 7.5.6.2 with a fresh install of Debian 12,onto a new hdd. Your server however doesn't believe me.