Introduction

Before knowing exactly how to code things to make them work, a conceptual introduction is necessary before using any type of addon. That being said, understanding at a broad level how PDF Core works is important before considering how to specifically code it's functions.

What is PDF Core?

PDF Core is an addon, which heavily uses TCPDF, and essentially assists the FW Apps in anything that has to do with saving, uploading, or downloading PDFs.

How does it work, conceptually?

PDF Core primarily uses the PHP $_FILES variable or other methods to receive a formatted pdf file, and then saving it for future downloading. In contrast to Image Core, any PDFs "uploaded" to the server in this way are saved within the content folder of that app for that specific website domain. This means that websites from on different domains, such as a backup website, even though they share a database, will not have access to the files uploaded on the other domain.

Parts of this documentation

There are not very many uses for PDF Core currently in the apps, and PDF Core is fairly limited in its scope of what it can do. That being said, there are a couple of things we still need to discuss.

There are currently three main ways that one can "generate" a PDF file in order for it to be saved on the server folder. Unfortunately, PDF Core is highly integrated between both the clientside (to actually get the files) and the serverside, so each of these guides teach you how to do both the clientside and the serverside aspect of each type of upload. These are the three ways to upload a pdf to the server folder:

  • Upload an Existing File - This discusses the basics of taking a file from your computer and uploading it to the contents folder and deleting files from the folder that have been previously uploaded.
  • Print PDF from HTML - This discusses the special topic of what to do to print a PDF from an HTML page
  • Design PDF using TCPDF - This discusses how to design and print a PDF using TCPDF and PDF Core.

Once the PDF has been uploaded to the server in one of these three ways, then you are able to view, download or clear the uploaded pdf in the same way, which is discussed here:

  • Different PDF Views - This is a brief note on the two different "views" that are available to be used for this app.

A Note About the Database

This will be entirely different depending upon the app, but it is probably helpful to have some way saved on the database that you have uploaded a pdf (either the name of the pdf or a boolean saying that a pdf has been uploaded). If you are making a "one time" PDF (for example for "printing" the page), then there is no need to save something to the database, but if you are going to need to access it later, usually, there needs to be something on the database saved so that you can access it. Because each app is completely different, how to set up the database will not be covered in this documentation, because this will change per app per instance.