Translate

How to Publish Google Sheets Directly as PDF or Excel Files


How to Publish Google Sheets Directly as PDF or Excel Files

Google Sheets is a powerful online spreadsheet tool that makes collaboration, real-time updates, and cloud storage incredibly easy. Whether you’re a student managing data, a business owner preparing reports, or a teacher sharing results, there comes a time when you need to export or publish your spreadsheet in formats like PDF or Excel (XLSX).

In this blog, we’ll walk you through step-by-step instructions for publishing and exporting Google Sheets directly as PDF or Excel files, including tips to automate, share via links, and ensure the formatting stays professional.


Why Export Google Sheets to PDF or Excel?

Before diving into the methods, let’s understand why people often convert or publish Google Sheets as PDF or Excel:

  • To share non-editable reports or invoices (PDF format)

  • To work offline or open in Microsoft Excel (XLSX format)

  • To send formatted versions of a spreadsheet to clients, vendors, or colleagues

  • To archive versions of dynamic or changing data

  • To print documents with consistent layout and page breaks


Method 1: Manually Export as PDF or Excel from Google Sheets

This is the most common method for one-time exports.

Step-by-Step: Export Google Sheet as PDF

  1. Open the Google Sheet you want to export.

  2. Click on File > Download > PDF Document (.pdf).

  3. A settings menu will appear where you can:

    • Select the current sheet, entire workbook, or selected cells

    • Set page orientation (portrait or landscape)

    • Adjust scaling and margins

    • Enable/disable gridlines, notes, and headers

  4. After adjusting settings, click on Export or Download.

  5. The file will be saved to your computer in PDF format.

Step-by-Step: Export Google Sheet as Excel

  1. Go to File > Download > Microsoft Excel (.xlsx).

  2. The file will instantly download in Excel format, preserving the structure, formulas, and formatting as much as possible.


Method 2: Share Google Sheets as PDF Using Custom URLs

Sometimes, you may want to generate a PDF link that others can open or download directly. Google Sheets allows you to customize the URL of your document for this purpose.

Step-by-Step: Create a PDF Link from Google Sheets

  1. Open your Google Sheet.

  2. Click Share and make sure the sheet is accessible:

    • Set link sharing to “Anyone with the link” or “Anyone in your organization.”

  3. Copy the URL, which looks like:

    https://docs.google.com/spreadsheets/d/FILE_ID/edit#gid=SHEET_ID
    
  4. Modify the URL:

    • Replace everything after /edit with:

      /export?format=pdf&exportFormat=pdf
      
    • Example:

      https://docs.google.com/spreadsheets/d/1A2B3C4D5E6F7G8H9I/export?format=pdf
      

Optional Parameters You Can Add:

  • &gid=0 – Selects a specific sheet

  • &range=A1:C20 – Exports only selected range

  • &portrait=true or false – Page orientation

  • &scale=4 – Adjusts scaling (1–4)

  • &fitw=true – Fit to page width

  • &top_margin=0.50 – Set margins (in inches)

  • &gridlines=false – Hide gridlines

  • &printtitle=false – Hide column headers

When someone clicks this customized URL, it will auto-download or open the sheet as a PDF.


Method 3: Use Google Apps Script to Automatically Export as PDF or Excel

If you regularly need to export a sheet as PDF or Excel, you can use Google Apps Script to automate the process.

Step-by-Step: Create Script to Export as PDF

  1. Open your Google Sheet.

  2. Go to Extensions > Apps Script.

  3. Paste the following code to generate a PDF and save it to your Google Drive:

function exportSheetAsPDF() {
  var sheet = SpreadsheetApp.getActiveSpreadsheet();
  var sheetId = sheet.getId();
  var url = "https://docs.google.com/spreadsheets/d/" + sheetId + "/export?format=pdf&portrait=true&scale=4";

  var token = ScriptApp.getOAuthToken();
  var response = UrlFetchApp.fetch(url, {
    headers: {
      "Authorization": "Bearer " + token
    }
  });

  var blob = response.getBlob().setName(sheet.getName() + ".pdf");
  DriveApp.createFile(blob);
}
  1. Save the script and click the Run button.

  2. Grant necessary permissions.

  3. A PDF version of your sheet will be saved to your Google Drive.

Modify for Excel Format

Change the URL in the script to:

var url = "https://docs.google.com/spreadsheets/d/" + sheetId + "/export?format=xlsx";

This will export and save the file as an Excel document instead of PDF.


Method 4: Automate Scheduled Exports with Triggers

Want to schedule the export daily, weekly, or monthly?

  1. Open the Script Editor where you added the export function.

  2. Click on the clock icon (Triggers).

  3. Add a new trigger:

    • Choose the export function (e.g., exportSheetAsPDF)

    • Set the event source to “Time-driven”

    • Choose the frequency (e.g., “Every day at 8:00 AM”)

  4. Click Save.

Now your Google Sheet will be automatically exported on a schedule.


Method 5: Use Google Workspace Add-ons or Tools

If you're not comfortable with coding, there are Google Sheets add-ons that can help automate exports:

  • Autocrat: Great for merging sheet data into custom PDFs

  • Document Studio: Lets you automate workflows with export and email

  • Sheetgo: Useful for linking sheets and exporting formats

These tools offer user-friendly interfaces and powerful export options with minimal setup.


Common Issues and Fixes

Exported PDF Has Cut-Off Columns

  • Adjust the scaling settings in the PDF export menu.

  • Use landscape orientation.

  • Reduce column width manually.

Excel File Loses Formatting

  • Some Google Sheets-specific formatting (like custom date formats) might not transfer perfectly.

  • Use standard fonts and formats for better compatibility.

Downloaded File Is Empty

  • Make sure your Sheet has data in the visible cells.

  • Don’t export hidden sheets or ranges.


Best Practices

  • Always keep a clean, final version of your sheet before exporting.

  • Use separate “print-friendly” tabs with simplified content for PDFs.

  • Name your sheet files clearly for recipients to recognize the content easily.

  • Share links with restricted access when exporting sensitive data.


Conclusion

Whether you want to create professional reports in PDF or collaborate offline with Excel, Google Sheets makes it easy to export or publish your data. You can export manually, share direct download links, or even automate the process with Google Apps Script.

With the right tools and techniques, you can streamline your workflow and deliver polished, well-formatted documents from your Google Sheets in just a few clicks.

Master these methods, and you’ll never have to manually reformat, convert, or resend your spreadsheets again.