Post without Account — your post will be reviewed, and if appropriate, posted under Anonymous. You can also use this link to report any problems registering or logging in.

RT 129538 Updates to PDF 1.5+ files with cross reference stream are not renderin

  • 0 Replies
  • 28 Views
*

Offline Phil

  • Global Moderator
  • Hero Member
  • *****
  • 551
    • View Profile
Sat May 11 13:38:12 2019 david-dot-warring [...] gmail.org - Ticket created
   Subject: Updates to PDF 1.5+ files with cross reference stream are not rendering in Acrobat Reader

As reported in https://www.perlmonks.org/?node_id=1233444.

This is still a problem latest PDF::API2 blead. I have to do a bit more work to tickle it (e.g. adding a page) because the latest PDF::API2 now guards against null updates.
Code: [Select]
use PDF::API2;
my $pdf = PDF::API2->open("/tmp/test.pdf") or die $@;
my $page = $pdf->page;
my $font = $pdf->corefont('Helvetica-Bold');
$text = $page->text();
$text->font($font, 20);
$text->translate(200, 700);
$text->text('Test!');

$pdf->saveas("/tmp/test2.pdf");
With the attached test.pdf (for example), the output test2.pdf will fail in Adobe reader with "There was a problem reading this document (14)."

Sat May 11 13:43:38 2019 david-dot-warring [...] gmail.org - Correspondence added

Note: I had the exact same bug in the Perl 6 PDF module, which I solved by re-outputting the cross reference table an cross reference stream on updates to PDF 1.5+ files. I am happy to submit on a PR for a similar solution here.

Sat May 11 13:52:04 2019 david-dot-warring [...] gmail.org - Correspondence added

Sorry I missed ticket 117184. Which already covers this issue and has some proposed solution. I'll reject this as a duplicate at watch that t ticket.

Sat May 11 13:52:04 2019 david-dot-warring [...] gmail.org - Status changed from 'new' to 'rejected'