Skip to content

Commit

Permalink
Fix indentation of serialized directories when not minified.
Browse files Browse the repository at this point in the history
  • Loading branch information
deven committed Feb 12, 2022
1 parent 29e7903 commit e78f1f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/PDF/Data.pm
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ sub write_object {
next if $key =~ /^-/;
my $obj = $object->{$key};
$self->add_indirect_objects($objects, $obj) if is_stream $obj;
$self->serialize_object($pdf_file_data, "/$key ");
$self->serialize_object($pdf_file_data, join("", " " x ($indent + 2), "/$key "));
if (not ref $obj) {
$self->serialize_object($pdf_file_data, "$obj\n");
} elsif ($objects->[0]{$obj}) {
Expand All @@ -1008,7 +1008,7 @@ sub write_object {
$self->write_object($pdf_file_data, $objects, $seen, $object->{$key}, ref $object ? $indent + 2 : 0);
}
}
$self->serialize_object($pdf_file_data, ">>\n");
$self->serialize_object($pdf_file_data, join("", " " x $indent, ">>\n"));

# For streams, write the stream data.
if (is_stream $object) {
Expand Down

0 comments on commit e78f1f6

Please sign in to comment.