pdftk

Remove the last page of a pdf file using PDFtk?

妖精的绣舞 提交于 2020-07-16 16:15:39
问题 Can someone please tell me how to remove the last page of a PDF file, using PDFtk? 回答1: Using the cat operation, and specifying a page range. pdftk infile.pdf cat 1-r2 output outfile.pdf 回答2: You need to find out the page count, then use this with the pdftk cat function, since (AFAICT) pdftk does not allow one to specify an "offset from last". A tool like 'pdfinfo' from Poppler (http://poppler.freedesktop.org/) can provide this. Wrapping this in a bit of bash scripting can easily automate

Remove the last page of a pdf file using PDFtk?

心已入冬 提交于 2020-07-16 16:13:13
问题 Can someone please tell me how to remove the last page of a PDF file, using PDFtk? 回答1: Using the cat operation, and specifying a page range. pdftk infile.pdf cat 1-r2 output outfile.pdf 回答2: You need to find out the page count, then use this with the pdftk cat function, since (AFAICT) pdftk does not allow one to specify an "offset from last". A tool like 'pdfinfo' from Poppler (http://poppler.freedesktop.org/) can provide this. Wrapping this in a bit of bash scripting can easily automate

Put multiple PDFs on none page, and repeat this for a list of files

百般思念 提交于 2020-01-25 08:19:06
问题 I have done 2000 analyses, each named by a string containing spaces, numbers, and parentheses, and every analysis has produced three (vector) pdf files. For example, for analysis John Doe 7 (m) I have the following pdfs: John Doe 7 (m)_upper_left.pdf , John Doe 7 (m)_upper_right.pdf , John Doe 7 (m)_lower.pdf as want to make a one-page pdf file for John Doe 7 (m) , where they are arranged as follows in John Doe 7 (m)_whole : And do this for all other analyses ( Jake Levinson 12 (k) , ...),

getting two A6 complete booklet sequences from an A4 page

倖福魔咒の 提交于 2020-01-02 19:19:07
问题 I have an a6 pdf book. I'd like to convert it to an a4 pdf so that when I print it, I can cut the a4 page in two (upside and downside will have the same content, so I'll end up with two copies of the book) and when putting together the pages, they can be read in sequence (I think this is called impose) Supose A,B,C,D are 4 pages of the book. I want the resulting file to be: DA DA and CD CD Was I clear? Sorry if I'm not using the correct terminology. 回答1: as suggested, the mighty Multivalent

How to crop PDF margins using pdftk and /MediaBox

自闭症网瘾萝莉.ら 提交于 2020-01-01 05:16:21
问题 I used pdftk to uncompress a PDF and then opened it as a text file. I want to edit the /MediaBox field, which is in my case /MediaBox [0 0 612 792] I would like to reduce the margins, for instance /MediaBox [100 0 512 792] Unfortunately it doesn't work. I can change the 0 into a 2 or a 9 but I cannot put 100 for instance. Any idea why? 回答1: use sed to replace any occurrence sed 's/MediaBox \[0 0 612 792*/MediaBox \[100 0 512 792]/g'<in.pdf >out.pdf or podofobox (inside podofo utils ) http:/

Add margin to PDF file when merging using PDFTK or similar

南笙酒味 提交于 2019-12-31 13:46:05
问题 I have a large collection of half-page sized PDF cut-sheets that are held in a folder on my Linux server. A user to the site will want to create a booklet from a subset of these. The booklet will be bound therefore the even pages of the collection will want more margin on the right side and the odd pages will want more margin on the left side. There can be up to 200 pages in a collection out of a universe of 500 pages so I don't want to regenerate each page to set the margin of it. It would

Convert HTML form data into a PDF file using PHP

99封情书 提交于 2019-12-31 10:47:15
问题 I have been looking and testing this for a couple days now and was wondering if anyone could point me in a different direction. I have a very long job application HTML form (jobapp.html) and a matching PDF (jobpdf.pdf) that have the same field names for all entries in both the HTML form and the PDF. I need to take the user data that is entered in the form and convert it to a PDF. This is what I have gathered so far but don't know if I am on track: Is pdftk the only viable 3rd party app to

How to repair a PDF file and embed missing fonts

孤街醉人 提交于 2019-12-28 13:21:13
问题 I use pdftk to repair some failures in corrupted PDF files, but I faced another problem which is not fixed by pdftk (or at least I do not know how to do so). I have PDF files with text based on TrueType fonts, but the fonts have not been embedded during PDF creation. Now I want to embed the required fonts to the existing files. Is there a command-line tool (like pdftk ) to embed missing fonts by providing path to TTF files? 回答1: You can use Ghostscript to embed missing fonts. Run the command

PDFtk hanging on MacOS Sierra

。_饼干妹妹 提交于 2019-12-28 08:00:23
问题 PDFtk Server seems to be hanging indefinitely on MacOS Sierra. Looks similar to the problem it had on El Capitan. I'm trying to run this command: pdftk test1.pdf test2.pdf cat output out.pdf verbose And am getting no output, just an indefinite hang. Same with every other command I've tried. PDFtk --version: pdftk 2.02 a Handy Tool for Manipulating PDF Documents Copyright (c) 2003-13 Steward and Lee, LLC - Please Visit: www.pdftk.com This is free software; see the source code for copying