Skip to content
프로젝트

소개

PdfParser는 PDF 파일에서 데이터를 추출하는 다양한 도구를 제공하는 독립형 PHP 라이브러리입니다.

개발 도구

이 수치를 측정하는 방법

What you can do

  • Load/parse objects and headers
  • Extract metadata (author, description, ...)
  • Extract text from ordered pages
  • Support of compressed PDFs

측정된 스타 증가

in 24h
+1
in 7 days
+1
in 15 days
+5
in 1 month
+5

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

PDF parser

Version CI CS Scrutinizer Code Quality Downloads

The smalot/pdfparser is a standalone PHP package that provides various tools to extract data from PDF files.

Maintenance status

This library is under limited maintenance. It is still kept compatible with supported PHP versions, and community contributions may be accepted. However, there is currently no active feature development and no guarantee that pull requests will be reviewed or merged in a timely manner. If you plan to contribute anything beyond a small, well-scoped fix, please read CONTRIBUTING.md first.

Features

  • Load/parse objects and headers
  • Extract metadata (author, description, ...)
  • Extract text from ordered pages
  • Support of compressed PDFs
  • Support of MAC OS Roman charset encoding
  • Handling of hexa and octal encoding in text sections
  • Create custom configurations (see CustomConfig.md).

Currently, secured documents and extracting form data are not supported.

License

This library is under the LGPLv3 license.

Install

This library requires PHP 7.1+ since v1. You can install it via Composer:

composer require smalot/pdfparser

In case you can't use Composer, you can include alt_autoload.php-dist. It will include all required files automatically.

Quick example

<?php

use Smalot\PdfParser\Config;
use Smalot\PdfParser\Parser;

// Custom config: Recommended when parsing PDFs from untrusted sources
$config = new Config();

// Cap how far a single stream is decompressed, to avoid memory exhaustion.
// Pick a value that fits your content, and combine it with a sane PHP memory_limit.
$decodeMemoryLimit = 100 * 1024 * 1024; // = 100 MB
$config->setDecodeMemoryLimit($decodeMemoryLimit);

$parser = new Parser([], $config);
$document = $parser->parseFile('/path/to/untrusted-file.pdf');

echo $document->getText();

Further usage information can be found here.

See CustomConfig.md for all configuration options.

Documentation

Documentation can be found in the doc folder.

관련 프로젝트 살펴보기

불러오는 중…