in reply to Writing PDF binary file from stream yields malformed PDF
Use the three argument open and set the the files' layer to raw
</code>binmode STDIN, ':raw'; my $output_file = shift @ARGV; open my $out_fh, '>:raw', $output_file or die "could not open $output_ +file: $!\n"; while( my $line = <STDIN> ){ print {$out_fh} $line or die "could not print to $output_file: $!\ +n"; } close $out_fh or die "could not close $output_file: $!\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Writing PDF binary file from stream yields malformed PDF
by another_monkey (Initiate) on Jun 27, 2013 at 07:34 UTC | |
|
Re^2: Writing PDF binary file from stream yields malformed PDF
by Anonymous Monk on Jun 27, 2013 at 00:03 UTC |