With the old pdftk version in Fedora 7 (pdftk-1.41-5.fc7) pdftk would read files from standard input. For example, the following would work: pdftk - bar.pdf cat output foobar.pdf < foo.pdf With the pdftk recently released in FC10, this no longer works. It gives the error: Error: Failed to open PDF file: - Errors encountered. No output created. Done. Input errors, so no output created. Version-Release number of selected component (if applicable): pdftk-1.41-13.fc10 How reproducible: Every time. Additional info: I think this is due to the FC10 version being linked against a system itext rather than having it compiled together.
Is your foo.pdf encrypted? Afaik, we dropped encrypted pdf support from pdftk.
No its not. It comes directly from a vanilla ps2pdf invocation: # pdfinfo foo.pdf Creator: cairo 1.8.0 (http://cairographics.org) Producer: GPL Ghostscript 8.63 CreationDate: Mon Mar 30 19:44:49 2009 ModDate: Mon Mar 30 19:44:49 2009 Tagged: no Pages: 3 Encrypted: no Page size: 612 x 792 pts (letter) File size: 91159 bytes Optimized: no PDF version: 1.4
Thank you for reporting this bug. This bug may occured by the migration of pdftk to iText-2. The migration to iText-2 was required because the bundled iText-1 library has severe license issues. I was create a patch which should fix the reported issue. Teh issue should be fixed on pdftk-1.41-14.
pdftk-1.41-14.fc10 has been submitted as an update for Fedora 10. http://admin.fedoraproject.org/updates/pdftk-1.41-14.fc10
Thank you, I can confirm the 1.41-14 version works!
pdftk-1.41-14.fc10 has been pushed to the Fedora 10 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update pdftk'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-3226
Ok, I think there is now a timing issue associated with reading standard input. I use a variation on the following command line often: scanimage --mode Gray --resolution 150 | pnmtops -imagewidth 8.5 -imageheight 11 | ps2pdf - | pdftk foo.pdf - cat output foo1.pdf This scans a document, and uses pdftk to append the scanned page to an existing PDF (foo.pdf) and writes the result to foo1.pdf. With the new pdftk, I get this output: Error: Failed to open PDF file: /dev/stdin Errors encountered. No output created. Done. Input errors, so no output created. scanimage: received signal 13 scanimage: trying to stop scanner scanimage: received signal 13 scanimage: aborting
pdftk-1.41-15.fc10 has been submitted as an update for Fedora 10. http://admin.fedoraproject.org/updates/pdftk-1.41-15.fc10
pdftk-1.41-15.fc10 has been pushed to the Fedora 10 stable repository. If problems still persist, please make note of it in this bug report.
it still not work for me. with pdftk-1.41-15.fc10 cat my.pdf | /usr/bin/pdftk - output - owner_pw streeteurope encrypt_40bit allow Printing ScreenReaders > result.pdf it the same with PHP and the function proc_open To help I use the following php function : function encypt_pdf($pdf_data) { $pdftk = "/usr/bin/pdftk - output - owner_pw titi encrypt_40bit allow Printing ScreenReaders"; //compatible acrobat 3 et superieur $descriptorspec = array( 0 => array("pipe", "r"), // stdin est un pipe où le processus va lire 1 => array("pipe", "w"), // stdout est un pipe où le processus va écrire 2 => array("file", "/dev/null", "a"), // stderr est un fichier ); $process = proc_open($pdftk, $descriptorspec, $pipes); if (is_resource($process)) { // $pipes ressemble à : // 0 => fichier accessible en écriture, connecté à l'entrée standard du processus fils // 1 => fichier accessible en lecture, connecté à la sortie standard du processus fils // Toute erreur sera envoyées dans /dev/null fwrite($pipes[0], $pdf_data); fclose($pipes[0]); $data = ""; while(!feof($pipes[1])) { $pdf_data.= fgets($pipes[1], 1024); } fclose($pipes[1]); // Il est important que vous fermiez les pipes avant d'appeler // proc_close() afin d'éviter un verrouillage. $return_value = proc_close($process); //echo "$return_value"; } return $pdf_data; }
correction of my previous post. The version use is pdftk-1.41-15.fc10.x86_64
Could you try the latest version available in the updates ? (pdftk-1.41-19.fc10.x86_64) Also could you add a real name to your profile?
The update works with both command line and php. Thank you !
Changed "Fixed in version" to 1.41-19.fc10