Skip Menu |

This queue is for tickets about the PDF-API2 CPAN distribution.

Report information
The Basics
Id: 129538
Status: rejected
Priority: 0/
Queue: PDF-API2

People
Owner: Nobody in particular
Requestors: david-dot-warring [...] gmail.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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. 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)."
Subject: test.pdf
Download test.pdf
application/pdf 104.2k

Message body not shown because it is not plain text.

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. On Sat May 11 13:38:12 2019, WARRINGD wrote: Show quoted text
> 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. > > 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)."
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. On Sat May 11 13:43:38 2019, WARRINGD wrote: Show quoted text
> 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. > On Sat May 11 13:38:12 2019, WARRINGD wrote:
> > 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. > > > > 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)."