Merge a writer document with a pdf

Discuss the word processor
Post Reply
Pedroski55
Posts: 40
Joined: Wed Aug 31, 2016 2:15 am

Merge a writer document with a pdf

Post by Pedroski55 »

Is it possible to merge a writer document with a pdf?

The situation is this:

1. I have a test for students. (This happens often.) It is only 1 page long. At the top I insert the Name and Student number from my class databases. I have 6 different classes.
2. I have a pdf generated by my multiple choice marking program. Each page contains Name and Student number and a barcode which identifies the student to the marking program and of course the question answer choices.

It would be good if I could take page 1 of my test paper, which has Name XXX and Student number YYY at the top, then insert page 1 of my pdf, which also has Name XXX and Student number YYY at the top, as page 2 of my writer document and so on. Page 2 of my document should become page 3 and page 2 of my pdf should become page 4 of the writer document and so on for the whole class.

We have a Brother printer which can print duplex. Print double sided, job done!

Of course, I can just print the writer document, turn the pile over then print the pdf. Sometimes my printer takes 2 pages at once, which messes everything up and I have to start from scratch. That is why I would like to integrate the writer document and the pdf, if it is not too difficult.

I can do simple things with Python, but I am not so hot.
Libre Office 5 on Ubuntu 16.04
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: merge a writer document with a pdf

Post by RusselB »

In my opinion. the hardest part of what you are requesting isn't related to Open Office, but rather the marking program that generates the PDF file.
Is there an option to get that to generate something (almost anything) other than a PDF file? If so, depending on what the other format(s) are, this could be very easy.
If there is no other option, then I'm out of my depth in this regard and (hopefully) someone more familiar with Writer will be able to make a suggestion.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
Pedroski55
Posts: 40
Joined: Wed Aug 31, 2016 2:15 am

Re: merge a writer document with a pdf

Post by Pedroski55 »

No other option, the output of the marking program is always pdf and it reads the answers as a pdf. It can take .png as answer forms, but then I would have a lot of files instead of 1 pdf.
I will tinker with Python, see what it can do!
Libre Office 5 on Ubuntu 16.04
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: merge a writer document with a pdf

Post by John_Ha »

You are using the wrong tool by trying to integrate in Writer.

Create a PDF from Writer and integrate as a PDF file using something like PDFsam (PDF Split and Merge) which allows you to manipulate pages in a PDF file by adding pages, deleting pages, splitting into pages and merging PDFs etc.

Another alternative is to take a snapshot of the PDF page (in Adobe Reader go Edit > Take snapshot > select the area to be copied ...) and paste (which forces a PNG file) the copied image into Writer.

Another is to ask the college to produce a .odt file (or a .doc etc) that you can use instead of a PDF. Or send the college your Writer document and ask them to do the merge.

Or create your Writer document as a PDF form and merge it with the PDF.

If this solves the problem, please view your first post in this thread and click the Edit button (top right in the post) and add [Solved] in front of the subject.

Incidentally, you present this as a classic XY problem. You want to do X but cannot. You guess a solution Y which you find does not work and is probably not a good idea. You then try to fix Y.

It is far better to say "I want to do X ..." and let us suggest the best way how to do it without being drawn down the dead end of Y. The saving grace is that you did also give us full details of what you want to do.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
musikai
Volunteer
Posts: 294
Joined: Wed Nov 11, 2015 12:19 am

Re: merge a writer document with a pdf

Post by musikai »

Pedroski55 wrote:No other option, the output of the marking program is always pdf and it reads the answers as a pdf. It can take .png as answer forms, but then I would have a lot of files instead of 1 pdf.
I will tinker with Python, see what it can do!
Are you using the marking program for reading the answers?
As far as I understood you are printing out the forms and give to the students. Do you then have to scan in all filled papers for the marking program to read?

Does your marking program create a PDF for each student? And you create a "Title-page" for each student? So to combine e.g. a writer PDF with the other PDF you would have to do that for each student?
Perhaps (I hope) there is a function to create a Titlepage directly in the marking program.
I think it would be possible to write a macro that can export your writer odt to PDFs and merge them with the corresponding marking PDF by running e.g. pdftk per commandline but that would need to be exactly programmed to work with corresponding file names.
Win7 Pro, Lubuntu 15.10, LO 4.4.7, OO 4.1.3
Free Project: LibreOffice Songbook Architect (LOSA)
http://struckkai.blogspot.de/2015/04/li ... itect.html
Post Reply