Score:11

How to edit a PDF file in LibreOffice Draw or LibreOffice Writer without corrupting it?

eg flag
UJM

I have a PDF file which I want to edit in LibreOffice Draw/Writer without corrupting it. Is there any way I can do it?

I have already installed the LibreOffice pdfimport plugin, yet the PDF file is getting corrupted with it. I just want to add an image in the PDF file after opening it with LibreOffice. I have been searching for how to do this for the last 4 hours and I am not able to find a way.

If it is not possible with Libreoffice, which software should I use in Ubuntu to add images in PDF files without losing their letter recognition capabilities?

Edit: I was trying to fill an application form, that's why I needed to edit the pdf file.

in flag
If the PDF is an application form, I'd check whether it contains some form markup. _If_ it does (the PDF author has to make sure of that), you should be able to open the PDF using a PDF viewer (like evince or okular) and just click into the form fields. If a text cursor shows up and you can type some text, you're good to go. In this case, you don't need a PDF _editor_, many (except the most basic) standard PDF viewers would suffice.
muru avatar
us flag
Does this answer your question? [Is there software that can fill PDF forms?](https://askubuntu.com/questions/29230/is-there-software-that-can-fill-pdf-forms)
Raffa avatar
jp flag
Does this answer your question? [Is there anything to read and hand-annotate a pdf like on paper on a touchscreen with stylus?](https://askubuntu.com/questions/1314172/is-there-anything-to-read-and-hand-annotate-a-pdf-like-on-paper-on-a-touchscreen)
Score:14
cn flag

PDF is not designed to be an editable format.

  • Importing in LibreOffice Impress causes the PDF objects to be converted to LO objects that match as best as possible. This inevitably leads to changes because of incomplete mapping and conversion between the objects in these fundamentally different file formats. These changes may be less or more disrupting depending on the PDF.
  • Importing in Gimp caused the PDF to be rendered in bitmap format. The looks are exactly the same, but an exported PDF will contain bitmap information. If vector objects were present in the original PDF, these will be lost.

Perhaps Xournal++ will suit your needs. You can add text, annotations and images to an existing PDF. The added content will be included as an additional layer, without changing the initial PDF data in any way.

Another way to add objects to an existing PDF would be to use command line tools. For example, pdftk with its stamp option allows to superimpose one PDF on another, useful for example to add page numbers, or eventually a graphic.

It is preferred, however, where possible, to work with source documents in the appropriate format for editing, and export the final version to PDF.

UJM avatar
eg flag
UJM
Thank you for your quick and kind answer. I am able to do it in Xournal.
RockPaperLz- Mask it or Casket avatar
bd flag
*PDF is not designed to be an editable format.* I'm curious, is there a source for this claim? I edit PDF files all the time without difficulty, but perhaps I'm doing things beyond what the creators of PDF ever imagined. Granted, learning how to do this was not trivial.
Andrew Henle avatar
cn flag
*PDF is not designed to be an editable format.* Absolutely not true. The [PDF specification itself (in PDF format itself, naturally...)](https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf) has this warning (bolding mine): "... this file can be printed or viewed but **shall not be edited**..." and also states, on page vii (again, bolding mine) "PDF ... fulfills a set of requirements ... including ... **collaborative editing of documents**..." LibreOffice is botching the editing.
sy flag
I often find that after importing a PDF into Libre Office the text overflows outside the page margins and is unreadable. I presume this may be some sort of font replacement issue but not sure how to address it. I've found out how to modify the styles to reduce the font size but I can't find how to **re-apply** those style changes to the whole document. A quick and easy solution is to use an on-line PDF editor. https://www.sejda.com/pdf-editor seems to be able to load and edit PDFs flawlessly which LO can't.
sy flag
Wow, stop press, Sejda has a free desktop app (limitations compared to paid version) with a `deb` Linux installer! Hooray, no more LO PDF editing problems (sad tho') https://www.sejda.com/desktop
Score:3
eg flag

which software should I use in Ubuntu to add images in PDF files?

Xournal

xournal screenshot

I've used it for years to sign documents using a transparent png and fill in fields. It's a little clunky, maybe, but it works very well. I think it was intended for use on tablets with a stylus to make drawings, but it supports "PDF Annotation" as well.

PDF Annotater is the category of software you want. There's probably other PDF Annotaters out there but Xournal works great! "PDF Editor" or how to edit PDFs will get you the sort of answers like "you shouldn't edit pdfs"

It's true that editing a PDF is kludgy and error prone, but its certainly not impossible. Usually, annotating is good enough. You can even mask areas with a white rectangle and provide different words or graphics. Just be aware that the original data is all still there, and often easily uncovered. It's fine though if you're the only one using the resultant PDFs.

Score:3
bm flag

If you asked your question today is it safe to assume that you installed LibreOffice 7?

In any case you can just open the LibreOffice main launcher (from which you can create a document, spreadsheet, Drawing, or whatever, or, open a file.

Forget any import plugins. Just open any pdf file and LibreOffice will open it in Draw. Your pdf file will open. You can change text, add images and crop and/or size the images, move stuff around with no problem.

I'm not sure what you mean about "corrupting" your file. I suggest that as soon as you open your pdf file with LibreOffice you do immediately a "File Save as" and add a suffix to the file name such as " rev 1" or today's date.

This functionality has been around in LibreOffice for many versions now.

Vanadium's suggestions of using Xournal++ or Gimp are good, however I have found Xournal++ is quite limited and, for example, can only open files of a certain size, last time I used it. Now Gimp, on the other hand, is a VERY powerful and sophisticated tool, and you may find it has a significant learning curve.

IMHO LibreOffice is the best middle-of-the-road choice as it's powerful and quite intuitive to use.

Now there are many pdf editing programs available for Linux, here's one list mentioning some of the items above:

13 Best PDF editors for Linux

I have purchased Master pdf Editor and have used it for several months now and it works very well including Digital Signature Certificates.

I'm considering purchasing Quoppa for better security.

UJM avatar
eg flag
UJM
thanks for your detailed answer. I am using the LibreOffice version 6.4.7.2 and my word "corrupt" meant letters get garbled/misplaced on the page or the layout of the page gets changed. Now it has been solved!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.