Skip Menu |

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

Report information
The Basics
Id: 123712
Status: new
Priority: 0/
Queue: CAM-PDF

People
Owner: Nobody in particular
Requestors: futuramedium [...] yandex.ru
Cc:
AdminCc:

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



Subject: Fix for "decodeOne", to allow "decodeAll" to work
I was trying to remove filters from all streams and then save uncompressed file: use strict; use warnings; use CAM::PDF; my $doc = CAM::PDF-> new( 'inlineimage.pdf' ); my $root_node = $doc-> { trailer }{ Root }; $doc-> decodeAll( $root_node ); # $doc-> cleanoutput( 'uncompressed.pdf' ); PDF file is from test suite. This results in large amount of warnings. Uncommenting last line leads to more warnings and dying with "This stream is too complex for me to write... Giving up". Data::Dumping reveals the "StreamData" key was added to all dictionary nodes -- because of auto-vivification in line 5575 of PDF.pm. Changing line 5568 from if ($objnode->{type} ne 'dictionary') to if ($objnode->{type} ne 'dictionary' or not exists $objnode-> {value}{StreamData}) fixes the problem, script completes without warnings as expected.
From: futuramedium [...] yandex.ru
s/dictionary nodes/dictionaries/