DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
FREEDOM251

Freedom251 › Blog › Google Apps Script

How to Use PDFCrowd from Google Sheets to Convert a Column of URLs to PDFs

By Freedom251 Team · · 7 min read

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a Google Sheets-bound Apps Script to read a column of web addresses, send each eligible URL to PDFCrowd’s HTML-to-PDF API, save successful PDF responses in Google Drive, and write a file link and status back to the matching row. The key safeguards are to validate each URL, check the HTTP response before saving, and make the batch resumable.

Set up the spreadsheet

Use one row per source page and keep the input, output, and status columns distinct. For example:

As an Amazon Associate I earn from qualifying purchases.

A: Source URL B: PDF link C: Status
https://example.com/page

Put headers in row 1. The script below reads URLs from column A, writes the Drive link to column B, and records the outcome in column C. It skips blank URLs and rows already marked SUCCESS, so a later run can continue without recreating completed files.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prepare Apps Script and credentials

  1. Open the spreadsheet and choose Extensions → Apps Script to create or open its bound script project.
  2. In Apps Script project settings, add the explicit external request scope https://www.googleapis.com/auth/script.external_request if the project uses explicitly declared OAuth scopes. Google’s UrlFetchApp documentation describes the service and its authorization requirements.
  3. Set the PDFCrowd account username and API key as script properties rather than putting them in spreadsheet cells or the URL list. In Apps Script, open Project Settings → Script Properties and add PDFCROWD_USERNAME and PDFCROWD_API_KEY.
  4. Create a destination folder in Drive, then copy its folder ID from the folder URL. Add a PDF_FOLDER_ID script property. Leave this property empty to save files in the Drive root.
  5. Restrict who can edit the script and its configuration. Anyone with the ability to change the script may be able to access credentials stored with it.

The PDFCrowd API key authenticates your API request; it does not log in to the source website. PDFCrowd’s servers must be able to reach each page. A page that is private, requires a website login, or exists only on a local machine may not be fetchable without a separately supported access arrangement. See PDFCrowd’s HTTP API documentation and parameter reference.

#1 Best Overall
PDF Converter Ultimate - Convert PDF files into Word, Excel, PowerPoint and others - PDF converter software with OCR recognition compatible with Windows 11 / 10 / 8.1 / 8 / 7
  • Convert your PDF files into Word, Excel & Co. the easy way
  • Convert scanned documents thanks to our new 2022 OCR technology
  • Adjustable conversion settings
  • No subscription! Lifetime license!
  • Compatible with Windows 11, 10, 8.1, 7 - Internet connection required

Add the URL-to-PDF script

In the Apps Script editor, replace the starter code with the following. It uses PDFCrowd’s documented versioned endpoint, submits the source address as a form field using HTTP Basic authentication, and treats successful content as binary PDF data.

const CONFIG = {
  sheetName: 'Sheet1',       // Change to the tab containing your URLs
  firstDataRow: 2,           // Row 1 contains headers
  urlColumn: 1,              // A: source URL
  fileColumn: 2,             // B: Drive file URL
  statusColumn: 3,           // C: status or error
  batchSize: 10,             // Conservative starting batch; adjust to current quotas
  endpoint: 'https://api.pdfcrowd.com/convert/24.04/'
};

function convertNextBatch() {
  const props = PropertiesService.getScriptProperties();
  const username = props.getProperty('PDFCROWD_USERNAME');
  const apiKey = props.getProperty('PDFCROWD_API_KEY');
  const folderId = props.getProperty('PDF_FOLDER_ID');

  if (!username || !apiKey) {
    throw new Error('Set PDFCROWD_USERNAME and PDFCROWD_API_KEY in Script Properties.');
  }

  const spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  const sheet = spreadsheet.getSheetByName(CONFIG.sheetName);
  if (!sheet) throw new Error('Sheet tab not found: ' + CONFIG.sheetName);

  const lastRow = sheet.getLastRow();
  if (lastRow < CONFIG.firstDataRow) return;

  const count = lastRow - CONFIG.firstDataRow + 1;
  const rows = sheet.getRange(CONFIG.firstDataRow, 1, count,
    Math.max(CONFIG.urlColumn, CONFIG.fileColumn, CONFIG.statusColumn)).getValues();
  const folder = folderId ? DriveApp.getFolderById(folderId) : null;
  const auth = Utilities.base64Encode(username + ':' + apiKey);
  let processed = 0;

  for (let i = 0; i < rows.length && processed < CONFIG.batchSize; i++) {
    const rowNumber = CONFIG.firstDataRow + i;
    const url = String(rows[i][CONFIG.urlColumn - 1] || '').trim();
    const status = String(rows[i][CONFIG.statusColumn - 1] || '').trim();

    if (!url || status === 'SUCCESS') continue;
    processed++;

    if (!/^https?:///i.test(url)) {
      sheet.getRange(rowNumber, CONFIG.statusColumn).setValue('ERROR: Enter an http:// or https:// URL');
      continue;
    }

    try {
      const response = UrlFetchApp.fetch(CONFIG.endpoint, {
        method: 'post',
        contentType: 'application/x-www-form-urlencoded',
        payload: { url: url },
        headers: { Authorization: 'Basic ' + auth },
        muteHttpExceptions: true
      });

      const code = response.getResponseCode();
      if (code < 200 || code >= 300) {
        const detail = response.getContentText().slice(0, 500).replace(/s+/g, ' ');
        sheet.getRange(rowNumber, CONFIG.statusColumn)
          .setValue('ERROR: HTTP ' + code + (detail ? ' — ' + detail : ''));
        continue;
      }

      const filename = safeFilename_(url, rowNumber) + '.pdf';
      const blob = response.getBlob().setName(filename).setContentType('application/pdf');
      const file = folder ? folder.createFile(blob) : DriveApp.createFile(blob);
      sheet.getRange(rowNumber, CONFIG.fileColumn).setValue(file.getUrl());
      sheet.getRange(rowNumber, CONFIG.statusColumn).setValue('SUCCESS');
    } catch (err) {
      sheet.getRange(rowNumber, CONFIG.statusColumn)
        .setValue('ERROR: ' + String(err).slice(0, 500));
    }
  }
}

function safeFilename_(url, rowNumber) {
  let host = 'page';
  try {
    host = new URL(url).hostname || host;
  } catch (err) {
    // URL validation is performed before this function is called.
  }
  host = host.replace(/[^a-z0-9.-]/gi, '_').replace(/.+/g, '_');
  return host + '-row-' + rowNumber;
}

For the documented endpoint and parameters, consult PDFCrowd’s HTTP API guide before adopting a different API version. The endpoint path shown here contains version 24.04; it is an API version marker, not a promise that it is the newest version. Apps Script’s UrlFetchApp supports POST requests and response handling. Google documents its URL Fetch service and response blob/content methods at URL Fetch Service.

Rank #2
Doxillion Free Document Converter – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
  • Convert over 50 document file formats.
  • Preview your files from Doxillion before converting them.
  • Use batch conversion to convert thousands of files at once.
  • Enjoy an easy-to-use, intuitive interface with a Drag and Drop file option.
  • Burn your converted or original files directly to disc.

Why this script checks before saving

With muteHttpExceptions: true, non-success HTTP responses are returned to the script instead of immediately throwing an exception. The code records the status and a limited portion of the response body, and creates a Drive file only for a successful status. Successful responses are handled as blobs because they contain PDF bytes, not text. Spreadsheet and Drive operations use Google’s SpreadsheetApp and Drive services.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run a batch and authorize it

  1. Save the project and select convertNextBatch in the function list.
  2. Click Run. On the first run, review and grant the requested Google permissions for spreadsheet, Drive, and external requests.
  3. Return to the sheet and inspect columns B and C. A successful row contains a Drive file URL and SUCCESS; failures have an ERROR status with available diagnostic information.
  4. Run the function again to process the next eligible rows. Successful rows are skipped. Change the sheet name and column numbers in CONFIG if your layout differs.

The batch size of 10 is only a conservative starting setting in this example, not a guaranteed safe limit. Actual limits depend on current Apps Script execution and URL Fetch quotas and your PDFCrowd account limits. Check those limits before increasing batch size or adding a time-driven trigger.

Rank #3
PDF Extra Ultimate | Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Yearly License | 1 Windows PC & 2 Mobile Devices | 1 User
  • EDIT text, images & designs in PDF documents. ORGANIZE PDFs. Convert PDFs to Word, Excel & ePub.
  • READ and Comment PDFs – Intuitive reading modes & document commenting and mark up.
  • CREATE, COMBINE, SCAN and COMPRESS PDFs
  • FILL forms & Digitally Sign PDFs. PROTECT and Encrypt PDFs
  • 1 Year License for 1 Windows & 2 Mobile (Android and/or iOS) devices.

Make reruns and failures manageable

Resuming without duplicate PDFs

The script’s simplest duplicate policy is to skip rows marked SUCCESS. If you clear that status and run again, it will create another Drive file; decide whether you want to keep, replace, or delete prior files before doing so. The row number is part of each filename, and the result URL is written beside its source URL.

Improving batch processing

For larger lists, run one manageable batch at a time and retain the row status as the progress record. If execution stops, successful rows remain marked and can be skipped on the next run. Do not assume a fixed number of rows or a trigger schedule is within quota: verify current Google Apps Script and PDFCrowd account limits for your use case.

Rank #4
PDF Extra Lifetime - Professional PDF Editor - Best Adobe Acrobat Pro Alternative - Lifetime License for Windows PC
  • Perfect Adobe Acrobat Pro alternative – lifetime license for Windows 10 and 11.
  • EDIT text, images, pages, hyperlinks, designs in PDF documents. ORGANIZE PDFs.
  • READ and Comment on PDFs – Intuitive reading modes & document commenting and mark up tools!
  • CREATE, COMBINE, SCAN and COMPRESS PDFs.
  • FILL forms & Digitally Sign PDFs. Work with Digital certificates

Handling errors safely

The code stores up to 500 characters of a response body or exception in the status cell to aid diagnosis. Check that detail before retrying. Do not automatically retry every failure: malformed URLs, denied access, or bad API credentials need a correction rather than repeated requests. If you need more diagnostic detail, PDFCrowd documents optional JSON error formatting and debug information in its parameter reference.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshoot common problems

  • Missing credentials: Confirm that both script properties are named exactly PDFCROWD_USERNAME and PDFCROWD_API_KEY, and that the account username and API key are correct.
  • Authorization or API error response: Check the recorded HTTP status and response detail, then verify credentials and the endpoint and parameters against the current PDFCrowd API documentation. Do not save an error response as a PDF.
  • Invalid URL status: The script accepts only values beginning with http:// or https://. Correct the cell to a complete web address.
  • Page cannot be fetched: Ensure the source is reachable from PDFCrowd’s servers. A URL accessible only on your computer or behind an organization login is not made accessible by the PDFCrowd API key.
  • Apps Script authorization or scope failure: Run the function interactively to authorize it. If using explicit OAuth scopes, include https://www.googleapis.com/auth/script.external_request.
  • Execution stops partway through: Check the last written statuses and run again. The script skips SUCCESS rows, but rows that failed will be attempted again, so diagnose persistent failures first.
  • Drive folder error: Verify that PDF_FOLDER_ID contains the folder’s ID and that the Google account running the script can create files there. Clear the property only if saving to Drive root is intended.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your goal is a clean screenshot rather than a PDF archive, ScreenshotNeo accepts a URL in one API request. It returns a PNG, JPEG, WebP, or PDF; this example requests a PDF:

Best Value
Doxillion Free Document Converter for Mac – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
  • Convert over 50 document file formats.
  • Preview your files from Doxillion before converting them.
  • Use batch conversion to convert thousands of files at once.
  • Enjoy an easy-to-use, intuitive interface with a Drag and Drop file option.
  • Burn your converted or original files directly to disc.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.pdf

See the ScreenshotNeo documentation for request options. It accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, with the response identifying the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.

Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month, no card required.

Frequently Asked Questions

Does this workflow convert every row in one run?

No. The sample processes up to its configured batch size per run and skips blank or successful rows. Run it again for later eligible rows.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Can PDFCrowd convert a URL that is only available on my computer?

Not through this URL-fetch workflow unless the page is made reachable to PDFCrowd’s servers or another supported access method is configured.

Is endpoint version 24.04 necessarily the latest PDFCrowd API version?

No. It is the versioned endpoint documented for this guide; check PDFCrowd’s current API documentation before starting a new production integration or changing versions.

Quick Recap

Bestseller No. 1
PDF Converter Ultimate - Convert PDF files into Word, Excel, PowerPoint and others - PDF converter software with OCR recognition compatible with Windows 11 / 10 / 8.1 / 8 / 7
PDF Converter Ultimate - Convert PDF files into Word, Excel, PowerPoint and others - PDF converter software with OCR recognition compatible with Windows 11 / 10 / 8.1 / 8 / 7
Convert your PDF files into Word, Excel & Co. the easy way; Convert scanned documents thanks to our new 2022 OCR technology
Bestseller No. 2
Doxillion Free Document Converter – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
Doxillion Free Document Converter – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
Convert over 50 document file formats.; Preview your files from Doxillion before converting them.
Bestseller No. 3
PDF Extra Ultimate | Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Yearly License | 1 Windows PC & 2 Mobile Devices | 1 User
PDF Extra Ultimate | Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Yearly License | 1 Windows PC & 2 Mobile Devices | 1 User
READ and Comment PDFs – Intuitive reading modes & document commenting and mark up.; CREATE, COMBINE, SCAN and COMPRESS PDFs
$83.88
Bestseller No. 4
PDF Extra Lifetime - Professional PDF Editor - Best Adobe Acrobat Pro Alternative - Lifetime License for Windows PC
PDF Extra Lifetime - Professional PDF Editor - Best Adobe Acrobat Pro Alternative - Lifetime License for Windows PC
Perfect Adobe Acrobat Pro alternative – lifetime license for Windows 10 and 11.; EDIT text, images, pages, hyperlinks, designs in PDF documents. ORGANIZE PDFs.
$99.99
Bestseller No. 5
Doxillion Free Document Converter for Mac – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
Doxillion Free Document Converter for Mac – Converts DOCX, DOC, PDF, WPS and Many More Files Quickly [Download]
Convert over 50 document file formats.; Preview your files from Doxillion before converting them.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Google Apps ScriptGoogle DriveGoogle SheetsPDF conversionPDFCrowdScreenshotNeo

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.