Louis
To
view the script in action, visit the following link:
http://www.allportpublishing.com/_testing/CustomPDF/index.php?file=Custom-PDF-Manual
Here are the source files for this PDF:
http://www.allportpublishing.com/_testing/CustomPDF/htmlfiles/Custom-PDF-Manual
How It Works
The format for calling this script is:
PATH TO CUSTOMPDF FOLDER/index.php?file=NAME OF FOLDER WHERE SOURCE FILE IS
In this case:
index.php?file=Custom-PDF-Manual
And as you can see the source file is named:
5646546546519465106514.html
It can actually be called anything you want. I call it that so that it can't be guessed and the source stolen.
However, as you can see I've kept the folder free to view. You would disable this - all you need to do is include a blank index.html file in that foder and it can't be browsed.
For security - if you call the HTML source file anything other than htmlfile.html - you'll need to make a couple of changes so that the script can find it:
In the file:
CustomPDF\generatepdf.php
The 12th line down from the top, by default is:
readfile("htmlfiles/".$_GET['file']."/htmlfile.html");
You would change it to:
readfile("htmlfiles/".$_GET['file']."/YOUR SOURCE FILE NAME");
For this sample file, it would be:
readfile("htmlfiles/".$_GET['file']."/5646546546519465106514.html");
A second file also needs to be changed if you have called your source file anything other than htmlfile.html.
In the file:
CustomPDF\index.php
By default, the 12th line down is:
readfile("htmlfiles/" . $_GET['file'] . "/htmlfile.html");
You would change it to:
readfile("htmlfiles/" . $_GET['file'] . "/YOUR SOURCE FILE NAME");
For this sample file, it would be:
readfile("htmlfiles/" . $_GET['file'] . "/5646546546519465106514.html");
http://www.allportpublishing.com/_testing/CustomPDF/index.php?file=Custom-PDF-Manual
Here are the source files for this PDF:
http://www.allportpublishing.com/_testing/CustomPDF/htmlfiles/Custom-PDF-Manual
How It Works
The format for calling this script is:
PATH TO CUSTOMPDF FOLDER/index.php?file=NAME OF FOLDER WHERE SOURCE FILE IS
In this case:
index.php?file=Custom-PDF-Manual
And as you can see the source file is named:
5646546546519465106514.html
It can actually be called anything you want. I call it that so that it can't be guessed and the source stolen.
However, as you can see I've kept the folder free to view. You would disable this - all you need to do is include a blank index.html file in that foder and it can't be browsed.
For security - if you call the HTML source file anything other than htmlfile.html - you'll need to make a couple of changes so that the script can find it:
In the file:
CustomPDF\generatepdf.php
The 12th line down from the top, by default is:
readfile("htmlfiles/".$_GET['file']."/htmlfile.html");
You would change it to:
readfile("htmlfiles/".$_GET['file']."/YOUR SOURCE FILE NAME");
For this sample file, it would be:
readfile("htmlfiles/".$_GET['file']."/5646546546519465106514.html");
A second file also needs to be changed if you have called your source file anything other than htmlfile.html.
In the file:
CustomPDF\index.php
By default, the 12th line down is:
readfile("htmlfiles/" . $_GET['file'] . "/htmlfile.html");
You would change it to:
readfile("htmlfiles/" . $_GET['file'] . "/YOUR SOURCE FILE NAME");
For this sample file, it would be:
readfile("htmlfiles/" . $_GET['file'] . "/5646546546519465106514.html");