pdftk

How to find and replace text in a existing PDF file with PDFTK (or other command line application)

独自空忆成欢 提交于 2019-11-27 18:35:40
I have on each page of my PDF document a line with this string: %REPLACE% Which I'd like to find and replace with another string. Does anyone know how to do this with some command line application such as PDFTK? This folk gave me an important clue however I'd like something more direct. Thanks. Dingo You can try to modify content of your PDF as follows Uncompress the text streams of PDF pdftk file.pdf output uncompressed.pdf uncompress Use sed to replace your text with another sed -e "s/ORIGINALSTRING/NEWSTRING/g" <uncompressed.pdf >modified.pdf If this attempt was successful, re-compress the

pdftk compression option

谁都会走 提交于 2019-11-27 16:42:16
I use pdftk to compress a pdf using the following command line pdftk file1.pdf output file2.pdf compress It works as the weight of my file decreased. Are there [options] to change the compression??? Or maybe other solutions to compress my file? It is heavy because some graphics have a lot of points . Is there a way to convert these graphs to jpg for instance and adapt the compression? nullglob I had the same problem and found two different solutions (see this thread for more details). Both reduced the size of my uncompressed PDF dramatically. Pixelated (lossy): convert input.pdf -compress Zip

Merge PDF's with PDFTK with Bookmarks?

霸气de小男生 提交于 2019-11-27 05:04:20
问题 Using pdftk to merge multiple pdf's is working well. However, any easy way to make a bookmark for each pdf merged? I don't see anything on the pdftk docs regarding this so I don't think it's possible with pdftk. All of our files merged will be 1 page, so wondering if there's any other utility that can add in bookmarks afterwards? Or another linux based pdf utility that will allow to merge while specifying a bookmark for each individual pdf. 回答1: You can also merge multiple PDFs with

pdftk compression option

别说谁变了你拦得住时间么 提交于 2019-11-27 04:09:05
问题 I use pdftk to compress a pdf using the following command line pdftk file1.pdf output file2.pdf compress It works as the weight of my file decreased. Are there [options] to change the compression??? Or maybe other solutions to compress my file? It is heavy because some graphics have a lot of points . Is there a way to convert these graphs to jpg for instance and adapt the compression? 回答1: I had the same problem and found two different solutions (see this thread for more details). Both

How to pass variables as stdin into command line from PHP

家住魔仙堡 提交于 2019-11-27 03:57:40
I am trying to write a PHP script that uses the pdftk app to merge an XFDF with a PDF form and output the merged PDF to the user. According to the pdftk documentation, I can pass the form data in via stdin and have the PDF output to the stdout stream. The normal, file-not-stream way to use pdftk from the command line is: pdftk blankform.pdf fill_form formdata.xfdf output filledform.pdf to use streams on the command line, you'd enter: pdftk blankform.pdf fill_form - output - I have a couple of problems: 1) I have gotten pdftk to return output via stdout using an xfdf file (instead of stdin )

Flatten FDF / XFDF forms to PDF in PHP with utf-8 characters

寵の児 提交于 2019-11-27 03:56:10
问题 My scenario: A PDF template with formfields: template.pdf An XFDF file that contains the data to be filled in: fieldData.xfdf Now I need to have these to files combined & flattened. pdftk does the job easily within php: exec("pdftk template.pdf fill_form fieldData.xfdf output flatFile.pdf flatten"); Unfortunately this does not work with full utf-8 support. For example: Cyrillic and greek letters get scrambled. I used Arial for this, with an unicode character set. How can I accomplish to

PDFtk Server on OS X 10.11

主宰稳场 提交于 2019-11-27 02:25:59
I've been using PDFTK Server on OSX pre 10.11 for over a year without any issues running commands on the command line. After installing OSX 10.11 beta, I can no longer run any PDFTK Server commands on the command line. It does not throw any error, all the commands I try to execute just hang indefinitely. I installed from a pkg I downloaded from the PDFTK Server website as always: https://www.pdflabs.com/tools/pdftk-server/ I've also tried installing from source with Homebrew. The installation works, but I get the same results, the commands just hang in the terminal: Homebrew tap I've sent in

How to find and replace text in a existing PDF file with PDFTK (or other command line application)

只愿长相守 提交于 2019-11-26 19:25:23
问题 I have on each page of my PDF document a line with this string: %REPLACE% Which I'd like to find and replace with another string. Does anyone know how to do this with some command line application such as PDFTK? This folk gave me an important clue however I'd like something more direct. Thanks. 回答1: You can try to modify content of your PDF as follows Uncompress the text streams of PDF pdftk file.pdf output uncompressed.pdf uncompress Use sed to replace your text with another sed -e "s

How to pass variables as stdin into command line from PHP

和自甴很熟 提交于 2019-11-26 12:42:04
问题 I am trying to write a PHP script that uses the pdftk app to merge an XFDF with a PDF form and output the merged PDF to the user. According to the pdftk documentation, I can pass the form data in via stdin and have the PDF output to the stdout stream. The normal, file-not-stream way to use pdftk from the command line is: pdftk blankform.pdf fill_form formdata.xfdf output filledform.pdf to use streams on the command line, you\'d enter: pdftk blankform.pdf fill_form - output - I have a couple

PDFtk Server on OS X 10.11

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-26 10:05:54
问题 I\'ve been using PDFTK Server on OSX pre 10.11 for over a year without any issues running commands on the command line. After installing OSX 10.11 beta, I can no longer run any PDFTK Server commands on the command line. It does not throw any error, all the commands I try to execute just hang indefinitely. I installed from a pkg I downloaded from the PDFTK Server website as always: https://www.pdflabs.com/tools/pdftk-server/ I\'ve also tried installing from source with Homebrew. The