You are here

public function TestPdfBackend::parseStream in FillPDF 5.0.x

Parse a PDF and return a list of its fields.

@todo Replace output array by a value object.

Parameters

string $pdf_content: The PDF template whose fields are to be parsed. This should be the contents of a PDF loaded with something like file_get_contents() or equivalent.

Return value

string[][] An array of associative arrays. Each sub-array contains a 'name' key with the name of the field and a 'type' key with the type. These can be iterated over and saved by the caller.

Overrides PdfBackendInterface::parseStream

See also

\Drupal\fillpdf\Plugin\PdfBackendInterface::parseFile()

1 call to TestPdfBackend::parseStream()
TestPdfBackend::parseFile in tests/modules/fillpdf_test/src/Plugin/PdfBackend/TestPdfBackend.php
Parse a PDF and return a list of its fields.

File

tests/modules/fillpdf_test/src/Plugin/PdfBackend/TestPdfBackend.php, line 74

Class

TestPdfBackend
Backend used in tests.

Namespace

Drupal\fillpdf_test\Plugin\PdfBackend

Code

public function parseStream($pdf_content) {
  return static::getParseResult();
}