1

I'm not so experienced programmers ... only in C # not php and html

I want to create a url link to a pdf file, I'll do a certificate when they have passed a quiz and this quiz, I would create a url link...

this is in php or html.

BeGeek
  • 11
  • 1
  • 3
  • 1
    http://stackoverflow.com/questions/3454407/generate-pdf-file-from-html-page-while-on-shared-hosting will head you in the right direction, always remember to use the search feature, 99.999% of the time its already been answered :) – Lawrence Cherone Apr 04 '11 at 07:40
  • Can you explain a bit more? Is this certificate to do with some scores which comes from DB.. If yes - you can create a page which takes the id as querystring and based on that you can generate the URL.. Just a guess as still not sure about the question – sajoshi Apr 04 '11 at 07:40
  • 2
    Uhhhh... do you want to generate the PDF, or are you just linking to it? – Rafe Kettler Apr 04 '11 at 07:41
  • I want to generate a link to the pdf file. så de user can show that it passed the quiz and certifyied – BeGeek Apr 04 '11 at 08:04
  • The user has a certificate on the webb site where they can download it to the computer.. but my boss want to have so you can put it on a CV... by a url/link... he want me to write a module for this... and I have no ide how to do it... – BeGeek Apr 04 '11 at 08:09
  • Possible duplicate of [Convert HTML + CSS to PDF with PHP?](https://stackoverflow.com/questions/391005/convert-html-css-to-pdf-with-php) – Earlee Sep 26 '17 at 07:53

2 Answers2

2

Have a look at PrinceXML.

It's definitely the best HTML/CSS to PDF converter out there, although it's not free (But hey, your programming is not free either, so if it saves you 10 hours of work, you're home free.)

Oh yeah, did I mention that this is the first (and probably only) HTML2PDF solution that does full ACID2!?

http://princexml.com/samples/

from Convert HTML + CSS to PDF with PHP?

Community
  • 1
  • 1
Mohammad Efazati
  • 4,686
  • 2
  • 33
  • 50
0

There are 2 cases:

If you want to show the result after the quiz as HTML, there's no need to mention about pdf.

But if you want to show the result as PDF and let the quiz taker download this PDF result, you will need to create a PDF file by your own code, kinda PDF library;

for PHP, you may use this standard PDF library:
http://php.net/manual/en/book.pdf.php

Example for using PDF library of PHP:
http://www.php.net/manual/en/pdf.examples-basic.php

After creating the PDF file, you can easily create an URL (a string starts with http) to that PDF file, depends on your domain, and the directory route to the just created PDF file.

Hope this may help

nicola
  • 2,043
  • 1
  • 19
  • 19
  • when I took the link road so it was only in download format .. I want it to view the certificate when you click on the link. – BeGeek Apr 04 '11 at 08:22
  • @BeGeek: i guess that you used the example from the link above to create pdf file? yes, if your web browser doesn't support showing PDF directly, it will force you to download the PDF. As what I know, you can see PDF directly in browser for the case of Google Chrome – nicola Apr 04 '11 at 08:57
  • I wrote the direct link to that pdf file ... and then became the downloaded ... I want generea allowing the user to click on a URL / link and then display pdf file in the browser ... – BeGeek Apr 04 '11 at 10:25
  • @BeGeek: as i said, the browser must support direct PDF display. Try another browser like Google Chrome. – nicola Apr 04 '11 at 10:38