Have you ever wanted to have a way to see the full content of a spreadsheet document in a pdf form, without the usual slicing of the sheets into printable pages?

Why would I need that?

Here is the screenshot of a sheet containing some data and graphics: Sample Sheet And this is how it looks like when exported to pdf in the old/usual way: Usual PDF Output

Also read the blog on the Collabora-website for more explanation.

How do I use it?

  • Open your spreadsheet document in LibreOffice Calc
  • From the menu, select File - Export as PDF…
  • On the General tab of the PDF Options dialog, check the option named Full-Sheet Previews
  • Click the Export button, and choose a location for your preview pdf
  • Enjoy your pdf file of full sheet previews

Full-Sheet Preview PDF

Option on the dialog

Full-Sheet Previews option on the PDF Export Dialog

Also available in the LibreOffice/Collabora Online api

If you happen to use the LibreOffice/Collabora Online REST api for document conversions, here is a command to get a preview output of your sheet:

curl --insecure -F "data=@YourSpreadSheetDocument.ods" -F "FullSheetPreview=true" https://localhost:9980/lool/convert-to/pdf > out.pdf

More info about the REST api

Where and when?

The feature was developed on the cp-6.2 branch of LibreOffice code-base (which is basicly Collabora Office 6.2), and is already available in Collabora Office snaphots. And is being backported to LibreOffice master, so it will be also available in LibreOffice development builds and soon in the Collabora Office snapshots.

For more info and the snapshot

Tips

  • Currently, this option disregards most of the other options on the pdf export dialog
  • Preview pages will have different sizes (same as the source sheets)
  • This is not meant for printing
  • The export dialog remembers your last choice, so better not forget to uncheck this option next time you would like to get a regular (for-printing) output

Dev Notes

  • The PDF export dialog’s UI description is in filter/uiconfig/ui/pdfgeneralpage.ui
  • The class for the dialog is named ImpPDFTabGeneralPage
  • To introduce a new option, you need to add the widget to the .ui file, then add a proper item to the class, and connect the two in the constructor
    • In our case, the id of the new checkbox on the ui file is singlepagesheets
      <object class="GtkCheckButton" id="singlepagesheets">
                  <property name="label" translatable="yes" context="pdfgeneralpage|singlepagesheets">Full-Sheet Previews</property>
                  <property name="visible">True</property>
                  <property name="can_focus">True</property>
                  <property name="receives_default">False</property>
                  <property name="use_underline">True</property>
                  <property name="xalign">0</property>
                  <property name="draw_indicator">True</property>
          </object>
      
    • And the corresponding member in the ImpPDFTabGeneralPage class is named as mxCbSinglePageSheets
      std::unique_ptr<weld::CheckButton> mxCbSinglePageSheets;
      
    • We connect the two via this line in the constructor of the class:
      mxCbSinglePageSheets(m_xBuilder->weld_check_button("singlepagesheets"))
      

And here is a list of related commits if you would like to see what other changes were done:

  1. Add ‘SinglePageSheets’ option to the PDF export dialog
  2. Handle SinglePageSheets option for pdf export
  3. Add FullSheetPreview support for convert-to endpoint of online
  4. Rename ‘Single-page sheets’ to ‘Full-Sheet Previews’ to avoid confusion