SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2011
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP App printing to template

    Hello,
    I started by asking this in the CSS forum but I think I may be going about this the wrong way.
    I have developed an app that manages students courses.

    Part of this app is that once the student completes the course, the admin has to print a certification card for the student.
    The certification card is on a preprinted sheet that gets fed through the printer.
    Has space for student name, instructor name, card valid date, training location, etc.

    I have created a section of the PHP site called "Card printing" and in this section the admin selects the students that he wants to print cards for and clicks "print"
    form there I am lost on what to do.
    It needs to create a card for each student, export it to PDF or .doc file and then align perfectly with the preprinted cards.
    What is the recommended way of doing this? If i am going to PDF do I still need to create a print CSS? Any way PHP can handle something like this?

  2. #2
    Foozle Reducer ServerStorm's Avatar
    Join Date
    Feb 2005
    Location
    Burlington, Canada
    Posts
    2,699
    Mentioned
    89 Post(s)
    Tagged
    6 Thread(s)
    Hello,

    I think you were on the right track with the CSS using a print style sheet. You have a great deal of control with CSS print styles. Here is a decent article on what styles should exist print media type.

    You can open a window with your certificate and CSS print layout using JavaScript. You can also issue a window().print to automatically print a selected certificate.

    Regards,
    Steve
    ictus==""

  3. #3
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,164
    Mentioned
    153 Post(s)
    Tagged
    0 Thread(s)
    There are definitely frameworks for generating PDFs in PHP as well, fpdf (for one) coupled with fpdi is very powerful.

    With fpdi you can create a template of your cards (leave the sections you need to fill out blank), load the template, feed it to fpdf, and then write your text in the appropriate locations.

    Samples of usage can be found at: http://www.sitepoint.com/forums/show...highlight=fpdf

  4. #4
    SitePoint Zealot
    Join Date
    Jul 2012
    Location
    Scarborough, North Yorkshire, United Kingdom
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi

    Dome good suggestions from cpradio but just in case you want to try something else I've worked with dompdf before.
    Richard
    Resell SSL Certificates - API / WHMCS / HostBill / ClientExec
    ServerTastic - RapidSSL, Geotrust, Thawte, Symantec, SmarterTools and more


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •