another_monkey has asked for the wisdom of the Perl Monks concerning the following question:
If we instead call 'tee' (set the filter to use 'tee')- the file is written correctly. Analyzing the malformed PDF shows that the xref table is malformed in the PDF we write and Adobe Reader fails to open it. We have already tried using sysopen,sysread etc. , using ":raw", and several other ways to write a binary file properly, and nothing worked (cut&paste code from documnetation for writing binary files). Only when using the 'tee' utility in linux as the filter, it was written correctly. This doesn't help us- we need to be able to write it to a file from stdin as part of the perl script. Any suggestions? If there could be a way to somehow call 'tee' with a system call, and give it STDIN of the perl program- it might could work. Many thanks in advance.my $input_file = shift; binmode STDIN; open(OUT, ">" . $input_file); binmode OUT; foreach my $line (<STDIN>){ print OUT $line; } close OUT;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Writing PDF binary file from stream yields malformed PDF
by shawnhcorey (Friar) on Jun 26, 2013 at 14:56 UTC | |
by Anonymous Monk on Jun 27, 2013 at 00:03 UTC | |
by another_monkey (Initiate) on Jun 27, 2013 at 07:34 UTC | |
|
Re: Writing PDF binary file from stream yields malformed PDF
by mprentice (Sexton) on Jun 26, 2013 at 13:53 UTC | |
|
Re: Writing PDF binary file from stream yields malformed PDF
by BrowserUk (Patriarch) on Jun 27, 2013 at 08:46 UTC | |
by Anonymous Monk on Jun 27, 2013 at 08:59 UTC | |
by BrowserUk (Patriarch) on Jun 27, 2013 at 09:34 UTC | |
by Anonymous Monk on Jun 27, 2013 at 09:44 UTC |