Merge PDFs, Summarize with ChatGPT, and Generate a New Summarized PDF using PDF.co and Zapier

This tutorial explains how to create a Zap that merges multiple PDF files, extracts their text, summarizes the content with ChatGPT, and converts the summary into a new PDF.

Before starting, ensure that:

  • You have active PDF.co, Zapier, and OpenAI accounts.
  • Your source PDF files are available through publicly accessible or authorized file URLs.
  • Your Zap has a trigger that supplies the PDF URLs you want to process.

Step 1: Set Up the Zap Trigger

Create a new Zap and select the app that will provide the source PDF files.

Configure and test the trigger. The test data should contain the URLs of all PDFs that need to be merged.

Step 2: Merge the PDF Files

Add a PDF.co action and select Merge PDF.

Configure the action:

  • Connect your PDF.co account using your API key.
  • Add the source PDF URLs in the order they should appear in the merged document.
  • Enable automatic conversion only if the source files may include non-PDF formats.
  • Enter a name for the merged file, such as merged-document.pdf.

Test the action. PDF.co should return a URL for the merged PDF.

Step 3: Extract Text from the Merged PDF

Add another PDF.co action and select PDF to Anything Converter.

Configure the action:

  • Set Output Format to Plain Text.
  • Map the merged PDF URL from the previous step into Source PDF URL.
  • Leave Page Selection empty to process the entire document, or enter the required zero-based page numbers or ranges.
  • Set Inline Output Option to True.

Enabling inline output is important because it returns the extracted text directly to Zapier. This eliminates the previous manual step of opening the text-file URL in a browser and copying its contents.

If the PDF contains scanned pages, configure the appropriate OCR language.

Test the action and confirm that the extracted text is available in the response body.

Step 4: Summarize the Extracted Text with ChatGPT

Add a ChatGPT (OpenAI) action and select the current Conversation action, not a legacy action.

Map the inline text returned by PDF.co into the user message. For example:

You are summarizing a collection of merged business documents.

Create a concise and accurate summary. Preserve important names, dates, figures, decisions, conclusions, and action items. Do not invent information. If something is unclear, state that it is unclear.

Return only simple, valid HTML using headings, paragraphs, and lists. Do not return Markdown or include code fences.

Document text:

[Map the PDF.co extracted-text output here]

A Memory Key is not necessary for this one-time summarization workflow. Select one of the currently supported models available in Zapier and test the action.

Review the result to ensure that important details from the source documents were preserved. For sensitive or consequential documents, include human review before distributing the generated summary.

For simpler workflows, Zapier also provides an Analyze Text action designed for tasks such as summarization.

Step 5: Convert the Summary into a PDF

Add another PDF.co action and select HTML to PDF Converter.

In the HTML input, add a basic document template and map the ChatGPT response into the body:

<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>Document Summary</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      line-height: 1.5;
      margin: 40px;
      color: #222;
    }
    h1 {
      border-bottom: 1px solid #ddd;
      padding-bottom: 10px;
    }
  </style>
</head>
<body>
  <h1>Document Summary</h1>
  [Map the ChatGPT response here]
</body>
</html>

Enter an output filename such as document-summary.pdf. You can also configure the page size, orientation, and margins if needed.

Test the action and open the returned PDF URL to verify the layout and content.

Step 6: Store or Deliver the PDF

PDF.co output URLs are temporary. If the summarized PDF must be retained, add another Zapier action to save it to permanent storage, such as Google Drive, Dropbox, OneDrive, or your own document-management system.

You can also add an email or messaging action to deliver the completed PDF automatically.

After testing the complete workflow, publish the Zap.

In this tutorial, you learned how to merge PDFs, summarize with ChatGPT, and generate a new summarized PDF using PDF.co and Zapier. You learned how to use the PDF.co PDF Merger API to merge multiple PDFs into a single PDF document. You learned how to use the PDF.co PDF to Text API to extract text from PDF documents.

Related Tutorials

See Related Tutorials