pdftk

Installing Pdftk on Linux server

Ihave been using pdftk.exe in my windows local machine to play with some pdf and is working fine. I want to upload it to my server which is Linux. On searching i found out that i have to install pdftk on the server itself as a compiled package for Red Hat. How can i do this ?? can anyone help me on this?? ...

merging XFDF with PDF form to create final PDF server-side?

This is what I have currently: User submits form data and gets a "download PDF" link. The link points to script which generates an XFDF file on the fly and outputs the XFDF file after setting the appropriate headers, etc. The XFDF file points to a password-protected PDF, which is the generic PDF form that uses the XFDF data to fill in ...

Combining Java and C without gcj -- move C to Java or Java to C?

First, I have no experience doing this. But like the beginning of any good program, I have problem that I need to fix, so I'm willing to learn. So many of you are probably already familiar with pdftk, the handy utility for handling various pdf-related tasks. So far as I can tell, most of these features are available in much newer, light...

How to pass variables as stdin into command line from PHP

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...

Merge PDF's with PDFTK with Bookmarks?

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? O...

Adding metadata to PDF via PHP

I need to augment a PDF with a custom metadata field on download in PHP (5.3). I have been looking at the pdftk library, but I can't get my head around how I would get PHP to interface with it on our (Ubuntu) web server. The deprecated PDFInfo library seems like a dead end. Is there a simpler/easier/better solution? Thanks ...

PDFTK Rotating Pages Problem

I'm trying to use PDFTK to rotate pages in my PDF document. Executing something like the following should result in no changes to the page rotation: pdftk in.pdf cat 1N output out.pdf (This is rotating page 1 "north" or "0 degrees.") In some PDF test documents, it works as expected (meaning, no changes to the page occurs). However, o...

How do I install Pdftk on my server?

I am using a Linux Server and am trying to install Pdftk, but I am problems trying to figure out what exactly to do. I found the following documentation on how to install it, but they refer mostly to installing it on the local Windows machine. They are: http://www.andrewheiss.com/blog/2009/07/29/installing-pdftk-php/ http://www.access...

Clone PDF file in a single page

I've got a PDF file which is exactly 1/5 of the size of an A4 page, and a script to convert it into a single A4 page by appending it repeatedly. The problem is that ImageMagick only works with bitmap graphics, and my PDF contains text and detailed vector graphics. The result is therefore loss of text data, much bigger file size, and wors...

Highlighting text in PDF using PDFTK

I am currently building a small search engine, in which the user types in a couple of keywords. I have a set of PDF files, which I first convert to text. Then I search through the text to see which documents have any one of the keywords in them. My goal is to highlight the keywords in the documents when I display them to the user. I am ...

Execution of PDFTk from PHP script is failing with error code 11

I am trying to Fill in a PDF from PHP script. I am following the article by Sid Steward at the following URL. I have configured PDFTk package on CentOS linux distribution and I am able to execute the pdftk from the command prompt and it merges the FDF form with the PDF and successfully generates the flattened(Filled) PDF. I am using fol...

How do you combine PDFs in ruby?

This was asked in 2008. Hopefully there's a better answer now. How can you combine PDFs in ruby? I'm using the pdf-stamper gem to fill out a form in a PDF. I'd like to take n PDFs, fill out a form in each of them, and save the result as an n-page document. Can you do this with a native library like prawn? Can you do this with rjb and ...

Using Sid Steward's PDFTK in Windows receiving a Unhandled Java Exception: java.io.CharConversionException

While attempting to find a way to merge existing PDF files and forms, I came across Sid Steward's PDFTK (http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/) and then found Andrew Heiss' PDFTK-php Class (code.google.com/p/pdftk-php/; www.andrewheiss.com/blog/2009/07/29/installing-pdftk-php/). The idea seemed so simple, but when I tried ...

Converting .ps to .pdf and removing a single page.

Hi there, I have a postscript file of a poster made in latex, and want to convert this to a pdf (I'm using ubuntu) I am using ps2pdf but if possible I would like to remove the first, blank page, and keep only the second page. Is there a command that allows this? Been trying to find one for longer than would seem sensible! Thanks! ...

PHP exec() not working - exiting early? no error?

i am using PHP to run exec() on a script which looks like this: exec("pdftk xx.pdf fill_form xx.fdf output xx.pdf flatten"); the strangest thing is that when i log in to ssh and put the command in manually - it works fine! it outputs a 224k pdf. but when i use the exec() command, only the first 36k of the script comes out. (i checked ...

PDF: How to Optimize Filesize & Convert to PNG (embedded fonts problem)

I have a PDF with embedded fonts that I can't seem to work with. Right now, I'm using GhostScript and trying to do 2 things: Minimize filesize of PDF: gswin32c -dSAFER -dBATCH -dNOPAUSE -dQUIET -sDEVICE=pdfwrite -sOutputFile=output.pdf input.pdf Convert PDF to PNG (super sample, to be used for creating other thumbnails): gswin32c -dS...

PHP: How to tell if PDF has embedded fonts?

Given a PDF document, is there a way to tell if it has embedded fonts? I'm working on the problem posted here: http://stackoverflow.com/questions/3774995/pdf-how-to-optimize-filesize-convert-to-png-embedded-fonts-problem. Perhaps I can rework some of my application's logic based on whether a PDF has embedded fonts or not. ...

PDFTK - and the ability to change the default view

Hi All, I have been merging PDFs using PDFTK with great success, the pages that are used to generate the pdf are set to 'click to show one page at a time' (basically the whole of the first page is displayed when the pdf opens, based on the height of the page). however the generated pdf defaults back to filling the reader based on its w...

Remove First Page from a Series of PDFs

Hi, I have a series of PDFs (Computer Gaming World issues) and I want to remove the first page from the pdf file of each issue. There are 100 issues, so a GUI is just not gonna cut it. I used pdftk to remove the first page from one issue: pdftk 1981_1112_issue1.pdf cat 1 output 1.pdf My problem is that I do not want to have to modify ...

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

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 wor...