Skip to content

Instantly share code, notes, and snippets.

@arcusfelis
Created May 25, 2013 10:44
Show Gist options
  • Select an option

  • Save arcusfelis/5648666 to your computer and use it in GitHub Desktop.

Select an option

Save arcusfelis/5648666 to your computer and use it in GitHub Desktop.
Libreoffice Calc: print ranges for all pages
REM ***** BASIC *****
' Fit print range on page
sub AutoScaleSheet
view = thiscomponent.getCurrentController()
fam =thiscomponent.stylefamilies.getbyname("PageStyles")
sh = view.getActivesheet()
style = fam.getbyname(sh.PageStyle)
style.ScaleToPagesX = 1
style.ScaleToPagesY = 1
end sub
sub AutoScale
oDoc = ThisComponent
oSheets = oDoc.Sheets
Controller = oDoc.getcurrentController
For i=0 to oSheets.Count - 1
Controller.setActiveSheet(oSheets.getByIndex(i))
AutoScaleSheet
next i
end sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment