定制 falkemedia/pdf-extractor 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

falkemedia/pdf-extractor

Composer 安装命令:

composer require falkemedia/pdf-extractor

包简介

This package automates the generation of an SQLite database that you can use to do a full-text search on a PDF.

README 文档

README

Latest Version on Packagist Total Downloads

This package automates the generation of an SQLite database that you can use to do a full-text search on a PDF. Meaning you take your PDF, use this tool to generate a database and then query the database and not the PDF for any text search.

This tool also generates thumbnails that you can use to display your search results however you like.

This is heavily inspired spatie/pdf-to-image
and has a dependency of spatie/pdf-to-text

Installation

You can install the package via composer:

composer require falkemedia/pdf-extractor

This package requires the installation of ImageMagic and the imagick php extension.
Instructions for macOS Catalina + PHP 7.3:

brew install imagemagick 
pecl install imagick

If there are any errors with imagemagic I suggest reading through this guide

Also, behind the scenes this package leverages pdftotext. On a mac you can install the binary using brew

brew install poppler

Usage

examples/extract_pdf_data.php

<?php

namespace falkemedia\PdfExtractor\Examples;

use falkemedia\PdfExtractor\Extractor;

require 'vendor/autoload.php';

// Load PDF
$extractor = new Extractor();
$extractor->load('/path/to/a/pdf/file.pdf');

// Generate thumbnails
$extractor
    ->setMaxThumbnailHeight(600)
    ->setMaxThumbnailWidth(480)
    ->setQuality(75)
    ->generateThumbnails();

// Store Fulltext infos
$extractor->generateTextDatabase();

If you have a saved sqlite database you can do full-text queries like for example:

SELECT*FROM pages WHERE body MATCH "*YOUR_SEARCH_QUERY*"

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email tg@falkemedia.de instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

PHP Package Boilerplate

This package was generated using the PHP Package Boilerplate.

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-08-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固