Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

Import PDFs into your LocalGov Drupal site as HTML publications automatically.

How to try this out

  • Enable the module.
  • Choose "Content" -> "Imports" from the admin menu.
  • Upload a PDF file to the form linked from the top right and submit it.
  • You'll be redirected back to the list of imports on submission.
  • Imports are processed in the background. Once processed, a link to the imported publication will show on the imports screen.
  • Background processing is either via cron, or via a drush command that can be scheduled.

Using AI to format the imported PDF

If you'd like to use AI to clean up the text, you can. A submodule, localgov_publications_importer_ai, is included. To enable this module you will need to install the Drupal AI module and at least one AI provider module. The default AI chat provider will be used if one is configured. In the steps below will illustrate how to configure one using ChatGPT. Similar steps can be used with other AI LLM providers:

  • Enable the localgov_publications_importer_ai submodule.
  • Download and install the Open AI provider module.
  • Get an API key from OpenAI (requires an Open AI account).
  • Choose "Configuration" -> "AI" -> "Provider Settings" -> "OpenAI Authentication" from the admin menu.
  • Click the link saying "create a new key".
  • Add your API key here. Key name and description can be whatever makes sense to you. Key type should be "Authentication". Key provider can be "Configuration" if you're just testing locally. Value is the key itself.
  • Save the key and head to "Configuration" -> "AI" -> "Provider Settings" -> "OpenAI Authentication" again.
  • This time you can choose your key from the dropdown. The key will be verified on save, so if you put in a key that's incorrect, you'll be notified here.
  • Once the key is saved, head to "Configuration" -> "AI" -> "AI Default Settings".
    Scroll down to chat. Ensure OpenAI is selected. Choose the model you'd like to use.
  • Now repeat the steps to upload a PDF from before. You'll notice that the import takes longer, and the resulting HTML output contains structure like headings and lists.

This module has had the most development and testing with AWS Bedrock, and is known to work well with Claude and Kimi models. It's also been used successfully with Gemini in production.

Plugin structure

This module is designed to be customisable. You can either write your own plugins to affect how content is imported, or use Drupal modules that provide plugins.

We work on an instance of ImportInterface, which is passed between plugins. There's a default implementation called Import, but you can use your own if you like.

Operations are what happens to an Import. These can be one of three types:

  1. Extract: Plugin/LocalGovImporter/Extract
  2. Transform: Plugin/LocalGovImporter/Transform
  3. Save: Plugin/LocalGovImporter/Save

Content is extracted from the uploaded file by an Extract plugin, and placed on an Import object. It's then transformed by any number of Transform plugins, and saved by a Save plugin.

Get involved

Please join the #feature-publications-importer channel on LGD Slack to learn more.

You can fund the development of this feature via the LocalGov Drupal Community Fund.

Activity

Total releases
5
First release
Dec 2025
Latest release
2 weeks ago
Release cadence
28 days
Stability
20% stable

Release Timeline

Releases

Version Type Release date
1.1.0 Stable Mar 31, 2026
2.x-dev Dev Mar 25, 2026
1.1.0-beta2 Pre-release Feb 9, 2026
1.1.0-beta1 Pre-release Dec 12, 2025
1.x-dev Dev Dec 11, 2025