Gists
This is a sample script for moving the selected cell to the top left on Google Spreadsheet to focus it using Google Apps Script.
One day, there might be a case where you are required to focus the specific cell on Google Spreadsheet to help edit cells. In this post, I would like to introduce a sample script for achieving this.
Sample script Please copy and paste the following script to the script editor of Google Spreadsheet, and save the script.
Gists At the Google Apps Script project, the values can be transferred from HTML to Google Apps Script using google.script.run with Javascript. In this case, unfortunately, the values of all types cannot be transferred. In the official document, it says as follows. Ref Most types are legal, but not Date, Function, or DOM element besides form; see description Legal parameters are JavaScript primitives like a Number, Boolean, String, or null,
PDFApp was updated to v1.0.2. v1.0.2 (August 21, 2023)
A new method of insertHeaderFooter was added. Ref When this method is used, the custom header and footer can be added when a Google Spreadsheet is exported as PDF. You can see the detail information here https://github.com/tanaikech/PDFApp
Gists
This is a sample script for adding header and footer to PDF using Google Apps Script.
In the current stage, when Google Spreadsheet is manually exported as a PDF file at “Print settings” on the UI of Spreadsheet, the custom header and footer can be added as shown in the following image.
But, unfortunately, in the current stage, this cannot be directly achieved by Google Apps Script. So, I created this sample script.
PDFApp was updated to v1.0.1. v1.0.1 (August 18, 2023)
About the method of “getMetadata”, pageInfo is added to the retrieved metadata. By this, each page size can be obtained. You can see the detail information here https://github.com/tanaikech/PDFApp