Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

129
Views
Script to email a PDF file and fit to single pages

I am running the following code:

    var activeSheet =   SpreadsheetApp.getActiveSpreadsheet().getSheetByName('FlowModelling');
    var umail = activeSheet.getRange('H1').getValue();
  Logger.log(SpreadsheetApp.getActiveSheet().getRange('H1').getValue())

   
    var message = {
      to: umail,
      subject: "Flow Modelling & Pump Selection",
      body: "Hi,\n\nPlease find the Flow Modelling & Pump Selection     attached.\n\nThank you,\nAdmin at Watpump",
      name: "Watpump",
      attachments: [SpreadsheetApp.getActiveSpreadsheet().getAs(MimeType.PDF,).setName("Fluid Dynamics & Pump Selection")]
  }
     MailApp.sendEmail(message);
}

Everything works fine except the PDF pages don't scale to fit. In my document they are scaled to fit and do so if I do a manual PDF save. I have seen script for formatting Pdf's but do not know where to write the script (the + 'scale=4' seems appropriate??

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!