Skip to content

setSourceFile from stream - Error "Object (id:24) not found at location (93829)" #164

Open
@franck-grenier

Description

@franck-grenier

Hello FPDI,
I'm trying to instantiate a \setasign\Fpdi\Fpdi object from a stream and I get the below error:

Object (id:24) not found at location (93829).

  at vendor/setasign/fpdi/src/PdfParser/CrossReference/CrossReference.php:176
    172▕         try {
    173▕             /** @var PdfIndirectObject $object */
    174▕             $object = $parser->readValue(null, PdfIndirectObject::class);
    175▕         } catch (PdfTypeException $e) {
  ➜ 176▕             throw new CrossReferenceException(
    177▕                 \sprintf('Object (id:%s) not found at location (%s).', $objectNumber, $offset),
    178▕                 CrossReferenceException::OBJECT_NOT_FOUND,
    179▕                 $e
    180▕             );

This stream has a specificity. It has a registered "filter" (see PHP stream_filter_append) to decrypt the content while reading.

If I pass a stream to a fully decrypted file, instantiation works fine.

Do you know any limitations with FPDI (or PDF in general) around that ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions