Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
franck-grenier opened this issue Jan 23, 2023 · 1 comment

Comments

@franck-grenier
Copy link

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 ?

@JanSlabon
Copy link
Member

Interesting issue. I guess by this the offsets are out of control. I must admit that I don't know how filters internally work but that's my simple guessing.

Are you able to provide an example with both simple encryption and decryption filters?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants