This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Feature

A killer app: PDF Editor

By Philip J. Hollenback on January 06, 2005 (8:00:00 AM)

Share    Print    Comments   

Here's a common situation in the business world: someone sends you (a Linux user) a contract to fill out and return. If you're lucky, it's a Microsoft Word document that you can open in OpenOffice.org. Often times it's a PDF. But how can you edit a PDF in Linux?

To be quite honest, things can get tricky. If the document was created with proper form fields, you can add text to the document with the free Adobe Acrobat and print it. However, you can't save your changes. Also, this only works in the official Acrobat program - Xpdf doesn't support PDF forms. Unfortunately Acrobat Professional ($449) is only available for Windows and Mac so that doesn't help the loyal Linux user.

Recently, I was that Linux user. After doing some investigation and following a few tips from others, I found two software solutions. Although these tools are not the easiest to use, they do fulfill the goal of filling out PDF forms. In addition: they point towards what I believe could be a true Linux "killer app": a robust PDF markup tool.

The Tools

The tools I found are Xfig and flpsed. Xfig is a general image editor, while flpsed is specifically for marking up PDF files. It's important to note that neither of these programs can actually edit PDF files. Rather, they can be used to add new text and graphics on top of the file. This is generally all you need for filling out typical business forms such as contracts.

I do have to warn you: flpsed is not a finished program. The flpsed home page warns: "flpsed is still alpha software!" Having said that, I did find it usable, although a bit rough around the edges.

Given flpsed's unfinished nature, it's not surprising that it is not to be found in any of the standard Linux distributions. Fortunately, it's fairly easy to build from source. First, install the fltk (Fast Light Toolkit, a C++ GUI toolkit) development libraries. I installed version 1.1.5 of fltk and fltk-devel from the Dag rpm repository.

You will also need X11 and ghostscript installed on your system, but everyone has those these days. Then, simply untar the flpsed source and run make to build flpsed. After this completes successfully, copy the flpsed binary to a convenient location such as /usr/local/bin/.

The Xfig image editing program and comes standard on most Linux desktop systems, so I won't cover it in much detail here, other than to point you to the Xfig home page for more information.

Using flpsed

Flpsed only operates on postscript files, so the first thing you have to do is convert your PDF to postscript. To do this, use the pdf2ps commmand-line too which comes with ghostscript. This is usually painless since the PDF markup language is a subset of postscript. After running pdf2ps on your file, you will find a postscript file with the same name and .ps extension in the same directory. When you are done editing the file, you can convert it back to PDF with the corresponding ps2pdf utility.

Flpsed is a completely graphical application, so run it from your desktop and use the file menu to open the postscript version of your PDF. After a bit of churning, flpsed will present you with the first page of your document in a window. You can now edit it as you want. Click on any area of the page you wish to add text and type away. You can use the arrow keys at any time when you have a textbox open on screen to reposition the text in small increments. This allows you to line up text accurately.

The flpsed user interface is very primitive. You can only add text to a page: once you add a text fragment, it remains forever (although you can make it empty). There's no way to add other graphical elements such as circles or boxes. You only get one font: courier, for that "I used a typewriter" look, in 3 sizes.

At least on my system, the font displayed in the flpsed editor did not match the font my printer used. This made exact positioning of long strings of text difficult as they tend to run off the page when printed.

You can press <ctrl-n> at any time while editing to move on to the next page. Any additions you've made to the previous page will remain. One big annoyance I had with flpsed is that you can only move to the next page with <ctrl-n> or press <ctrl-p> to skip to the first page of the document. There is no way to move to the previous page or jump to an arbitrary page in the document. This means that if you accidentally skip past the page you want in a long document, you have to start from the very beginning.

Once you are satisfied with the additions you've made to a document, you can save or print it. The save feature writes the file out with your changes embedded as additional postscript. This means that your changes are an integral part of the document and you can pass easily pass it on to anyone as a PDF file (you have to of course turn the postscript back in to pdf with pstopdf first). As I mentioned above, flpsed is most definitely alpha-quality software. It did crash once when I used it. Also, I would occasionally see a glitch where the text I added to a particular page of a document would be printed again on an additional blank page.

Time for Xfig

The Xfig method of editing pdf files is decidedly less elegant than what I've described above. However, it has one big advantage: you can draw anything you want on top of the original document. I was forced to use the Xfig method with some forms recently because the form fields contained default values.

It's a bit of a stretch to say you use Xfig to edit a postscript file. What you actually do is load the original file into Xfig as an image and create an overlay Xfig image on top of that. One major limitation with this approach is you can only operate on a single page of a postscript (or converted pdf) file.

I won't go over the details of using Xfig to add text on top of a postscript page because this howto provides a good description. This method does work to add text and other graphical elements on top of your pdf. However, keep these limitations in mind:

  • Xfig operates on only one page at a time.
  • You will need both the Xfig file and the original image if you want to print it out (the Xfig file references the original image).
  • This is not a very portable solution because you can't convert back to a pdf. Windows users will be very confused if you give them a fig file and the original image.

Putting It All Together

Using the combination of flpsed and Xfig, I was able to edit a number of different PDF documents. I was then able to either print the resulting documents with my text included, or email the PDFs to others. Thus, mission accomplished.

However, as you can see from the many caveats above, this is a cumbersome process. I sincerely hope that in particular flpsed is improved and expanded. For example, if it included basic drawing tools, I would not have had to use Xfig.

With a little bit of work, flpsed could be a "killer app" for Linux. Imagine the scenario: a Windows user comes to you with a look of panic on his face: "Help! I've got a PDF I have to edit. What can I do?"

"No problem," you say, as you fire up flpsed and save the day. Score one for Linux.

Share    Print    Comments   

Comments

on A killer app: PDF Editor

Note: Comments are owned by the poster. We are not responsible for their content.

Nice article!

Posted by: Anonymous Coward on January 06, 2005 08:25 PM
Even in Windows, it was difficult a few years ago. How about now in Windows side? Is it still the same like Linux's side?

#

scribus

Posted by: Anonymous Coward on January 07, 2005 12:32 AM
Such a long article and no scribus mentioned... sad... you can consider scribus as an analog to Adobe Illustrator which was capable of "editing" PS. Scribus is capable of importing PS files and has advanced UI and set of features, so you can do pretty much anything you want with your pdf/PS file.

#

KWord! Scribus!! kpdf!!

Posted by: Anonymous Coward on January 07, 2005 03:46 AM
I am using KDE's kword quite regularly to "edit" PDFs. It is astonishing how well it works for most documents I come across (this may change for a while, if Acrobat 7 takes off on the market, and untill Ghostscript 8.50 is more common on Linux distros).

kword opens even multi-page PDF documents for editing. Of course it doesnt edit the original PDF format either -- it imports the PDF into its own native, standard OASIS document format and lets you decide how to save it: PDF again, or *.kwd, *.doc, *.sxw, *.htlm....

Admittedly, sometimes, with some very sophisticated layouts, you may run into probles with kword: margins may need adaption, etc. Also, you need to make sure you have all the fonts installed (but that is not different from any Windows manipulation software of PostScript or PDF files).

Then there is Scribus! How can someone who knows such an obscure tool like flpsed (hehe, I use it myself occasionally<nobr> <wbr></nobr>;-) dare to not mention Scribus?

You can easily get and build one of the latest CVS version for upcoming Scribus-1.3 if you are a guy who does even compile "alpha" software like flpsed.

Scibus-1.3 is so astonishing in its capabilities. And it is rock-solid for me, even the daily builds of my CVS checkout. Scribus lets you import PostScript/(PDF) too. And then the fun starts: all the ex-PS "objects" are prone to your manipulations: you can drag elements to a different place, colorize them differently, resize, rotate and scale them, convert glyphs and shapes into paths and bezier curves and what-not. After you are done, export to PDF again. The resulting PDF is on par with, no -- better than ! -- Windows software. All pre-flight tools let the result pass.

Of course, you need fonts installed, and Little CMS (color management) and Ghostscript 8.50 for the best results.

Last word about kpdf: that one lets you also now do some really really brilliant stuff with PDFs. But you'll have to wait for KDE-3.4 to see the latest features. (Previous versions of kpdf and kghostview sucked big time -- but in the near future kpdf will certainly be one of the shiny new diamonds in KDE's crown.)

#

Re:KWord! Scribus!! kpdf!!

Posted by: Anonymous Coward on January 08, 2005 12:46 PM
Hello.

How on earth do you import PDFs in scribus?

I am using the 1.2.1CVS build, but it doesnt seem to have that ability.

#

Re:KWord! Scribus!! kpdf!!

Posted by: Anonymous Coward on January 10, 2005 07:15 AM
You don't have to do an import. Just insert an image, pdf shows up as a suported type...

#

Problems with KWord! Scribus!! kpdf!!

Posted by: Anonymous Coward on March 15, 2005 02:43 AM
Sometimes KWord and Scribus will properly read in the documents I want. Often they won't. The problem is that they have to convert everything to their own internal format, then convert back to pdf again. This is a lot of work and is error prone.

The beauty of flpsed is that it's always postscript! It's gv with an editor built on. Everything works.

#

Re:Problems with KWord! Scribus!! kpdf!!

Posted by: Anonymous Coward on November 05, 2005 10:26 AM
re; kword: "astonishing how well it works"<nobr> <wbr></nobr>.. ?

I was astonished at how totally useless it was.

#

Re:KWord! Scribus!! kpdf!!

Posted by: Anonymous Coward on April 07, 2007 06:10 AM
Ive tried repeatedly to import a variety of PDF files with kword with the same result every time - kword crashes and bombs.

#

Re:KWord! Scribus!! kpdf!!

Posted by: Administrator on February 21, 2005 07:45 AM
Hello, I have read the articles above and tried with scribus, but I am not able to see the fonts of my imported PDF files. I see figures and images but nothing else... My operating system is Suse 9.1 and I downloaded the latest stable version from scribus webpage with the python and tk necesary... Could some body help me to get the fonts on the screen?

Thanks a lot
Petra

#

A better solution

Posted by: Anonymous Coward on January 27, 2005 08:59 AM
If the pdf is a fillable form, you can use Acrobat Reader to fill in the form. It doesn't let you save, but it will let you print the output as a postscript file. Then run ps2pdf to create the final pdf file.

#

Better??

Posted by: Anonymous Coward on March 15, 2005 12:39 AM
That's only better if
1. The form is specifically fillable
2. You don't want to save work you've done.

I don't know about you, but I like to save a
copy of most things, especially forms.

#

Re:Better??

Posted by: Anonymous Coward on February 16, 2007 12:25 AM
As they just said, you "Print to file" to save it as a PostScript file, then you run that PS file through ps2pdf, and save that as your final copy.


  - raven morris

#

tried GIMP?

Posted by: Anonymous Coward on March 26, 2005 04:57 AM
Why not just use GIMP?

GIMP works just as well, and everyone has it.

-Ashen

#

Re:tried GIMP?

Posted by: Anonymous Coward on September 07, 2006 08:31 PM
Because you can only edit one page at a time<nobr> <wbr></nobr>:-(

#

pstoedit

Posted by: Anonymous Coward on June 17, 2005 03:55 AM
If you want to use Xfig, then use pstoedit to convert the Postscript file to native fig format. XFig can export back to PDF for you. <a href="http://www.pstoedit.net/pstoedit" title="pstoedit.net">http://www.pstoedit.net/pstoedit</a pstoedit.net>

#

Is debian a minor distribution? It has flpsed ...

Posted by: Anonymous Coward on July 27, 2005 05:06 AM
debian stable has flpsed packaged and this on can import/export PDF's without problems (at least I didn't see one) so the hassle of converting with pdf2ps isn't necessary.

See <a href="http://packages.debian.org/stable/graphics/flpsed" title="debian.org">http://packages.debian.org/stable/graphics/flpsed</a debian.org>

#

inkscape//sketch

Posted by: Anonymous Coward on August 12, 2005 10:28 PM
Both programs can draw on single-page postscript files... inkscape can import and ungroup them, too.
xfig is imo a terrible program to use...

I.

#

Easier Way to edit pdf

Posted by: Anonymous Coward on February 07, 2006 12:22 PM
Using shareware and Wine
<a href="http://forums.fedoraforum.org/showthread.php?p=450540#post450540" title="fedoraforum.org">http://forums.fedoraforum.org/showthread.php?p=45<nobr>0<wbr></nobr> 540#post450540</a fedoraforum.org>

#

Re:GIMP works great

Posted by: Anonymous Coward on July 31, 2006 10:15 PM
Yah, gimp is OK, I chose a resolution of 300 with week antialising for text and graphics. Filling in the form was easy using the 'guides', which allow text to be aligned easily.

Go Gimp!

#

flpsed is an excellent pdf editor

Posted by: Anonymous Coward on March 06, 2007 07:16 PM
It's an excellent program for filling pdf forms, which is all I need it for. I don't mind the "I used a typewriter" look with Courier font. I really like that the font size can be changed easily and the text boxes can be put anywhere. Flpsed can even be used to fill unfillable forms. That rocks. Sometimes things created in Linux are not so pretty in Windows, but the forms I filled in Linux using flpsed looked perfect in Windows. One thing though, flpsed can import pdf files directly, they don't need to be converted to ps first. This may be a new feature since this article was written. Anyway, thanks for writing this article. One more thing I don't need windows to do.

#

It is in Gentoo's Portage

Posted by: Administrator on January 06, 2005 09:36 PM
Given flpsed's unfinished nature, it's not surprising that it is not to be found in any of the standard Linux distributions.
It has been a masked package in portage for a while now, so any gentoo user should have an easy time installing the dependencies & flpsed.

#

GIMP works great

Posted by: Administrator on July 07, 2006 12:22 AM
I tried several methods and it seems like GIMP is the best if you don't mind to get the final result as a raster image.

Anyways... PDF sucks. I wish some sort of SVG format was there to replace PDF as well as HTML/CSS. Also, DjVu is so much more professional than PDF but... marketing rules, right?

#

PDFedit - linux pdf editor

Posted by: Administrator on September 17, 2006 08:37 PM
Try this linux editor from <a href="http://pdfedit.petricek.net./" title="pdfedit.petricek.net">http://pdfedit.petricek.net./</a pdfedit.petricek.net> You can either dig in raw pdf objects with the user friendly interface with lots of help, or you can use graphical features that are enough for every day pdf editing (text delete/add/edit, striking-through, highliting of text, text movement, text extracting, drawing of rect, arrows, lines,<nobr> <wbr></nobr>...). It is based on qsa scripting so fully automated operations can be easily written and distributed.

#

Re: PDFedit - linux pdf editor

Posted by: Anonymous [ip: 208.117.60.204] on August 20, 2007 05:34 AM
Too bad the entire site is in Polish, and I therefore cannot find instructions on how to make the config script work under Kubuntu.

#

Re(1): PDFedit - linux pdf editor

Posted by: Anonymous [ip: 146.133.1.43] on September 20, 2007 01:47 PM
here is the deb file: http://www.getdeb.net

#

Re(1): PDFedit - linux pdf editor

Posted by: Anonymous [ip: 204.185.27.10] on October 29, 2007 06:25 PM
The entire site isn't in polish now if it was even then. It actually looks pretty promising.

#

Re(1): PDFedit - linux pdf editor

Posted by: Anonymous [ip: 80.144.176.51] on November 30, 2007 03:29 PM
that's czech, not polish ;)

#

pdf editing in Linux

Posted by: Administrator on May 29, 2007 02:00 PM
Re: PDF Mark up.
Adobe reader lets you mark up but not save. just fill in the pdf with your info, p Alt+PrintScreen and touch it up with the Gimp in seconds and Print to desired apge. Voila!

#

Re: pdf editing in Linux

Posted by: Anonymous [ip: 24.41.63.13] on October 02, 2007 04:33 AM
or print to file. . . then you get a .ps

#

A killer app: PDF Editor

Posted by: Anonymous [ip: 189.70.185.114] on October 26, 2007 08:27 PM
http://www.wikihow.com/Edit-PDF-Files-in-Linux
Thanks, but
this one worked out better for me.

#

A killer app: PDF Editor

Posted by: Anonymous [ip: 169.237.66.234] on December 08, 2007 08:51 PM
pdfedit drives me crazy. No undo, you can't just make a big text box and write multiple lines (you have to start each new line as a new text box!), and it becomes incredibly slow after I've filled in the first few blanks.

so far flpsed has been the most reliable option for me. Thanks all for the opinions though.

#

A killer app: PDF Editor

Posted by: Anonymous [ip: 62.1.143.201] on February 26, 2008 09:31 AM
Save yourself the trouble of jumping through all those hoops by using
http://www.pdfescape.com/
Give it a try.

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya