You are here

public function LegacyProviderPdfBackend::parseStream in FillPDF 8.4

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()

File

modules/fillpdf_legacy/src/Plugin/PdfBackend/LegacyProviderPdfBackend.php, line 88

Class

LegacyProviderPdfBackend
Legacy provider PdfBackend plugin.

Namespace

Drupal\fillpdf_legacy\Plugin\PdfBackend

Code

public function parseStream($pdf_content) {
  $template_file = file_save_data($pdf_content);
  return $this
    ->parseFile($template_file);
}