creating pdf forms from CMS based data on the fly - php

I am using modX cms, and would like to have administrators be able to create some form fields in a larger form (basically a label, and form elements of various kind) which is then made accessible to users as a PDF document which is to be downloaded, filled out, saved and sent to appropriate recipients via email as pdf.
The main difference to other similar questions is that i do not want to actually process the CONTENTS of a form and output a PDF, i want to generate a PDF which contains a FORM based on data [field names/types] found in a CMS.
The main purpose of the application is that forms have to be easily administrable, hence the integration with a CMS. Nothing speaks against using and writing custom code and/or libraries.
I would also consider an option of having a PDF which is able to send its results out by itself, but from what i've understood i'd have to purchase the adobe formbuilder package and that would raise the price too much.
Any hints on what libraries/approaches i could use?
Thanks

TCPDF is recommended
see also the link in the bottom on the wikipedia entry . There are a bunch of existing examples and plugins you could copy&paste from.

There's PDFlib, from which you can generate a new PDF from the ground up, or modify an existing one (including add forms). It is, however, fairly pricey, so if you can't afford Adobe's formbuilder, this is probably too expensive as well.

Related

Wordpress admin plugin to save hidden input data to database

I am creating a Wordpress plugin for the admin area. It needs to set options and write to a file and database based on the options that are saved.
I have tried creating a "Create File" button which sends POST data back to itself. I now need to create a file and add a column to the database based on a hidden boolean filed.
I'm struggling because I can't do what I want because the form needs to have a different action. Any advice on how to so this?
What a different action? Without any code examples that show what you're doing and what exactly is not working, we only can imagine and give you general info. In Wordpress, you don't have to care about naked url options cause the core will do this for you. Its enough to register the required hooks, read the passed data here and do what is required with them. Simple storing settings wouldn't require to extend the database scheme, since Wordpress already have a table for this. You could use the Wordpress functions here.
See the article of the Wordpress developers page: https://codex.wordpress.org/Creating_Options_Pages
Using the hooks, its no big deal to create a file too. Simple write your PHP code after saving the settings in the database. How you concretely do this depends on the requirements: Is the data passed as form field? Is it fetched from an external source (like api)? Depending on the requirements this should be done with relatively less work using a search engine, cause enough sample codes exists for those scenarios.

Best way to store and process user editable html templates

I am working on building a application where user gets a canvas(not html canvas, a work area) with many features.
For Eg:
User can add/edit/delete - text/image/shapes
User can move(drag)/rotate/resize elements.
Save their work.
And similar many features.
NOTE: Till now I have been storing the user template data in database as plain html. But I have a feeling that it is wrong what I am doing.
I want know what is the best approach to save & process their templates they create.

PHP Widget layout grid

I'm building a webapp which main purpose is displaying widgets on a display. These widgets have an variable size, so not every widget is even high or wide (But they are using standards like for example a grid system). Now I'm looking for the best way to save which widgets are used, and where they are placed. For example by using something like Gridstack the user can drag and place the widgets in an admin panel, but how should I save this? And how can I recall this and put in a empty Bootstrap page for example. Working with the Bootstrap Grid system would be great aswell.
I did some research on Google and here but didn't find any plugins or ways to do this.
I'm using 'Gridster' at the moment which this Gridstack is built off of/inspired by, so it probably won't be able to save for you.
You'll need to do that, either by sending it back via AJAX or storing in local storage. As it looks similar, you should be able to find a 'serialization' function which should wrap it up ready for you to send to your PHP via AJAX.
You may need to scan through the widgets and wrap them up in your own JSON string, such as the row/column/sizex/sizey which is all the grid system really needs to "add" a widget when its first loaded up, so as long as you can feed that back in you should be good to go.

css generator to put generated css layout into textarea

I am developing a Content Manager System using PHP and wonder if there is a css generator i can use as a plugin. The generated code is stored in MySQL database.
I have looked at many of these here, but i cant seem to see any i can provide to my users as a plugin.
I want one that creates layouts and can change background. If i cant get one, then how do i create one.
i hope you cant get any plugin for that, since the page you are designing must be known to you [positioning, font size, etc]
First, Create a complete site with some css which hold layout, like a1.css
then , you can do the same with same attributes with a2.css, a3.css...etc.. [this may be terrible]
or
you can change dynamically by Jquery to generate dynamically , like
.css( "padding-left", "+=15" )
or use different frameworks and make it accessible, LINK
hope it gives you an idea!

KnowledgeBase article creation mechanism for php, jquery, mysql

I am looking to create a general knowledgeBase for my customer service department which takes information (my thought is from a mysql database) and populates a page with that information based on the content pulled.
Take this site for example:
ToastMaster
I would like to store a primary title, main content, images, etc on my site without actually having to create unique html for each page.
Can anybody make a recommendation for existing suites I could integrate to do so?
Any of a number of content management systems could be easily used for this. Joomla!, Drupal, etc. Try a few out here: http://php.opensourcecms.com/

Categories