How to edit pdf files in linux using gimp

How to edit pdf files in linux using gimp

Ivan Cook

Protecting intellectual property rights is one of the reasons why the Portable Document Format (PDF) is very popular when disseminated articles, magazines, books etc. if these were to be sold or sent in unprotected formats, then there would be a lot of fraud over intellectual property rights if the authors of these materials. One would simply pluck a book from the Internet, change author information and then claim it is his or hers, and start selling it to people. This is why you should protect your PDF file with a password and also issue a digital signature on the document. Microsoft PDF editor is a tool that can be used to edit PDF files that have permissions to edit. It can also be used to update some of your own material.

  • Part 1. How to Edit PDF with the Alternative to Microsoft PDF Editor
  • Part 2. How to Edit PDF with Microsoft PDF Editor
  • Part 3. Microsoft PDF Editor vs PDFelement in Editing PDF

Part 1. How to Edit PDF with the Alternative to Microsoft PDF Editor

The Best Microsoft PDF Editor Alternative

PDFelement ProPDFelement Pro is a powerful PDF editor that brings along the true nature of creating a PDF document for yourself. You can start of by inserting a blank page and then adding some text and images to it, and you are on your way to creating your own PDF file. You may also import PDF files and edit them on the tool. You can also change the orientation or placement of pages. Basically this tool allows you to edit every element of the PDF file. As an added measure, you can append our digital signature to your PDF document for tracking purposes, or protect it by using a password.

Steps to Edit PDF using Alternative to Microsoft PDF Editor

Step 1. Import PDF files

Use “Open File” and then go to where you have saved your PDF file. You can use the Finder to drag the PDF file into the PDF editor. On the user interface you will see the pages and you can select which ones you want to edit.

How to edit pdf files in linux using gimp

Step 2. Edit PDF Texts

Find the text tools that are found under the “Edit” panel. To add more text, click on “Add text”. Select the text content with the text selection tool and you can delete it easily. Choose the font, style and color on the panel found to the right of your window.

How to edit pdf files in linux using gimp

If you want to add links to the PDF files, you can open the “Edit” menu and click on the “Link” button. Then you will open the toolbar on the right side of the main interface, select action such as “Go to a page view” and click on the “Add” button to add links to your PDF files easily.

How to edit pdf files in linux using gimp

Step 3. Edit PDF Pages

You can get all the page editing tools under the “Page” panel. If you want a blank page, click on “Insert” and then click “Blank page”. Delete pages by going to the “Page” panel and then clicking on the “Delete” icon and then typing in the page range. You may do the same by selecting the page thumbnail and then clicking on the “delete” Icon.

How to edit pdf files in linux using gimp

Note: Please remember to save the document immediately to effect the changes in PDF files.

Why Choose PDFelement to Edit a PDF Document

PDFelement ProPDFelement Pro is a capable PDF editor that makes it very easy to create a new PDF document from another or others. With this tool, editing the text and images of a PDF file is quite straightforward. You can also edit linked and highlight text through annotation so your readers can pay more attention to certain parts. This is a tool that can secure PDF files through passwords and Digital Signatures. You can change the permissions of the PDF file.

The main features of PDFelement:

  • Scan printed documents and OCR scanned PDF files to make them editable on your computer.
  • You can add a digital signature and ID to your PDF files.
  • Create your custom PDF forms and also edit and fill out others.
  • Convert other files to PDF or create your own PDF documents from scratch.

How to edit pdf files in linux using gimp

Part 2. How to Edit PDF with Microsoft PDF Editor

Microsoft Word 2013 enables you to open an PDF document, modify it and then resave it back to the PDF format without using Acrobat. Here we will show you how to edit PDF with Microsoft PDF Editor.

Step 1. Open PDF File and convert

Go to “File” then “Open” and then select the PDF file you want to edit. You will get a dialogue box that will ask if you want to convert the PDF into editable word document.

How to edit pdf files in linux using gimp

Click on “OK”. The conversion will take a while and some of the graphics will end up in the wrong place.

Step 2. Edit and save the new file

Once the conversion process has been completed, you can now edit the content of the file. You may edit text and images only. You may also highlight text using the highlight tool. After you are done with editing, you can choose to save the document as PDF once more.

How to edit pdf files in linux using gimp

Troubleshooting on Editing PDF with Microsoft PDF Editor

1. Word and forms –The Microsoft PDF editor does not import PDF forms properly. This is because of some of the functions that may be included in the forms. To go around this, you had better create your forms in Microsoft and then save it as PDF rather than try to edit an existing PDF form.

2. Complex forms issue resolved – If you want to convert a complete PDF form to Microsoft PDF Editor, then you should use a plug-in called Nitro. This has been found to import PDF forms to Microsoft with most of the data intact and in the correct places.

3. Page numbers appearing even when not required – At times when you import a PDF file you will find page numbers appearing where they should not be. This can be quite annoying. You can go around this by selecting the page numbers and then turning their font color to white.

4. Garbled text – You will sometimes find the font is garbled after you import the PDF file. This is a common font issue especially if the PDF file had embedded fonts. Simply select the garbled text and give it a new font.

5. Image in the wrong places – You might find images ending up in the wrong places. You should ensure that you use the text wrap feature to rectify this issue.

It’s nice of the organizations and the government to provide online PDFs of their forms, but filling them out, especially in any size but US Letter size, is a pain.

One way to do it is to fill the form out online. Your mileage may vary, but when filling out something important like a trademark application, I like to take my time, repeatedly read over what I have, and ask questions. On at least one occasion I’ve taken a week to fill out a trademark application, even though it’s probably 400 words at the most. Such careful and slow work isn’t compatible with web forms, especially when a lot of government “fill it out online” forms won’t let you save partial work.

Another way may be to purchase Adobe Acrobat. I’ve heard it through the grapevine that Adobe Acrobat lets you modify PDF files to your heart’s content, always assuming they’re not DRM’ed. But if you’re a Free Software kinda guy, you’re looking to do it with free tools on your Linux machine. That’s what this web page is all about.

Here’s the basic process:

  • Open the PDF as separate images in Gimp.
  • Save each created image as an .xcf file, numbered consecutively. For instance, if you GIMP a 12 page PDF, you’ll name the created images p01.xcf through p12.xcf.
  • For each page that you’ll be changing, add a transparent layer called “writing” right on top of the background. Then put any text on top of the “writing” layer, which protects the background (the scanned image), from alteration.
  • If any pages need a signature in the finished PDF, see the Scanning and Using a Signature article.
  • When you’re done editing all the pages, convert them all to TIFF files.
  • Use tiffcp to put all the TIFF images into one.
  • Use the tiff2pdf program to create the new PDF file.
  • Download a 1040 tax form: wget http://www.irs.gov/pub/irs-pdf/f1040.pdf .
  • Import the PDF into Gimp, as 1 .xcf file per page:
    • gimp f1040.pdf. A dialog box appears.
    • Change the “Open pages as” dropdown to “images” so that each PDF page becomes a separate image.
    • Click the Import button. Images will open for each page.
    • Save the files as p01.xcf and p02.xcf for pages 1 and 2 respectively.
  • Modify the Pages
    • On each page:
      • Rightclick->Dialogs->Layers
      • Click the “new layer” button ( ) on the layers list and create a transparent layer called “writing” above the numbered layer, which is really the background. The number is the page number of the original.
    • Click on p01.xcf and zoom it until you have room to work.
    • T for the text tool. Type in your first name and initial. DO NOT close the text entry box.
    • Click the image window and then Ctrl+B to bring the toolbox to the forefront.
    • Doubleclick the Text tool icon ( ).
    • Select a truetype font (you want something readable in the Windows world). I suggest Arial Bold unless it involves little boxes for each letter, in which case I’d recommend Courier New Bold. Then change the size until you have something appropriate for the form.
    • Type in the text, and readjust the size if necessary.
    • On page 2, in the box labeled “Federal income tax withheld from Forms W2 and 1099”, type in $10,000.00. Make sure that you type that ABOVE the “writing” layer, not below it.
    • Save both pages.
  • Convert back to a PDF
    • Save them again, this time as p01.tif and p02.tif.
    • Do this command: tiffcp p01.tif p02.tif p.tif
      • The preceding combines both pages into a single tiff file
    • Do this command: tiff2pdf -p letter -o p.pdf p.tif
      • The preceding converts the tiff file to PDF, and specifies that the intended paper size is letter. Other paper size choices are legal and A4.
    • Use a PDF reader to verify that you have a 2 page PDF 1040 tax form containing the changes you made on each page.

x

There’s a special place in the land of the devil reserved for organizations and governmental entities whose forms are legal sized (8.5 x 14). Very few people have legal size paper on hand, and a single ream of legal sized paper costs nine bucks — almost double the price of letter size. Many printers can’t print this size at all. Those that can often don’t have a legal sized tray attached, so all trays must be pulled out and the legal paper fed manually. Normal image handling commands often don’t work with legal sized papers. My experience tells me that using legal sized forms doubles the work, but nevertheless sometimes you have to do it. When you do, here’s how.

Your mileage may vary, but I was not able to produce a PDF which could be printed with a simple lpr command:
The preceding command causes part of each page to be cut off. Instead, I had to specify the paper size in the lpr command:
The preceding command works well, but of course you can’t expect the drones at the organization or governmental entity to run that command (even if they had Linux, they probably wouldn’t know how to). So instead, let them know they can print the document from Acrobat Reader by:

  1. Page scaling = none
  2. Auto rotate and center = yes (probably)
  3. Properties button->Page Size = legal

The preceding are all set from the dialog box that pops up after File->Print from within Acrobat reader. Note that the recipient may be using a different version of Acrobat Reader, so the properties might be accessed a little differently, but scaling, center and size have long been a part of Acrobat Reader, so the recipient will probably know how to set these if he or she is in the business of receiving PDFs to print.

How to edit pdf files in linux using gimp

Audrey Goodwin

2021-06-25 11:38:56 • Filed to: Knowledge of PDF • Proven solutions

One of main advantages of using Linux PDF editor is that it’s open source and totally free to use. It works well with most hardware specifications. Linux does not come with a built-in PDF viewer or editors, so to edit PDF on Linux, you will need a third party program on your computer. Most of the PDF editors for Linux are free of cost and do a very good job. However, there are other options to edit PDF files on Linux which may cost you a bit more, but will also provide more features than free versions. Here are three different ways to edit PDF files on Linux.

The Best PDF Editor for Windows and Mac

Most of these PDF editors are only available as Linux PDF editors, while Windows and macOS users have hundreds of applications a their disposal. One such application is PDFelement, which is a perfect PDF editor which will let you edit images, text, links or even pages of a PDF file.

How to edit pdf files in linux using gimp

Users can also annotate PDF files with comments, sticky notes or highlighting features for text. It also embeds professional features like OCR, which is necessary to convert scanned PDFs into editable text. After performing OCR, you will be able to edit scanned PDF files on your computer. Lastly, it is also a converter which will let you convert PDF files into multiple other formats with different options such as; you can select the pages that you want to convert or perform the OCR feature on converted files.

3 Best Tools for Editing PDF on Linux

1. Edit PDF on Linux using Master PDF Editor

Master PDF Editor is one of very few PDF editors on Linux which come in both a commercial and professional version. The pro version will cost you $49.99 while the individual version can be downloaded and used for free. This program has a great user-interface as compared to other programs. Here’s how to use it:

How to edit pdf files in linux using gimp

  • Open Master PDF Editor on your Linux computer. Import your PDF file into the program. You can go to “File > Open” and select the PDF file that you want to edit.
  • Once the PDF file is opened, you can edit different aspect such as text or images of the file as shown in the screenshot below. You can either add text or add new images in the PDF file.

2. Edit PDF using GIMP on Linux

GIMP is one of the most famous Linux master PDF editor programs. It can also edit image PDF files. You can only edit one page at a time using GIMP and after completing the task, you will have to save the PDF in GIMP. Here’s a detailed guide on how to download and use GIMP for PDF editing on Linux.

How to edit pdf files in linux using gimp

  • First, download GIMP from its official website. It does not require any coding and can be installed quickly on your computer.
  • Launch GIMP on your computer and drag and drop your PDF file into the program. You can also use “File > Import”. One important thing to note is that GIMP will recognize each PDF page as a separate Image.
  • Now, you can make changes to your PDF file just as you would an image in GIMP.
  • You cannot directly save the files in PDF format, so, you will have to save the recently edited PDF file in GIMP format and close the program.
  • Launch the converted files in the “Krita [Download Link]” on your computer and click on “File > Print”.
  • The last step is to save the PDF file from the printing page. Click on the “print” button again to save the PDF file on your computer.

3. Step by Step Guide to Edit PDF with LibreOffice on Linux

LibreOffice is another free tool to edit PDF files in Linux. It is a complete suite to work with most office files. The user-interface is much better in comparison to Master PDF editor and it is easy to use. Follow these steps use this PDF editor for Linux:

How to edit pdf files in linux using gimp

  • Download and install the program on your computer. On the main interface, click on the “Open” buton and select your PDF file.
  • Unlike most programs, it will let you edit the images of your PDF file first. Afterwards, you can edit any text present in the PDF file. Simply double tap on the text and modify the text.
  • After making changes, you will have to export the PDF file from the program. Click on the “Export to PDF” button which is present right on the main panel of the program.

We find LibreOffice to be the best PDF editor for Linux as it is extremely easy to use. Alternatively, are you looking to find a suitable PDF editor to edit PDF files on Windows? There are various free PDF editor programs on the market that will help you with all of your PDF editing needs.

Gimp is normally used to create or manipulate images files, but can also work with PDFs if you understand how it works and what it’s limits are.

If you’ve never used Gimp—a free image editor available for GNU/Linux, OS X, Windows and other operating systems—you might be quite surprised by its capabilities

I use it for everything from Facebook posts when the available backgrounds don’t work well for what I want to say to political buttons that I design and press out using a button-making machine.

Gimp can do everything from resizing and cropping images to adding text, changing colors or distorting images in artistic ways. You can use it to draw with its pencil or paintbrush and layer additional images. It’s quite a versatile tool. Yet I only recently noticed that it can also be used to manipulate PDF files, not just the many types of image files that most people use it to create, modify or enhance.

Why Gimp?

It might not be obvious why you’d want to modify PDFs using Gimp, but it can do some interesting things. Even though PDFs normally contain a lot of text and maybe some images, there are a number of ways that you can work with them using Gimp. For example, you can:

  • Turn a PDF into a series of image files (one per page)
  • Delete specific pages
  • Add some new pages
  • White out or replace select portions of pages
  • Add notes or images
  • Reverse the order of the pages
  • Break a PDF into separate PDFs—by chapter, for example

It’s important to understand that editing PDFs using Gimp means you are modifying page images, and this is something that you need to fully grasp before you get started.

In addition, you need to know a few tricks about how Gimp works before you try using it to manipulate PDFs.

Opening your PDF

Once you’re ready to try using Gimp to make changes to a PDF, here’s how to start:

First, open Gimp.

Next, when you go to open a PDF using Gimp, you need to decide whether to open its pages as separate images or as a group of layers, which are portions of a single image.

This choice makes a big difference. If you plan to export the modified document as a PDF, you need to open it with the “Open pages as layers” option, which is the default. Once the document is open, you should see each page displayed as a layer in Gimp’s layers panel. If you don’t, try selecting Windows -> Dockable Dialogs -> Layers and it should appear. Don’t be surprised when a 100-page PDF ends up with 100 layers. That’s the way it works.

Select your file (e.g., Win_at_Sudoku.pdf) by selecting Open… under the File menu, selecting the PDF you want to open and then clicking on Import at the bottom right. Alternately, you can go directly to the File -> Open as layers… option and choose the PDF file.

In the panel that opens, you can change the page size and select the page range or just go with the defaults, which select all pages using 700×925 pixels. Then click on “Import” at the bottom right.

In the Layers panel, you will then see a list of the layers with small images of each one and “eye” icons on the left of each layer that controls whether the layers are visible, though the active (first) page will be the one that is displayed.

Making changes

To work on a single page, click on the image of that layer from the layers panel to make it the active layer and click on (sometimes referred to as “unclicking”) the eye icons for the other images so that they are no longer visible. You will then be able to draw on the selected page or add text to it. If you add text, you will be creating a new layer, but you can to use the “Merge visible layers” option to turn the two or more layers back into a single layer when you are ready. Since the other layers should not be visible at that time, they will not be affected.

Also note that if you don’t merge layers of text that you add they will end up as separate pages when you export your modified PDF.

Removing pages

You can remove pages in any of three ways. You can make them invisible before you save the new PDF; you can select multiple pages (and no others) and use the “merge visible pages” options to reduce them to only the first page in the list; you can simply click on them and select “delete layer”.

Adding pages

You can add pages to your document by adding layers and sliding them into the proper position in the document by clicking on them and then using the up and down tools shown at the bottom of the layers panel to move them into the correct location.

You can add text and images to new layers. Just remember to have no other pages visible when you merge the added layers and the associated text layers.

Saving your changes

When you are ready to export the modified file, make sure that all of the layers you want to retain are visible (eye icons displayed) and select File -> Export As… using .pdf as the file extension for your new document. As explained earlier, if you want to omit any pages, make sure they are not visible by clicking on (“unclicking”) the eye icon. Make sure you export with “layers as pages” so you don’t end up with a single page (all pages merged into one). Select these options for the export:

  • Layers as pages
  • Reverse the pages order
  • Apply layer masks before saving
  • Omit hidden layers and layers with zero opacity

Your “Layers as pages” option may also say “bottom layers first”. If so, this will change to “top layers first” once you click on the “Reverse the pages order” option.

Turning a PDF into a group of images

If you open a PDF as separate images rather than layers, you can save each page as an independent PDF or as a separate image. Gimp will create the files using whatever file extension you select. So, just use the appropriate file extension and Gimp will do what’s needed. You will, however, have to save each page separately.

Wrap-Up

Gimp can be handy for making a number of changes to PDF files, but because it works with images, it’s not the best tool for inserting or modifying a lot of text. For that, you’re much better off using a PDF editor. Please keep in mind that you should get used to this process before using it on important files or, better yet, always keep a copy of the original file so that you can start over again if you make a mistake.

Sandra Henry-Stocker has been administering Unix systems for more than 30 years. She describes herself as “USL” (Unix as a second language) but remembers enough English to write books and buy groceries. She lives in the mountains in Virginia where, when not working with or writing about Unix, she’s chasing the bears away from her bird feeders.

This article will be showing you how to convert the pages of a PDF document to image files (PNG, JPEG, and others) using the GIMP tool in Linux.

GIMP is a free, open-source, fully-featured image editing tool, available for Windows, Linux, Mac OS X, and other platforms. It can export pages of PDF documents to various image formats, including PDF, JPEG, TIFF, BMP, and many others.

These instructions explain how to use GIMP to convert PDF for those that prefer to use a graphical application to accomplish the task. GIMP exports PDF pages one by one therefore requires a plugin to export all pages automatically.

First of all, if you don’t already have GIMP, you will need to install it using our following article:

On Fedora distribution, you can install GIMP, simply using the flatpak or snap as shown.

Once installed follow the instructions below.

Convert PDF to Image using GIMP in Linux

First, we will start by converting one or a few PDF pages to PNG. This does not require adding any plugins to GIMP.

Click on the GIMP File menu, select Open, and choose the PDF file you want to convert. You will see an ‘Import from PDF’ dialog box. Set the Open pages option as Layers, and select Import.

Import from PDF in Gimp

In the GIMP layers dialog, scroll to the page you would like to convert from PDF to image. Drag the selected page with your mouse cursor to the top so it’s the first layer.

PDF View in GIMP

Next, click on the GIMP File menu, and select Export As. Now you can change the filename extension to the preferred image format by editing the name field at the top of the export dialog or click Select File (By Extension) at the bottom of the dialog.

Convert PDF to Image in GIMP

You can also select where you wish to save your image on your computer in the Save in Folder section at the top of the dialog. Finally, click the Export button to save the file in the image format that you chose.

GIMP will pop up a dialog to make changes to your images such as compression level and image quality.

Image Compression Level in Gimp

Hopefully, you can now convert your PDF docs to images in Linux using the GIMP application.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

We are thankful for your never ending support.

It’s nice of the organizations and the government to provide online PDFs of their forms, but filling them out, especially in any size but US Letter size, is a pain.

One way to do it is to fill the form out online. Your mileage may vary, but when filling out something important like a trademark application, I like to take my time, repeatedly read over what I have, and ask questions. On at least one occasion I’ve taken a week to fill out a trademark application, even though it’s probably 400 words at the most. Such careful and slow work isn’t compatible with web forms, especially when a lot of government “fill it out online” forms won’t let you save partial work.

Another way may be to purchase Adobe Acrobat. I’ve heard it through the grapevine that Adobe Acrobat lets you modify PDF files to your heart’s content, always assuming they’re not DRM’ed. But if you’re a Free Software kinda guy, you’re looking to do it with free tools on your Linux machine. That’s what this web page is all about.

Here’s the basic process:

  • Open the PDF as separate images in Gimp.
  • Save each created image as an .xcf file, numbered consecutively. For instance, if you GIMP a 12 page PDF, you’ll name the created images p01.xcf through p12.xcf.
  • For each page that you’ll be changing, add a transparent layer called “writing” right on top of the background. Then put any text on top of the “writing” layer, which protects the background (the scanned image), from alteration.
  • If any pages need a signature in the finished PDF, see the Scanning and Using a Signature article.
  • When you’re done editing all the pages, convert them all to TIFF files.
  • Use tiffcp to put all the TIFF images into one.
  • Use the tiff2pdf program to create the new PDF file.
  • Download a 1040 tax form: wget http://www.irs.gov/pub/irs-pdf/f1040.pdf .
  • Import the PDF into Gimp, as 1 .xcf file per page:
    • gimp f1040.pdf. A dialog box appears.
    • Change the “Open pages as” dropdown to “images” so that each PDF page becomes a separate image.
    • Click the Import button. Images will open for each page.
    • Save the files as p01.xcf and p02.xcf for pages 1 and 2 respectively.
  • Modify the Pages
    • On each page:
      • Rightclick->Dialogs->Layers
      • Click the “new layer” button ( ) on the layers list and create a transparent layer called “writing” above the numbered layer, which is really the background. The number is the page number of the original.
    • Click on p01.xcf and zoom it until you have room to work.
    • T for the text tool. Type in your first name and initial. DO NOT close the text entry box.
    • Click the image window and then Ctrl+B to bring the toolbox to the forefront.
    • Doubleclick the Text tool icon ( ).
    • Select a truetype font (you want something readable in the Windows world). I suggest Arial Bold unless it involves little boxes for each letter, in which case I’d recommend Courier New Bold. Then change the size until you have something appropriate for the form.
    • Type in the text, and readjust the size if necessary.
    • On page 2, in the box labeled “Federal income tax withheld from Forms W2 and 1099”, type in $10,000.00. Make sure that you type that ABOVE the “writing” layer, not below it.
    • Save both pages.
  • Convert back to a PDF
    • Save them again, this time as p01.tif and p02.tif.
    • Do this command: tiffcp p01.tif p02.tif p.tif
      • The preceding combines both pages into a single tiff file
    • Do this command: tiff2pdf -p letter -o p.pdf p.tif
      • The preceding converts the tiff file to PDF, and specifies that the intended paper size is letter. Other paper size choices are legal and A4.
    • Use a PDF reader to verify that you have a 2 page PDF 1040 tax form containing the changes you made on each page.

x

There’s a special place in the land of the devil reserved for organizations and governmental entities whose forms are legal sized (8.5 x 14). Very few people have legal size paper on hand, and a single ream of legal sized paper costs nine bucks — almost double the price of letter size. Many printers can’t print this size at all. Those that can often don’t have a legal sized tray attached, so all trays must be pulled out and the legal paper fed manually. Normal image handling commands often don’t work with legal sized papers. My experience tells me that using legal sized forms doubles the work, but nevertheless sometimes you have to do it. When you do, here’s how.

Your mileage may vary, but I was not able to produce a PDF which could be printed with a simple lpr command:
The preceding command causes part of each page to be cut off. Instead, I had to specify the paper size in the lpr command:
The preceding command works well, but of course you can’t expect the drones at the organization or governmental entity to run that command (even if they had Linux, they probably wouldn’t know how to). So instead, let them know they can print the document from Acrobat Reader by:

  1. Page scaling = none
  2. Auto rotate and center = yes (probably)
  3. Properties button->Page Size = legal

The preceding are all set from the dialog box that pops up after File->Print from within Acrobat reader. Note that the recipient may be using a different version of Acrobat Reader, so the properties might be accessed a little differently, but scaling, center and size have long been a part of Acrobat Reader, so the recipient will probably know how to set these if he or she is in the business of receiving PDFs to print.

I had to print a couple of PDFs recently to send to someone, but I wanted to redact (black out) a couple small bits of text.

A quick google search didn’t turn up any tools for this specific purpose, so I fell back to imagemagick & gimp:

  • convert document.pdf document.png
  • gimp document-0.png
  • (use paintbrush to black out text)
  • print redacted page from gimp
  • print remaining pages from xpdf

The problem with this strategy is that the conversion process (from PDF to PNG or whatever other format) loses quality. I tried editing the PDF in gimp but it didn’t work right away.

Is there a specific tool that permits redaction in this way? (It doesn’t even need to be “real” redaction — I’m not sending a softcopy so “fake” redaction will work because the hardcopy can’t be hacked to reveal the underlying text.)

Or, is there a trick to being able to edit PDFs in gimp?

16 Answers 16

(originally I recommened Okular but it didn’t work as I expected)

1. Edit the document in a vector editor

I was able to open a PDF file in Inkscape, draw a rectangle over a piece of text and print it out. Inkscape is a vector editor so no rasterization involved. Some fonts looked wrong though – probably because the document was created on Windows machine with fonts which are absent on mine.

Note that any method that does not involve rasterization is only acceptable if you’re going to print the redacted document on paper and not distribute it electronically, as the text still can be retrieved from under blackouts.

2. Increase the rasterization resolution when opening in a bitmap editor

Regarding “quality loss” when opening the page in Gimp: you can directly open a PDF file in Gimp. It will be rasterized in the process. The amount of quality loss in the process is a matter of resolution you choose when importing – 300 dpi should give you a very decent quality (the default is 100).

You can also get good results with ImageMagick’s convert command if you tell it to increase resolution:

You can use Okular.

  1. Open the pdf with Okular.
  2. Press F6 .
  3. Press 8 .
  4. Highlight the text you wish to redact.
  5. Right click the text, select properties, select the “Type” as “Highlight”, press Ok .
  6. Print the file to a pdf (check “Force rasterization” to make sure the redacted text is removed from the resulting file).

Basically what you are trying to do is highlight/annotate a PDF, but with some flexibility towards marker opacity and colour (you mentioned you don’t need to censor/remove something, merely redact). Have you taken a look at answers here: How can I highlight or annotate PDFs?

One of the highest rated answers recommends Xournal, which has not been mentioned here and would be my weapon of choice. It is a tool that allows you to make handwritten notes but has extra features allowing you to annotate a PDF. By default it’ll save your annotations as a separate file but also allows you to export the annotated PDF as a new PDF. This should maintain the layout, fonts, etc.

With Xournal you’d choose “Annotate PDF”, then use a solid black marker to mask the parts you want to redact, and “Export to PDF”.

There are some stories on the internet suggesting that Xournal rasterises the text in the exported PDF (thanks for pointing this out, MHC). This does not seem to be true: with simple annotations, the text remains selectable and searchable and the file size does not increase by much (it increased from 205 kb to 220 kb in the example below).

To install, run in a terminal: sudo apt-get install xournal or just select it from the Software Centre

Aug 23, 2017
Comment

The PDF file format is a real pain. It’s non-linear, and difficult to easily manipulate. Unfortunately, it’s also the preferred format for online documents and forms which means you have to use it whether you like it or not. Sometimes you’ve got to fill out or edit a PDF file and that’s that. So, how do you do edit a PDF on Linux without using Adobe’s proprietary Acrobat app? Here are 5 apps that let you edit a PDF on Linux with little to no hassle.

1. PDF escape

PDF escape is a really handy PDF editor that doesn’t require any downloading at all. Instead, users can use this tool directly from the web, in any major web browser. This tool is probably the best one to turn to when you need to fill a PDF form or do some basic editing. Just drag any PDF into the “drop here” section, and upload it. Then click the “upload” button. After that, you’ll be able to manipulate any PDF right in the browser. PDF Escape lets you add annotation, create PDF files, and password protect a PDF file.

How to edit pdf files in linux using gimp

2. Master PDF Editor

Master PDF editor is a paid PDF editing tool for Linux, Mac OS and Windows. If you’re a Linux user in serious need of high quality PDF editing features, you may want to consider this app. Like most PDF editing tools, Master PDF Editor supports full PDF editing (text, images and everything). However, it also allows users to convert XPS files into PDF files, add controls, checkboxes and lists to PDFs, supports exporting individual pages into various image file formats, a powerful PDF font editing tool and more.

There’s no question that Linux users who do serious work with PDF files should consider this app. It’s a bit of a bummer that it costs money, and isn’t open source, but the features make it worth the $49.99 for the full master version.

How to edit pdf files in linux using gimp

3. Scribus

Scribus is a publishing app for Mac, Windows and Linux. With it, users can design a multitude of documents, images, flyers, etc. For the most part, those looking to edit PDF files might not think Scribus is useful, but it is, as it supports basic PDF editing. With this tool users can easily create PDF files, add controls, lists, and other form features. You can also create “animated” and “interactive” PDF documents.

As a desktop publishing software, Scribus doesn’t have a huge focus on PDF documents. That said, if you need to do some basic editing, Scribus is free and gets the job done.

How to edit pdf files in linux using gimp

4. Libre Office

If you’re not really that invested in the PDF format, but need to be able to make a quick edit here and there, you’re in luck: each and every Linux user already has a decent PDF editor: Libre Office Draw. For the most part, Draw isn’t meant to edit PDFs and other such documents. Instead, Draw is used to create flowcharts, sketches, graphics, diagrams, etc.

That said, you can make edits to any existing PDF file with the Libre Office Draw tool. There’s no need to import the file. Instead, just click “File”, and open the PDF like any other file and make your edits. Additionally, Libre Office Writer can export documents created in the PDF format. The Writer App can do basic editing too.

Libre Office’s support for PDF editing is very, very primitive. It can fill out forms, and do basic edits but it’s really only useful if you’ve run out of options and have no other way of editing a PDF document. If you’re in need of doing some serious editing, it is best to refer to something like Master PDF Editor, or even Scribus.

How to edit pdf files in linux using gimp

5. Gimp

Ever wanted to recompile a PDF document? With the Gimp image editor, you can. Unfortunately, the only editing that can be done with Gimp is primitive. Users can import any PDF document into the image editor, and turn them into layers, like any other project. From here, anything is editable and exportable. This means that it is very easy for users to convert a PDF document into something a little more Linux-friendly.

Gimp is best used when you don’t care about the PDF itself, and you just want to extract the contents. It’s not great for any other use-case.

How to edit pdf files in linux using gimp

Conclusion

The PDF format, though useful in professional settings is a bit of a pain. It requires special tools to open these files, and edit them too. As open source fans, Linux users tend to avoid this document format. That said, if you absolutely have to interact with a PDF, do choose one of the solutions on this list. It’ll make the experience a little more bearable.

1 Comment

PDF-Shuffler is a great little Python app. It lets you move, split, rearrange, delete, rotate and crop pages in pdf files. It has a nice clean interface and is easy to use. A definate must have for working with the pdf format.

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.