Appnitro Software Forums » MachForm

Getting info for PDF document

(4 posts)

  1. Hello,

    This might be beyond the scope of your support but I thought I would ask anyway.

    I've edited your code so that I can create PDF documents (Export As:); the only problem I have is that I have to open the database and find the fields I need and manually add them to the code and then Export as PDF.

    What code do I need to get MachForm to propigate to the PDF? I've been trying to decipher what you have already in there but since I don't have a lot of time to sit and stare at the code to find the logic - I thought I would ask and see if you could get me started out.

    Mashie!

    Saghalie
    http://www.beautiful-beginnings.org

    Posted 3 years ago #
  2. Hmm.. I think the best way to do this is to clone the behaviour of the current excel and csv export feature.

    If you look into export_entries.php, around line 346 you'll see the code to do the csv export

    }elseif ($type == 'csv'){
    	if(!$column_label_has_printed){
    		fputcsv($out, $column_label);
    		$column_label_has_printed = true;
    	}
    
    	foreach ($form_data as $row_data){
            	fputcsv($out, $row_data);
            }
    }


    I suppose you could replace that fputcsv() part with your own pdf write function.

    Posted 3 years ago #
  3. Spot on, I've just got to get them in an array now. Whish me luck!

    Saghalie
    http://www.beautiful-beginnings.org

    Posted 3 years ago #
  4. trevr
    Member

    Saghalie,
    could you share your code for the PDF generation please?
    I've been trying to get it worked out in a number of ways.
    I would like to have the "Export PDF" function on the confirm page.
    So a PDF can be generated before the data goes to the database.
    Thanks,
    Trevr.

    Posted 2 years ago #

RSS feed for this topic

Reply

You must log in to post.