Ghostscript を使用して、URL からダウンロードされた 2 つの PDF ファイルを結合する 1 行の Linux コマンドを作成しようとしています。ただし、一時ファイルを作成したくありません(すべてメモリ内で行う必要があります)。
次のコマンドは機能していないようです (プロセス置換によってこれを達成しようとしました)。
gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=combined.pdf <(curl http://example.com/one.pdf) <(curl http://example.com/two.pdf)
このコマンドを実行すると、以下のエラーが表示されます。
**** Warning: An error occurred while reading an XREF table.
**** The file has been damaged. This may have been caused
**** by a problem while converting or transfering the file.
**** Ghostscript will attempt to recover the data.
Error: /ioerror in --run--
Current allocation mode is local
Last OS error: Illegal seek
GPL Ghostscript 9.18: Unrecoverable error, exit code 1
2 つの入力 PDF のダウンロードが完了する前に、Ghostscript コマンドが実行されていると思われます。おそらく、これが発生するのを待つ方法があります。