This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

[closed] Getting info for PDF document


  1. Saghalie
    Pro Member

    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 16 years ago #
  2. yuniar

    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.


    MachForm Founder

    Posted 16 years ago #
  3. Saghalie
    Pro Member

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

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

    Posted 16 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 15 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.