-1

I am currently working with a new website for my company and there is some functionality that I have some issue fixing. We want a page where you will find a list of filenames (like different types of manuals etc.) and basically a checkbox where you decide what files you want to merge together to one new pdf.

So, I am a web designer, not great at developing but I can not find any guidelines or help to achieve this.

How do I link my pdf's to the database and how do I create a new pdf (like in acrobat) from the ones I already have? If someone have any good edwice, I would be really glad.

Erik Kalkoken
  • 30,467
  • 8
  • 79
  • 114
Kuben
  • 19
  • 3
  • 2
    It depends on which database and architecture you are using. You could save the files in a disk or in the cloud and store their paths in the db. Anyways, your question is too broad to answer completely. Maybe this will help to get you started asking questions here: https://stackoverflow.com/help/asking – Matheus Lacerda Feb 06 '18 at 11:48

1 Answers1

1

Suggestion:

Save the path to your pdf's on the database. After that you'll need to query the pdf file path according to the files the user wants to merge (checkboxes), loop through the files and merge them using the for example pdftk tool, executing a command like this:

passthru('pdftk file1.pdf file2.pdf file3.pdf cat output mergedFile.pdf');

Then output mergedFile.pdf.

Also take a look at: Merge PDF files with PHP

Claudio
  • 5,078
  • 1
  • 22
  • 33