kaleu62/pi-reader 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

kaleu62/pi-reader

最新稳定版本:v0.9

Composer 安装命令:

composer require kaleu62/pi-reader

包简介

A Simple PDF and Image parser

README 文档

README

Build Status

It's a PDF and Image reader using spatie/pdf-to-text and API from https://ocr.space/

How To Use?

$pireader = new PIReader( [ 'apiKey' => 'xxxxxxxxx', // ocr.space API Key 'production' => false ] ); 

Due to the limitation of requests in ocr.space, the 'apiKey' parameter is mandatory, but its apiKey will only be used if the 'production' parameter is set to true.

The application currently consists of some really basic functions:

  • Return the OCR parsed Text
  • Verify the existence of a text in the document
  • Count the number of incidents of a text in the document
  • Perform a search in the Text through a regular expression

getArchive($filePath)

This function returns an array with text of the parsed contents of the file (Pdf or image) present in the path informed

$pireader->getArchive("http://my_fake_pdf_path/file.pdf"); 

existsInFile($filePath, $string)

This function returns a boolean with informing if the text is present in the file of the informed path, if the file is opened correctly it returns boolean, otherwise it returns null

$pireader->existsInFile("http://my_fake_pdf_path/file.pdf", "John Doe"); 

countOccurrences($filePath, $string)

$pireader->countOccurrences("http://my_fake_pdf_path/file.pdf", "John Doe"); 

regexFind($filePath, $regex)

$pireader->regexFind("http://my_fake_pdf_path/file.pdf", "[\d{5}\.\d{5} \d{5}\.\d{6} \d{5}\.\d{6} \d{1} \d{14}]"); 

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固