pdftk

Join multiple PDF files into a single page PDF - positioned join using PHP [closed]

倖福魔咒の 提交于 2019-12-06 22:36:54
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 10 months ago . This is not an attempt to join separate PDFs to one single PDF with multiple pages. It is an attempt to create a single page PDF from few other PDFs that already exists. I need to do this using PHP and the server is CentOS. I am already generating a set of single page PDF files based on individual templates

pdftk + xfdf + php can't handle umlauts

大兔子大兔子 提交于 2019-12-06 11:35:22
I'm using XFDF files to fill out PDF-forms serverside with PHP and pdftk but my problem is that no non-english characters (ä, ö, å etc.) are printed to the form fields. Here is the function I use to parse the XFDF file: function createFDF($file,$info,$enc='UTF-8'){ $data='<?xml version="1.0" encoding="'.$enc.'"?>'."\n". '<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">'."\n". '<fields>'."\n"; foreach($info as $field => $val){ $data.='<field name="'.$field.'">'."\n"; if(is_array($val)){ foreach($val as $opt) $data.='<value>'.htmlentities($opt,ENT_COMPAT,$enc).'</value>'."\n"; }else

add a .pdf file(.png basically) to the end of every page in another .pdf file

江枫思渺然 提交于 2019-12-06 08:04:57
问题 I have a code.ps file converted to code.pdf , which I want to add to the end of every page in my test.pdf , i.e shrink the test.pdf's every page and add an image to the end of it . I have written the following shell script to it , but it appends the code.pdf as a new page after every page of test.pdf ! ...Kindly help . Here is my code :- #!/bin/sh filename=test.pdf pages="`pdftk $filename dump_data | grep NumberOfPages | cut -d : -f2`" numpages=`for ((a=1; a <= $pages; a++)); do echo -n "A$a

getting two A6 complete booklet sequences from an A4 page

做~自己de王妃 提交于 2019-12-06 06:31:27
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. as suggested, the mighty Multivalent tools are the solution, but they need to be combined with my Script I attach to perform the task you desire

Missing characters in filled pdf using PDFTk with encoding UTF-8

喜夏-厌秋 提交于 2019-12-06 05:55:20
I'm trying to fill pdf documents using PDFTk. Script working fine, it fills inputs in form but I don't get special characters [polish charset: UTF-8 or ISO-8859-2]. Script: https://github.com/mikehaertl/php-pdftk The weird thing is that generated pdf actually has polish characters when I click on field. Before click: After click on field: Default encoding is set to UTF-8. The problem is that PDFTk can't use chars outside the standard ASCII with FDF form fill. It doesn't allow multi-byte characters. What I did: Add fonts to pdf files (checked and files has font) Create fields in pdf files with

node.js child process doesn't work in node webkit

空扰寡人 提交于 2019-12-05 19:21:46
I made a small app with node webkit. Pre-packaging, it works fine. But after I zipped it and added it to Contents/Resources in node-webkit.app I get an error when I run the app. It opens fine, but the task it does involves child processes, and I get this error: Uncaught node.js Error Error: spawn ENOENT. I'm guessing it might be something related to the issue raised in this question: Node-Webkit Child Process Exec because my child processes are calling pdftk, a separate command line program. Ultimately, I'd love to install pdftk as part of my app - I have not been able to figure out how to do

Split PDF by multiple pages using PDFTK?

五迷三道 提交于 2019-12-05 08:37:38
I am finding it hard to phrase this question and could not find an online solution for what I'm trying to do. I know how to split a large PDF into single pages with PDFTK using the following script: pdftk your_file.pdf burst output your_directory/page_%02d.pdf But now I want to split the PDF by every other page, so that each new PDF has TWO (2) pages (e.g. pages 1 + 2 together, pages 3 + 4 together, 5 + 6, etc.). I know that Acrobat does this like a champ, however I need something I can execute from Powershell. I am open to alternatives/workarounds, like taking the single pages and combining

add a .pdf file(.png basically) to the end of every page in another .pdf file

北战南征 提交于 2019-12-04 12:00:30
I have a code.ps file converted to code.pdf , which I want to add to the end of every page in my test.pdf , i.e shrink the test.pdf's every page and add an image to the end of it . I have written the following shell script to it , but it appends the code.pdf as a new page after every page of test.pdf ! ...Kindly help . Here is my code :- #!/bin/sh filename=test.pdf pages="`pdftk $filename dump_data | grep NumberOfPages | cut -d : -f2`" numpages=`for ((a=1; a <= $pages; a++)); do echo -n "A$a B1 "; done` pdftk A=$filename B=code.pdf cat $numpages output $filename-alternated.pdf exit 0 A simple

Font issue with PDFtk

萝らか妹 提交于 2019-12-04 10:00:33
问题 I'm having difficulties filling in a form using pdftk with text fields with true type fonts. Font files (.ttf) are added to /Library/Fonts (OSX Mavericks) The form is created with Adobe Acrobat Pro The form includes normal (non form) text using these fonts The form text fields also use these fonts The form can successfully be filled and printed using Adobe Acrobat Pro and even Preview However, pdftk throws an error when trying to fill it using the command: pdftk ./my_form.pdf fill_form my

How to add pdftk to Heroku Cedar app?

南楼画角 提交于 2019-12-04 07:55:23
问题 I need to merge multiple PDF files into one in my Heroku Cedar Rails app, and have settled upon using pdftk to do this. I'm lost as to how to do this. I think the best approach would be to create a custom buildpack that includes a compiled binary for pdftk but I can't quite figure out how to get Vulcan to do this. Is there a way to do this without Vulcan? Is there a pre-existing ruby buildpack that includes pdftk that I can use? 回答1: I've got this working now, and a publicly available version